Package org.apache.druid.query.operator
Enum Class Operator.Signal
- All Implemented Interfaces:
Serializable,Comparable<Operator.Signal>,Constable
- Enclosing interface:
- Operator
This is the return object from a receiver. It is used to communicate to whatever is pushing the data into the
receiver the state of processing. This exists because Operators can sometimes decide that no more results will
be needed (e.g. if the result set is being limited), in which case, they need some way to communicate this
to downstream processing to effectively "cancel" further computation.
It's named weird because... well, the author had a hard time coming up with a meaningful name. Suggestions for alternate names are welcome.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionIndicates that more data is welcome.Indicates that the downstream processing should pause its pushing of results and instead return a continuation object that encapsulates whatever state is required to resume processing.Indicates that the downstream processing need not do anything else. -
Method Summary
Modifier and TypeMethodDescriptionstatic Operator.SignalReturns the enum constant of this class with the specified name.static Operator.Signal[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
STOP
Indicates that the downstream processing need not do anything else. Operators that return this should avoid pre-emptively callingOperator.Receiver.completed()before returning STOP. They should instead return STOP and trust that the downstream code will callOperator.Receiver.completed(). This is because downstream code *might* be pipelining computations to prepare the next set of data and if the Operator first callsOperator.Receiver.completed()before communicating that no further results are needed, it delays the canceling of the pipelined operations and effectively wastes CPU cycles. -
PAUSE
Indicates that the downstream processing should pause its pushing of results and instead return a continuation object that encapsulates whatever state is required to resume processing. When this signal is received, Operators that are generating data might choose to exert backpressure or otherwise pause their processing efforts until called again with the returned continuation object.If an Operator has completed its processing already when this signal is received, instead of returning a continuation object, it should call
Operator.Receiver.completed()and return null. -
GO
Indicates that more data is welcome.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-