Module org.elasticsearch.compute
Class CompleteInputCollectorOperator
java.lang.Object
org.elasticsearch.compute.operator.CompleteInputCollectorOperator
- All Implemented Interfaces:
Closeable,AutoCloseable,Operator,org.elasticsearch.core.Releasable
- Direct Known Subclasses:
ChangePointOperator,LinearScoreEvalOperator,MMROperator
A base class that loads in and works across all input pages for an operator
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.compute.operator.Operator
Operator.OperatorFactory, Operator.Status -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected intprotected longFields 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 voidadds an input page to the operator.final voidclose()notifies the operator that it won't be used anymore (i.e.final voidfinish()notifies the operator that it won't receive any more input pagesfinal Pagereturns non-null if output page available.final booleanwhether the operator has finished processing all input pages and made the corresponding output pages availableprotected abstract booleanAdds any additional checks to ensure the subclass is finishedfinal booleanwhether the given operator can accept more input pagesprotected abstract voidonClose()Additional implementation for closing out the subclassprotected abstract voidCalled when he base finish() call is completedprotected abstract PageImplementation to retrieve the output pages.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.compute.operator.Operator
canProduceMoreDataWithoutExtraInput, isBlocked, status
-
Field Details
-
finished
protected boolean finished -
inputPages
-
pagesReceived
protected int pagesReceived -
rowsReceived
protected long rowsReceived
-
-
Constructor Details
-
CompleteInputCollectorOperator
protected CompleteInputCollectorOperator()
-
-
Method Details
-
needsInput
public final boolean needsInput()Description copied from interface:Operatorwhether the given operator can accept more input pages- Specified by:
needsInputin interfaceOperator
-
addInput
Description copied from interface:Operatoradds an input page to the operator. only called when needsInput() == true and isFinished() == false -
finish
public final void finish()Description copied from interface:Operatornotifies the operator that it won't receive any more input pages -
isFinished
public final boolean isFinished()Description copied from interface:Operatorwhether the operator has finished processing all input pages and made the corresponding output pages available- Specified by:
isFinishedin interfaceOperator
-
getOutput
Description copied from interface:Operatorreturns non-null if output page available. Only called when isFinished() == false -
close
public final void close()Description copied from interface:Operatornotifies the operator that it won't be used anymore (i.e. none of the other methods called), and its resources can be cleaned up -
onFinished
protected abstract void onFinished()Called when he base finish() call is completed -
isOperatorFinished
protected abstract boolean isOperatorFinished()Adds any additional checks to ensure the subclass is finished- Returns:
- true if the subclass is finished
-
onGetOutput
Implementation to retrieve the output pages. Will only run if `isFinished()` is true- Returns:
- the output page (or null if not ready or none)
-
onClose
protected abstract void onClose()Additional implementation for closing out the subclass
-