- 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 OperatorSettings
DEFAULT
Default operator settings: unspecified namestatic OperatorSettings
PARALLELISM_DISABLED
Operator settings withmaxParallelism
set to 1
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description OperatorSettings
disableParallelism()
Can be called to forcible disable parallelism for the given operator (and children if this is aCompositeOperator
).boolean
equals(Object o)
Equals is implemeted by comparing each of the properties of OperatorSettings.Integer
getMaxParallelism()
Returns the maximum parallelism to allow for the operator.Map<String,Object>
getMetadata()
Returns metadata associated with the operator.String
getName()
Returns the name of the operatorGraphPath
getRelativePath()
Returns the relative path of the operator.int
hashCode()
Hashcode is implemented in a way that is consistent with equals.OperatorSettings
hiddenPath(boolean hidden)
Returns an operator settings object, equivalent to this, but withhiddenPath
set to the specified value.boolean
isHiddenPath()
Returns whether the path to this operator is hidden.static OperatorSettings
MAX_PARALLELISM(int maxParallelism)
Operator settings withmaxParallelism
set to the specified value.OperatorSettings
maxParallelism(int maxParallelism)
Can be used to restrict the parallelism of an operator.OperatorSettings
metadata(String key, Object value)
Returns an operator settings object, equivalent to this, but with its metadata modified.static OperatorSettings
NAME(String name)
Operator settings withname
set to the specified value.static OperatorSettings
RELATIVE_PATH(GraphPath path)
Operator settings withrelativePath
set to the specified value.OperatorSettings
rename(GraphPath path)
Returns an operator settings object, equivalent to this, but withrelativePath
andname
set to the specified value.OperatorSettings
rename(String name)
Returns an operator settings object, equivalent to this, but withrelativePath
set to a path consisting of a single element equal to the specified name andname
set to the specified value.String
toString()
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 withmaxParallelism
set to 1
-
-
Method Detail
-
NAME
public static OperatorSettings NAME(String name)
Operator settings withname
set 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 withmaxParallelism
set 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 withrelativePath
set 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
null
if 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
RunScript
operator that contains a non-parallelizable script - If there is a
DeriveFields
operator 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 withrelativePath
andname
set 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 withrelativePath
set to a path consisting of a single element equal to the specified name andname
set 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 withhiddenPath
set 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
-
-