java.lang.Object
org.elasticsearch.compute.operator.SourceOperator
- All Implemented Interfaces:
Closeable,AutoCloseable,Operator,org.elasticsearch.core.Releasable
- Direct Known Subclasses:
EnrichQuerySourceOperator,ExchangeSourceOperator,LocalSourceOperator,LuceneOperator
A source operator - produces output, accepts no input.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic interfaceA factory for creating source operators.Nested classes/interfaces inherited from interface org.elasticsearch.compute.operator.Operator
Operator.OperatorFactory, Operator.Status -
Field Summary
Fields inherited from interface org.elasticsearch.compute.operator.Operator
MIN_TARGET_PAGE_SIZE, NOT_BLOCKED, TARGET_PAGE_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidA source operator does not accept input - unconditionally throws UnsupportedOperationException.booleanReturns true if the operator can produce more output pages without requiring additional input pages.final booleanA source operator needs no input - unconditionally returns false.protected List<SourceOperator.ShardLoad> shardLoadDelta(long now) Returns a snapshot of shard load accumulated since the previous invocation.
-
Constructor Details
-
SourceOperator
public SourceOperator()
-
-
Method Details
-
needsInput
public final boolean needsInput()A source operator needs no input - unconditionally returns false.- Specified by:
needsInputin interfaceOperator- Returns:
- false
-
addInput
A source operator does not accept input - unconditionally throws UnsupportedOperationException. -
canProduceMoreDataWithoutExtraInput
public boolean canProduceMoreDataWithoutExtraInput()Description copied from interface:OperatorReturns true if the operator can produce more output pages without requiring additional input pages. This is useful for operators that buffer data or have internal state that can produce multiple output pages.Operators that do not buffer data should return
false- they cannot produce pages out of thin air. Examples of operators that may returntrue:- Operators with internal buffers (e.g.,
AsyncOperatorwith pending results) - Operators processing a single input page into multiple output pages
- Aggregation operators that buffer partial results
- Specified by:
canProduceMoreDataWithoutExtraInputin interfaceOperator- Returns:
trueif the operator has buffered data that can produce output,falseotherwise
- Operators with internal buffers (e.g.,
-
shardLoadDelta
Returns a snapshot of shard load accumulated since the previous invocation.This method is meant to be overridden by
SourceOperatorimplementations that can attribute produced pages to shards or indices.The snapshot represents a delta: implementations must reset their internal counters after the snapshot is taken so that each invocation reports only the load observed since the last call.
Source operators that do not operate on shards or indices can ignore this mechanism and rely on the default implementation, which returns an empty list.
- Returns:
- list of per-shard load since the last call
-