T
- data type that could be used to represent a subpartition.public interface SubpartitionSelector<T>
SubpartitionSelector
helps to choose from multiple available subpartitions when their
output buffers should union into one stream.Modifier and Type | Method and Description |
---|---|
T |
getNextSubpartitionToConsume()
Returns the next subpartition to consume data.
|
boolean |
isMoreSubpartitionSwitchable()
Whether the invoker can get a different subpartition in the next invocation of
getNextSubpartitionToConsume() . |
void |
markLastConsumptionStatus(boolean isDataAvailable,
boolean isPartialRecord)
Records the status of the last consumption attempt on the subpartition returned by the last
invocation of
getNextSubpartitionToConsume() . |
boolean |
notifyDataAvailable(T subpartition)
Marks a subpartition as having data available.
|
boolean notifyDataAvailable(T subpartition)
T getNextSubpartitionToConsume()
void markLastConsumptionStatus(boolean isDataAvailable, boolean isPartialRecord)
getNextSubpartitionToConsume()
.
This method must be invoked every time a subpartition acquired from this class is consumed.
isDataAvailable
- whether the consumption returned a valid data.isPartialRecord
- whether the returned data contains partial record. Ignored if there
was no data available.boolean isMoreSubpartitionSwitchable()
getNextSubpartitionToConsume()
.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.