Class RoundRobinSubpartitionSelector<T>
- java.lang.Object
-
- org.apache.flink.runtime.io.network.partition.RoundRobinSubpartitionSelector<T>
-
- All Implemented Interfaces:
SubpartitionSelector<T>
public class RoundRobinSubpartitionSelector<T> extends Object implements SubpartitionSelector<T>
ASubpartitionSelectorthat selects all subpartitions in round-robin order.
-
-
Constructor Summary
Constructors Constructor Description RoundRobinSubpartitionSelector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TgetNextSubpartitionToConsume()Returns the next subpartition to consume data.booleanisMoreSubpartitionSwitchable()Whether the invoker can get a different subpartition in the next invocation ofSubpartitionSelector.getNextSubpartitionToConsume().voidmarkLastConsumptionStatus(boolean isDataAvailable, boolean isPartialRecord)Records the status of the last consumption attempt on the subpartition returned by the last invocation ofSubpartitionSelector.getNextSubpartitionToConsume().booleannotifyDataAvailable(T subpartition)Marks a subpartition as having data available.
-
-
-
Method Detail
-
notifyDataAvailable
public boolean notifyDataAvailable(T subpartition)
Description copied from interface:SubpartitionSelectorMarks a subpartition as having data available.- Specified by:
notifyDataAvailablein interfaceSubpartitionSelector<T>- Returns:
- true if this selector did not already contain the subpartition.
-
getNextSubpartitionToConsume
public T getNextSubpartitionToConsume()
Description copied from interface:SubpartitionSelectorReturns the next subpartition to consume data.- Specified by:
getNextSubpartitionToConsumein interfaceSubpartitionSelector<T>
-
markLastConsumptionStatus
public void markLastConsumptionStatus(boolean isDataAvailable, boolean isPartialRecord)Description copied from interface:SubpartitionSelectorRecords the status of the last consumption attempt on the subpartition returned by the last invocation ofSubpartitionSelector.getNextSubpartitionToConsume().This method must be invoked every time a subpartition acquired from this class is consumed.
- Specified by:
markLastConsumptionStatusin interfaceSubpartitionSelector<T>- Parameters:
isDataAvailable- whether the consumption returned a valid data.isPartialRecord- whether the returned data contains partial record. Ignored if there was no data available.
-
isMoreSubpartitionSwitchable
public boolean isMoreSubpartitionSwitchable()
Description copied from interface:SubpartitionSelectorWhether the invoker can get a different subpartition in the next invocation ofSubpartitionSelector.getNextSubpartitionToConsume().- Specified by:
isMoreSubpartitionSwitchablein interfaceSubpartitionSelector<T>
-
-