Class 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.
    • Method Detail

      • NAME

        public static OperatorSettings NAME​(String name)
        Operator settings with name 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 with maxParallelism 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 with relativePath 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 of EngineConfig#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 the OperatorInstance.
        Returns:
        an immutable view of the metadata
      • hashCode

        public int hashCode()
        Hashcode is implemented in a way that is consistent with equals.
        Overrides:
        hashCode in class Object
        Returns:
        the hashcode
      • equals

        public boolean equals​(Object o)
        Equals is implemeted by comparing each of the properties of OperatorSettings.
        Overrides:
        equals in class Object
        Parameters:
        o - the other object
        Returns:
        true if this is equal to o
      • toString

        public String toString()
        Returns a display string
        Overrides:
        toString in class Object
        Returns:
        a display string
      • disableParallelism

        public OperatorSettings disableParallelism()
        Can be called to forcible disable parallelism for the given operator (and children if this is a CompositeOperator). This method should be used sparingly since it will degrade performance significantly; but is needed in certain cases. For example:
        1. If there is a RunScript operator that contains a non-parallelizable script
        2. If there is a DeriveFields operator that contains a non-parallelizable function
        Returns:
        an operator settings object, equivalent to this, but with parallelism disabled
      • 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 with relativePath and name 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 with relativePath set to a path consisting of a single element equal to the specified name and name 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 with hiddenPath 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 set
        value - the value to set it to
        Returns:
        an operator settings object