Class RoundRobinSubpartitionSelector<T>
java.lang.Object
org.apache.flink.runtime.io.network.partition.RoundRobinSubpartitionSelector<T>
- All Implemented Interfaces:
SubpartitionSelector<T>
A
SubpartitionSelector that selects all subpartitions in round-robin order.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the next subpartition to consume data.booleanWhether 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.
-
Constructor Details
-
RoundRobinSubpartitionSelector
public RoundRobinSubpartitionSelector()
-
-
Method Details
-
notifyDataAvailable
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
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>
-