java.lang.Object
org.elasticsearch.compute.operator.Driver
- All Implemented Interfaces:
Closeable,AutoCloseable,Describable,org.elasticsearch.core.Releasable
A driver operates single-threadedly on a simple chain of
Operators, passing
Pages from one operator to the next. It also controls the lifecycle of the
operators.
The operator chain typically starts with a source operator (i.e. an operator that purely produces pages)
and ends with a sink operator (i.e. an operator that purely consumes pages).
More details on how this integrates with other components can be found in the package documentation of
org.elasticsearch.compute-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final org.elasticsearch.core.TimeValueMinimum time between updating status.static final org.elasticsearch.core.TimeValue -
Constructor Summary
ConstructorsConstructorDescriptionDriver(String sessionId, String shortDescription, String clusterName, String nodeName, long startTime, long startNanos, DriverContext driverContext, Supplier<String> description, SourceOperator source, List<Operator> intermediateOperators, SinkOperator sink, org.elasticsearch.core.TimeValue statusInterval, org.elasticsearch.core.Releasable releasable) Creates a new driver with a chain of operators. -
Method Summary
Modifier and TypeMethodDescriptionvoidabort(Exception reason, ActionListener<Void> listener) Abort the driver and wait for it to finishvoidvoidclose()describe()Returns a description of the component.profile()Build a "profile" of this driver's operations after it's been completed.static voidstart(ThreadContext threadContext, Executor executor, Driver driver, int maxIterations, ActionListener<Void> listener) status()Get the last status update from the driver.toString()
-
Field Details
-
DEFAULT_TIME_BEFORE_YIELDING
public static final org.elasticsearch.core.TimeValue DEFAULT_TIME_BEFORE_YIELDING -
DEFAULT_MAX_ITERATIONS
public static final int DEFAULT_MAX_ITERATIONS- See Also:
-
DEFAULT_STATUS_INTERVAL
public static final org.elasticsearch.core.TimeValue DEFAULT_STATUS_INTERVALMinimum time between updating status.
-
-
Constructor Details
-
Driver
public Driver(String sessionId, String shortDescription, String clusterName, String nodeName, long startTime, long startNanos, DriverContext driverContext, Supplier<String> description, SourceOperator source, List<Operator> intermediateOperators, SinkOperator sink, org.elasticsearch.core.TimeValue statusInterval, org.elasticsearch.core.Releasable releasable) Creates a new driver with a chain of operators.- Parameters:
sessionId- session IdshortDescription- Description of the driver. This description should be short and meaningful as a grouping identifier. We use the phase of the query right now: "data", "node_reduce", "final".driverContext- the driver contextsource- source operatorintermediateOperators- the chain of operators to executesink- sink operatorstatusInterval- minimum status reporting intervalreleasable- aReleasableto invoked once the chain of operators has run to completion
-
-
Method Details
-
driverContext
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.elasticsearch.core.Releasable
-
abort
Abort the driver and wait for it to finish -
cancel
-
start
public static void start(ThreadContext threadContext, Executor executor, Driver driver, int maxIterations, ActionListener<Void> listener) -
toString
-
describe
Description copied from interface:DescribableReturns a description of the component. This description can be more specific than Object::toString.- Specified by:
describein interfaceDescribable- Returns:
- the description
-
sessionId
-
status
Get the last status update from the driver. These updates are made when the driver is queued and after every processingbatch. -
profile
Build a "profile" of this driver's operations after it's been completed. This doesn't make sense to call before the driver is done.
-