Package io.prestosql.operator
Class WorkProcessorPipelineSourceOperator
- java.lang.Object
-
- io.prestosql.operator.WorkProcessorPipelineSourceOperator
-
- All Implemented Interfaces:
Operator
,SourceOperator
,AutoCloseable
public class WorkProcessorPipelineSourceOperator extends Object implements SourceOperator
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WorkProcessorPipelineSourceOperator.WorkProcessorPipelineSourceOperatorFactory
-
Field Summary
-
Fields inherited from interface io.prestosql.operator.Operator
NOT_BLOCKED
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addInput(Page page)
Adds an input page to the operator.Supplier<Optional<UpdatablePageSource>>
addSplit(Split split)
void
close()
This method will always be called before releasing the Operator reference.static List<OperatorFactory>
convertOperators(int operatorId, List<OperatorFactory> operatorFactories)
void
finish()
Notifies the operator that no more pages will be added and the operator should finish processing and flush results.void
finishMemoryRevoke()
Clean up and release resources after completed memory revoking.OperatorContext
getOperatorContext()
Page
getOutput()
Gets an output page from the operator.PlanNodeId
getSourceId()
com.google.common.util.concurrent.ListenableFuture<?>
isBlocked()
Returns a future that will be completed when the operator becomes unblocked.boolean
isFinished()
Is this operator completely finished processing and no more output pages will be produced.boolean
needsInput()
Returns true if and only if this operator can accept an input page.void
noMoreSplits()
com.google.common.util.concurrent.ListenableFuture<?>
startMemoryRevoke()
After calling this method operator should revoke all reserved revocable memory.
-
-
-
Method Detail
-
convertOperators
public static List<OperatorFactory> convertOperators(int operatorId, List<OperatorFactory> operatorFactories)
-
getSourceId
public PlanNodeId getSourceId()
- Specified by:
getSourceId
in interfaceSourceOperator
-
addSplit
public Supplier<Optional<UpdatablePageSource>> addSplit(Split split)
- Specified by:
addSplit
in interfaceSourceOperator
-
noMoreSplits
public void noMoreSplits()
- Specified by:
noMoreSplits
in interfaceSourceOperator
-
getOperatorContext
public OperatorContext getOperatorContext()
- Specified by:
getOperatorContext
in interfaceOperator
-
needsInput
public boolean needsInput()
Description copied from interface:Operator
Returns true if and only if this operator can accept an input page.- Specified by:
needsInput
in interfaceOperator
-
addInput
public void addInput(Page page)
Description copied from interface:Operator
Adds an input page to the operator. This method will only be called ifneedsInput()
returns true.
-
getOutput
public Page getOutput()
Description copied from interface:Operator
Gets an output page from the operator. If no output data is currently available, return null.
-
startMemoryRevoke
public com.google.common.util.concurrent.ListenableFuture<?> startMemoryRevoke()
Description copied from interface:Operator
After calling this method operator should revoke all reserved revocable memory. As soon as memory is revoked returned future should be marked as done.Spawned threads cannot modify OperatorContext because it's not thread safe. For this purpose implement
Operator.finishMemoryRevoke()
Since memory revoking signal is delivered asynchronously to the Operator, implementation must gracefully handle the case when there no longer is any revocable memory allocated.
After this method is called on Operator the Driver is disallowed to call any processing methods on it (isBlocked/needsInput/addInput/getOutput) until
Operator.finishMemoryRevoke()
is called.- Specified by:
startMemoryRevoke
in interfaceOperator
-
finishMemoryRevoke
public void finishMemoryRevoke()
Description copied from interface:Operator
Clean up and release resources after completed memory revoking. Called by driver once future returned by startMemoryRevoke is completed.- Specified by:
finishMemoryRevoke
in interfaceOperator
-
finish
public void finish()
Description copied from interface:Operator
Notifies the operator that no more pages will be added and the operator should finish processing and flush results. This method will not be called if the Task is already failed or canceled.
-
isFinished
public boolean isFinished()
Description copied from interface:Operator
Is this operator completely finished processing and no more output pages will be produced.- Specified by:
isFinished
in interfaceOperator
-
isBlocked
public com.google.common.util.concurrent.ListenableFuture<?> isBlocked()
Description copied from interface:Operator
Returns a future that will be completed when the operator becomes unblocked. If the operator is not blocked, this method should returnNOT_BLOCKED
.
-
close
public void close()
Description copied from interface:Operator
This method will always be called before releasing the Operator reference.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceOperator
-
-