Module org.elasticsearch.compute
Class PageToBatchPageOperator
java.lang.Object
org.elasticsearch.compute.operator.SinkOperator
org.elasticsearch.compute.operator.exchange.PageToBatchPageOperator
- All Implemented Interfaces:
Closeable,AutoCloseable,Operator,Releasable
Operator that wraps a sink and converts Pages to BatchPages before passing them to the sink.
This ensures all output pages have batch metadata attached.
Implements single-page buffering to optimize batch marker handling:
- Buffers one page at a time
- When a new page arrives, sends the buffered page with isLastPageInBatch=false and buffers the new one
- When batch ends,
flushBatch()sends the buffered page with isLastPageInBatch=true - If no pages were produced (empty result), sends an empty marker page
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.compute.operator.SinkOperator
SinkOperator.SinkOperatorFactoryNested 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()notifies the operator that it won't be used anymore (i.e.protected voiddoAddInput(Page page) voidfinish()notifies the operator that it won't receive any more input pagesbooleanwhether the operator has finished processing all input pages and made the corresponding output pages availablebooleanwhether the given operator can accept more input pagesMethods inherited from class org.elasticsearch.compute.operator.SinkOperator
addInput, canProduceMoreDataWithoutExtraInput, getOutputMethods 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
isBlocked, status, tryPromote
-
Method Details
-
needsInput
public boolean needsInput()Description copied from interface:Operatorwhether the given operator can accept more input pages -
doAddInput
- Specified by:
doAddInputin classSinkOperator
-
finish
public void finish()Description copied from interface:Operatornotifies the operator that it won't receive any more input pages -
isFinished
public boolean isFinished()Description copied from interface:Operatorwhether the operator has finished processing all input pages and made the corresponding output pages available -
close
public 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
-