- java.lang.Object
-
- com.pervasive.datarush.operators.OperatorSettings
-
public final class OperatorSettings extends Object
Advanced operator settings that can be specified for an operator. Primarily used internally; operator/graph consumers should generally not need to use this.
-
-
Field Summary
Fields Modifier and Type Field Description static OperatorSettingsDEFAULTDefault operator settings: unspecified namestatic OperatorSettingsPARALLELISM_DISABLEDOperator settings withmaxParallelismset to 1
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description OperatorSettingsdisableParallelism()Can be called to forcible disable parallelism for the given operator (and children if this is aCompositeOperator).booleanequals(Object o)Equals is implemeted by comparing each of the properties of OperatorSettings.IntegergetMaxParallelism()Returns the maximum parallelism to allow for the operator.Map<String,Object>getMetadata()Returns metadata associated with the operator.StringgetName()Returns the name of the operatorGraphPathgetRelativePath()Returns the relative path of the operator.inthashCode()Hashcode is implemented in a way that is consistent with equals.OperatorSettingshiddenPath(boolean hidden)Returns an operator settings object, equivalent to this, but withhiddenPathset to the specified value.booleanisHiddenPath()Returns whether the path to this operator is hidden.static OperatorSettingsMAX_PARALLELISM(int maxParallelism)Operator settings withmaxParallelismset to the specified value.OperatorSettingsmaxParallelism(int maxParallelism)Can be used to restrict the parallelism of an operator.OperatorSettingsmetadata(String key, Object value)Returns an operator settings object, equivalent to this, but with its metadata modified.static OperatorSettingsNAME(String name)Operator settings withnameset to the specified value.static OperatorSettingsRELATIVE_PATH(GraphPath path)Operator settings withrelativePathset to the specified value.OperatorSettingsrename(GraphPath path)Returns an operator settings object, equivalent to this, but withrelativePathandnameset to the specified value.OperatorSettingsrename(String name)Returns an operator settings object, equivalent to this, but withrelativePathset to a path consisting of a single element equal to the specified name andnameset to the specified value.StringtoString()Returns a display string
-
-
-
Field Detail
-
DEFAULT
public static OperatorSettings DEFAULT
Default operator settings: unspecified name
-
PARALLELISM_DISABLED
public static OperatorSettings PARALLELISM_DISABLED
Operator settings withmaxParallelismset to 1
-
-
Method Detail
-
NAME
public static OperatorSettings NAME(String name)
Operator settings withnameset to the specified value.- Parameters:
name- the name of the operator- Returns:
- an operator settings
-
MAX_PARALLELISM
public static OperatorSettings MAX_PARALLELISM(int maxParallelism)
Operator settings withmaxParallelismset to the specified value.- Parameters:
name- the name of the operator- Returns:
- an operator settings
-
RELATIVE_PATH
public static OperatorSettings RELATIVE_PATH(GraphPath path)
Operator settings withrelativePathset to the specified value.- Parameters:
path- the relative path of the operator- Returns:
- an operator settings
-
getName
public String getName()
Returns the name of the operator- Returns:
- the name of the operator
-
getRelativePath
public GraphPath getRelativePath()
Returns the relative path of the operator. By default this the the same as name, but we have some internal artifacts for which we want control over naming.- Returns:
- the relative of the operator
-
getMaxParallelism
public Integer getMaxParallelism()
Returns the maximum parallelism to allow for the operator. The actual parallelism used will be the min ofEngineConfig#getParallelism()and that specified here.- Returns:
- the max parallelism or
nullif unspecified
-
isHiddenPath
public boolean isHiddenPath()
Returns whether the path to this operator is hidden. Normally this is always false; used internally to hide generated artifacts from displayed error paths.- Returns:
- whether the path to this operator is hidden
-
getMetadata
public Map<String,Object> getMetadata()
Returns metadata associated with the operator. Metadata can consist of arbitrary key-value pairs. This is intended to hold application-specific information that is then available in theOperatorInstance.- Returns:
- an immutable view of the metadata
-
hashCode
public int hashCode()
Hashcode is implemented in a way that is consistent with equals.
-
equals
public boolean equals(Object o)
Equals is implemeted by comparing each of the properties of OperatorSettings.
-
toString
public String toString()
Returns a display string
-
disableParallelism
public OperatorSettings disableParallelism()
Can be called to forcible disable parallelism for the given operator (and children if this is aCompositeOperator). This method should be used sparingly since it will degrade performance significantly; but is needed in certain cases. For example:- If there is a
RunScriptoperator that contains a non-parallelizable script - If there is a
DeriveFieldsoperator that contains a non-parallelizable function
- Returns:
- an operator settings object, equivalent to this, but with parallelism disabled
- If there is a
-
maxParallelism
public OperatorSettings maxParallelism(int maxParallelism)
Can be used to restrict the parallelism of an operator. Note that this can be used to limit the parallelism of an operator but never increase that which the operator already allows.- Parameters:
maxParallelism- the max parallelism to allow- Returns:
- an operator settings object, equivalent to this, but with maxParallelism set to that specified
-
rename
public OperatorSettings rename(GraphPath path)
Returns an operator settings object, equivalent to this, but withrelativePathandnameset to the specified value.- Parameters:
path- the relative path- Returns:
- an operator settings object
-
rename
public OperatorSettings rename(String name)
Returns an operator settings object, equivalent to this, but withrelativePathset to a path consisting of a single element equal to the specified name andnameset to the specified value.- Parameters:
name- the name- Returns:
- an operator settings object
-
hiddenPath
public OperatorSettings hiddenPath(boolean hidden)
Returns an operator settings object, equivalent to this, but withhiddenPathset to the specified value.- Parameters:
hidden- whether this path is hidden- Returns:
- an operator settings object
-
metadata
public OperatorSettings metadata(String key, Object value)
Returns an operator settings object, equivalent to this, but with its metadata modified.- Parameters:
key- the metadata key to setvalue- the value to set it to- Returns:
- an operator settings object
-
-