Class LocalityAwareSplitAssigner
java.lang.Object
org.apache.flink.connector.file.src.assigners.LocalityAwareSplitAssigner
- All Implemented Interfaces:
FileSplitAssigner
A
FileSplitAssigner that assigns to each host preferably splits that are local, before
assigning splits that are not local.
Implementation Note: This class is an adjusted copy of the previous API's class LocatableInputSplitAssigner and reproduces the same assignment
logic, for compatibility. The logic has not been changed or optimized.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.flink.connector.file.src.assigners.FileSplitAssigner
FileSplitAssigner.Provider -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSplits(Collection<FileSourceSplit> splits) Adds a set of splits to this assigner.Gets the next split.Gets the remaining splits that this assigner has pending.
-
Constructor Details
-
LocalityAwareSplitAssigner
-
-
Method Details
-
getNext
Description copied from interface:FileSplitAssignerGets the next split.When this method returns an empty
Optional, then the set of splits is assumed to be done and the source will finish once the readers finished their current splits.- Specified by:
getNextin interfaceFileSplitAssigner
-
addSplits
Description copied from interface:FileSplitAssignerAdds a set of splits to this assigner. This happens for example when some split processing failed and the splits need to be re-added, or when new splits got discovered.- Specified by:
addSplitsin interfaceFileSplitAssigner
-
remainingSplits
Description copied from interface:FileSplitAssignerGets the remaining splits that this assigner has pending.- Specified by:
remainingSplitsin interfaceFileSplitAssigner
-