Interface OperatorInstance


public interface OperatorInstance
A runtime instance of a LogicalOperator. Contains statistics and execution state.
  • Method Details

    • getName

      String getName()
      Returns the short name of the operator. This will match the name specified by the call to OperatorComposable#add(LogicalOperator, String).
      Returns:
      the short name of the operator.
    • getPath

      GraphPath getPath()
      Returns the full path name of this operator. This is constructed by a chain of names from parent to child.
      Returns:
      the full path name of this operator.
    • getOperatorClassName

      String getOperatorClassName()
      Returns the fully-qualified class name of this operator.
      Returns:
      the fully-qualified class name of this operator.
    • getState

      OperatorState getState()
      Returns the execution state of this operator indicating whether it is running, failed, etc. If this corresponds to a CompositeOperator, the state is calculated by merging the children states as follows:
      • If all children are in a pre-execution state (either INITIAL or COMPILED), then
        1. State is COMPILED if any children are in the compiled state
        2. Otherwise state is INITIAL (since all children are in the initial state)
      • Otherwise if all children are in a post-execution (complete) state, then
        1. State is COMPLETE_FAILED_PRIMARY_ERROR if any children are the primary error
        2. Otherwise, state is COMPLETE_FAILED_SECONDARY_ERROR if any children are the secondary error
        3. Otherwise, state is COMPLETE_CANCELED if any children are cancelled
        4. Otherwise, state is COMPLETE_SUCCESS (since all children are in the complete-success state)
      • Otherwise, state is EXECUTING, which means that there is either a mixture of pre-execution and post-execution or that there is at least one child operator that is executing
      The merge ordering is somewhat arbitrary; in order to get fine-grained details you can call getChildOperators().
      Returns:
      the execution state of this operator.
    • getExceptions

      List<Throwable> getExceptions()
      Returns exceptions associated with the operator or empty if none. This will be populated if the state is either COMPLETE_FAILED_PRIMARY_ERROR. If this corresponds to a CompositeOperator, the error list is formed by combining errors from all of the children.
      Returns:
      exceptions associated with the operator.
    • getStatistics

      List<LogicalStatistic> getStatistics()
      Returns the operator statistics associated with the operator. The returned statistics are broken down by LogicalStatistic.nodeID(), LogicalStatistic.definition(), and LogicalStatistic.path(). If this corresponds to a CompositeOperator, this returns the statistics of all of the children operators
      Returns:
      the operator statistics associated with the operator
    • getInputPorts

      List<? extends InputPortInstance> getInputPorts()
      Returns a description of the input ports defined by this operator.
      Returns:
      a list of input ports defined by this operator.
    • getOutputPorts

      List<? extends OutputPortInstance> getOutputPorts()
      Returns a description of the output ports defined by this operator.
      Returns:
      a list of input ports defined by this operator.
    • getChildOperators

      List<? extends OperatorInstance> getChildOperators()
      Returns the children of this operator if this operator is a CompositeOperator. Otherwise returns the empty list.
      Returns:
      the children of this operator or the empty list.
    • getMetadata

      Map<String,Object> getMetadata()
      Returns the metadata associated with this operator. This is equal to the metadata specified by OperatorSettings#getMetadata() that was specified when calling OperatorComposable#add(LogicalOperator, OperatorSettings).
      Returns:
      the metadata associated with this operator.
    • getSnapshot

      OperatorInstance getSnapshot()
      Returns a snapshot that reflects a point-in-time of this operator instance.
      Returns:
      a snapshot of the operator instance
    • isCompiled

      boolean isCompiled()
      Returns whether this instance has been compiled. In the case of dynamic metadata, the consumer may see OperatorInstances which have not yet been compiled
      Returns:
      whether this instance has been compiled
    • getHistoricalStatistics

      StatisticsMap getHistoricalStatistics()
      Returns aggregations for subgraphs that have been flushed from the history.
      Returns:
      aggregations for subgraphs that have been flushed from the history.
    • getSubgraphs

      List<? extends LogicalGraphInstanceView> getSubgraphs()
      Returns a list of subgraphs that this operator has executed. As an operator executes subgraphs, it will maintain a history of graphs that were already executed. The setting EngineConfig.subgraphHistorySize(int) may be used to limit the number of subgraphs that are retained. This will always return an empty list for non-iterative operators.
      Returns:
      a list of subgraphs that this operator has executed
    • getMaxParallelism

      int getMaxParallelism()
      Returns the max parallelism set for the operator. That is, the min of the value that the operator specified and that which was configured via OperatorSettings#maxParallelism(int). Note that for composites and iterative nodes this will Integer.MAX_VALUE unless parallelism tuned down via OperatorSettings#maxParallelism(int).
      Returns:
      the max parallelism of the operator
    • getOperatorType

      OperatorType getOperatorType()
      Returns the type of operator that this instance represents.
      Returns:
      the type of operator