-
public interface OperatorInstanceA runtime instance of aLogicalOperator. Contains statistics and execution state.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<? extends OperatorInstance>getChildOperators()Returns the children of this operator if this operator is aCompositeOperator.List<Throwable>getExceptions()Returns exceptions associated with the operator or empty if none.StatisticsMapgetHistoricalStatistics()Returns aggregations for subgraphs that have been flushed from the history.List<? extends InputPortInstance>getInputPorts()Returns a description of the input ports defined by this operator.intgetMaxParallelism()Returns the max parallelism set for the operator.Map<String,Object>getMetadata()Returns the metadata associated with this operator.StringgetName()Returns the short name of the operator.StringgetOperatorClassName()Returns the fully-qualified class name of this operator.OperatorTypegetOperatorType()Returns the type of operator that this instance represents.List<? extends OutputPortInstance>getOutputPorts()Returns a description of the output ports defined by this operator.GraphPathgetPath()Returns the full path name of this operator.OperatorInstancegetSnapshot()Returns a snapshot that reflects a point-in-time of this operator instance.OperatorStategetState()Returns the execution state of this operator indicating whether it is running, failed, etc.List<LogicalStatistic>getStatistics()Returns the operator statistics associated with the operator.List<? extends LogicalGraphInstanceView>getSubgraphs()Returns a list of subgraphs that this operator has executed.booleanisCompiled()Returns whether this instance has been compiled.
-
-
-
Method Detail
-
getName
String getName()
Returns the short name of the operator. This will match the name specified by the call toOperatorComposable#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 aCompositeOperator, the state is calculated by merging the children states as follows:- If all children are in a pre-execution state (either
INITIALorCOMPILED), then - Otherwise if all children are in a post-execution (complete) state, then
- State is
COMPLETE_FAILED_PRIMARY_ERRORif any children are the primary error - Otherwise, state is
COMPLETE_FAILED_SECONDARY_ERRORif any children are the secondary error - Otherwise, state is
COMPLETE_CANCELEDif any children are cancelled - Otherwise, state is
COMPLETE_SUCCESS(since all children are in the complete-success state)
- State is
- 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
getChildOperators().- Returns:
- the execution state of this operator.
- If all children are in a pre-execution state (either
-
getExceptions
List<Throwable> getExceptions()
Returns exceptions associated with the operator or empty if none. This will be populated if thestateis eitherCOMPLETE_FAILED_PRIMARY_ERROR. If this corresponds to aCompositeOperator, 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 byLogicalStatistic.nodeID(),LogicalStatistic.definition(), andLogicalStatistic.path(). If this corresponds to aCompositeOperator, 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 aCompositeOperator. 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 byOperatorSettings#getMetadata()that was specified when callingOperatorComposable#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 settingEngineConfig.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 viaOperatorSettings#maxParallelism(int). Note that for composites and iterative nodes this willInteger.MAX_VALUEunless parallelism tuned down viaOperatorSettings#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
-
-