Package org.apache.flink.api.common.io
Class LocatableInputSplitAssigner
- java.lang.Object
-
- org.apache.flink.api.common.io.LocatableInputSplitAssigner
-
- All Implemented Interfaces:
InputSplitAssigner
@Public public final class LocatableInputSplitAssigner extends Object implements InputSplitAssigner
The locatable input split assigner assigns to each host splits that are local, before assigning splits that are not local.
-
-
Constructor Summary
Constructors Constructor Description LocatableInputSplitAssigner(Collection<LocatableInputSplit> splits)
LocatableInputSplitAssigner(LocatableInputSplit[] splits)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LocatableInputSplit
getNextInputSplit(String host, int taskId)
Returns the next input split that shall be consumed.int
getNumberOfLocalAssignments()
int
getNumberOfRemoteAssignments()
void
returnInputSplit(List<InputSplit> splits, int taskId)
Return the splits to assigner if the task failed to process it.
-
-
-
Constructor Detail
-
LocatableInputSplitAssigner
public LocatableInputSplitAssigner(Collection<LocatableInputSplit> splits)
-
LocatableInputSplitAssigner
public LocatableInputSplitAssigner(LocatableInputSplit[] splits)
-
-
Method Detail
-
getNextInputSplit
public LocatableInputSplit getNextInputSplit(String host, int taskId)
Description copied from interface:InputSplitAssigner
Returns the next input split that shall be consumed. The consumer's host is passed as a parameter to allow localized assignments.- Specified by:
getNextInputSplit
in interfaceInputSplitAssigner
- Parameters:
host
- The host address of split requesting task.taskId
- The id of the split requesting task.- Returns:
- the next input split to be consumed, or
null
if no more splits remain.
-
returnInputSplit
public void returnInputSplit(List<InputSplit> splits, int taskId)
Description copied from interface:InputSplitAssigner
Return the splits to assigner if the task failed to process it.- Specified by:
returnInputSplit
in interfaceInputSplitAssigner
- Parameters:
splits
- The list of input splits to be returned.taskId
- The id of the task that failed to process the input splits.
-
getNumberOfLocalAssignments
public int getNumberOfLocalAssignments()
-
getNumberOfRemoteAssignments
public int getNumberOfRemoteAssignments()
-
-