public final class ClearCommand extends SimpleCommand
SimpleCommand that clears data from the measures of a cube during a build process. You use a ClearCommand in a BuildSpecification for an MdmCube to delete existing data before using a LoadCommand to load data in the measures of the cube.
You can add ClearCommand in a BuildSpecification for an MdmPrimaryDimension, which deletes all members of the dimension. Instead, however, you can use a synchronized load command, which deletes dimension members that no longer exist in the relational source tables. To get a synchronized load command, use the LoadCommand.SYNCH constant.
You get an instance of a ClearCommand by using one of static constant fields of this class. Each constant produces a ClearCommand that specifies a different extent and manner of clearing of data. You can clear detail (leaf-level) values only, aggregate values only, or all values. You can also clear the data serially or by using parallel processes. A serial clear operation uses a single process when clearing partitioned data, regardless of the parallelism setting specified by the BuildProperties object that is associated with the BuildProcess. A parallel clear operation uses multiple processes when clearing partitioned data.
For the constant fields CLEAR, CLEAR_PARALLEL, and CLEAR_SERIAL, which do not explicitly specify that the target of the CLEAR operation is the detail, aggregate, or all values, the target is determined by the refresh method specified for the build. For a description of the refresh methods, see the of setRefreshMethodBuildProperties. The refresh method affects a ClearCommand as follows.
| Refresh Method | Effect on ClearCommand |
|---|---|
C |
Results in a CLEAR_VALUES, which deletes all values. |
S |
Results in a CLEAR_LEAVES, which deletes detail-level values. |
F or P |
Results in the refreshing of materialized views, which does not involve a CLEAR operation. |
? |
Results in the effect of an F, P, C, or S, depending on the cube and the changes that have occurred since the last refresh. |
| Modifier and Type | Field and Description |
|---|---|
static ClearCommand |
CLEAR
Produces a
ClearCommand that specifies deleting either detail values only or all values, depending on the refresh method of the build. |
static ClearCommand |
CLEAR_AGGREGATES
Produces a
ClearCommand that specifies deleting only the aggregate values of the measures of a cube. |
static ClearCommand |
CLEAR_AGGREGATES_PARALLEL
Produces a
ClearCommand that specifies deleting only the aggregate values of the measures of a cube using parallel processes, if possible. |
static ClearCommand |
CLEAR_AGGREGATES_SERIAL
Produces a
ClearCommand that specifies deleting only the aggregate values of the measures of a cube using a single process. |
static ClearCommand |
CLEAR_LEAVES
Produces a
ClearCommand that specifies deleting only the detail values of the measures of a cube. |
static ClearCommand |
CLEAR_LEAVES_PARALLEL
Produces a
ClearCommand that specifies deleting only the detail values of the measures of a cube using parallel processes, if possible. |
static ClearCommand |
CLEAR_LEAVES_SERIAL
Produces a
ClearCommand that specifies deleting only the detail values of the measures of a cube using a single process. |
static ClearCommand |
CLEAR_PARALLEL
Produces a
ClearCommand that specifies using parallel processes in deleting either detail values only or all values, depending on the refresh method of the build. |
static ClearCommand |
CLEAR_SERIAL
Produces a
ClearCommand that specifies using a single process in deleting either detail values only or all values, depending on the refresh method of the build. |
static java.lang.String |
CLEAR_TARGET_AGGREGATES
A constant that specifies clearing the aggregate values of the target.
|
static java.lang.String |
CLEAR_TARGET_ALL_AGGREGATES
A constant that specifies clearing all of the aggregate values of the target.
|
static java.lang.String |
CLEAR_TARGET_LEAVES
A constant that specifies clearing the leaf values of the target.
|
static java.lang.String |
CLEAR_TARGET_NONE
A constant that specifies clearing none of the values of the target.
|
static java.lang.String |
CLEAR_TARGET_STALE_AGGREGATES
A constant that specifies clearing the stale aggregate values of the target.
|
static java.lang.String |
CLEAR_TARGET_VALUES
A constant that specifies clearing all of the values of the target.
|
static ClearCommand |
CLEAR_VALUES
Produces a
ClearCommand that specifies deleting all of the values of the measures of a cube. |
static ClearCommand |
CLEAR_VALUES_PARALLEL
Produces a
ClearCommand that specifies deleting all of the values of the measures of a cube using parallel processes, if possible. |
static ClearCommand |
CLEAR_VALUES_SERIAL
Produces a
ClearCommand that specifies deleting all of the values of the measures of a cube using a single process. |
static java.lang.String |
NO_PARALLELISM_OPTION
A constant that specifies no parallelism for a
ClearCommand. |
static java.lang.String |
PARALLEL_OPTION
A constant that specifies using parallel processes, if possible, for a
ClearCommand. |
static java.lang.String |
SERIAL_OPTION
A constant that specifies using a single process for a
ClearCommand. |
| Constructor and Description |
|---|
ClearCommand(java.lang.String clearTarget, java.lang.String parallelismOption)
Creates a
ClearCommand with the specified target and parallelism options. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getClearTarget()
Gets a static value that indicates the extent of the clearing of measure values that this
ClearCommand represents, such as CLEAR_TARGET_AGGREGATES, CLEAR_TARGET_LEAVES, or CLEAR_TARGET_VALUES, or CLEAR_TARGET_NONE. |
java.lang.String |
getParallelismOption()
Gets a static value that indicates the parallelism option of this
ClearCommand, which can be PARALLEL_OPTION, SERIAL_OPTION, or NO_PARALLELISM_OPTION. |
java.lang.Object |
visit(SyntaxObjectVisitor visitor, java.lang.Object context)
Calls the
visitClearCommand method of the SyntaxObjectVisitor and passes that method this ClearCommand and an Object. |
equals, equals, fromSyntax, fromSyntax, fromSyntax, fromSyntax, fromSyntax, isValid, toSyntax, toSyntax, toSyntax, toSyntax, toSyntax, toSyntaxpublic static final java.lang.String NO_PARALLELISM_OPTION
ClearCommand.public static final java.lang.String SERIAL_OPTION
ClearCommand.public static final java.lang.String PARALLEL_OPTION
ClearCommand.public static final java.lang.String CLEAR_TARGET_AGGREGATES
public static final java.lang.String CLEAR_TARGET_LEAVES
public static final java.lang.String CLEAR_TARGET_VALUES
public static final java.lang.String CLEAR_TARGET_NONE
public static final java.lang.String CLEAR_TARGET_STALE_AGGREGATES
public static final java.lang.String CLEAR_TARGET_ALL_AGGREGATES
public static final ClearCommand CLEAR
ClearCommand that specifies deleting either detail values only or all values, depending on the refresh method of the build.public static final ClearCommand CLEAR_PARALLEL
ClearCommand that specifies using parallel processes in deleting either detail values only or all values, depending on the refresh method of the build.public static final ClearCommand CLEAR_SERIAL
ClearCommand that specifies using a single process in deleting either detail values only or all values, depending on the refresh method of the build.public static final ClearCommand CLEAR_VALUES
ClearCommand that specifies deleting all of the values of the measures of a cube.public static final ClearCommand CLEAR_VALUES_SERIAL
ClearCommand that specifies deleting all of the values of the measures of a cube using a single process.public static final ClearCommand CLEAR_VALUES_PARALLEL
ClearCommand that specifies deleting all of the values of the measures of a cube using parallel processes, if possible.public static final ClearCommand CLEAR_AGGREGATES
ClearCommand that specifies deleting only the aggregate values of the measures of a cube.public static final ClearCommand CLEAR_AGGREGATES_PARALLEL
ClearCommand that specifies deleting only the aggregate values of the measures of a cube using parallel processes, if possible.public static final ClearCommand CLEAR_AGGREGATES_SERIAL
ClearCommand that specifies deleting only the aggregate values of the measures of a cube using a single process.public static final ClearCommand CLEAR_LEAVES
ClearCommand that specifies deleting only the detail values of the measures of a cube.public static final ClearCommand CLEAR_LEAVES_SERIAL
ClearCommand that specifies deleting only the detail values of the measures of a cube using a single process.public static final ClearCommand CLEAR_LEAVES_PARALLEL
ClearCommand that specifies deleting only the detail values of the measures of a cube using parallel processes, if possible.
public ClearCommand(java.lang.String clearTarget,
java.lang.String parallelismOption)
ClearCommand with the specified target and parallelism options.clearTarget - One of the ClearTarget constants, such as ClearTargetAggregates or ClearTargetValues.parallelismOption - NO_PARALLELISM_OPTION, PARALLEL_OPTION, or SERIAL_OPTION.public java.lang.Object visit(SyntaxObjectVisitor visitor, java.lang.Object context)
visitClearCommand method of the SyntaxObjectVisitor and passes that method this ClearCommand and an Object.visit in class SyntaxObjectvisitor - A SyntaxObjectVisitor.context - An Object.Object returned by the visitClearCommand method.public java.lang.String getClearTarget()
ClearCommand represents, such as CLEAR_TARGET_AGGREGATES, CLEAR_TARGET_LEAVES, or CLEAR_TARGET_VALUES, or CLEAR_TARGET_NONE. For the ClearCommand objects produced by the CLEAR, CLEAR_PARALLEL, and CLEAR_SERIAL constants, this method returns CLEAR_TARGET_NONE.String that indicates the extent of the clearing of the measure values.public java.lang.String getParallelismOption()
ClearCommand, which can be PARALLEL_OPTION, SERIAL_OPTION, or NO_PARALLELISM_OPTION.