Class SimpleSplitAssigner
- java.lang.Object
-
- org.apache.flink.connector.file.src.assigners.SimpleSplitAssigner
-
- All Implemented Interfaces:
FileSplitAssigner
@PublicEvolving public class SimpleSplitAssigner extends Object implements FileSplitAssigner
TheSimpleSplitAssignerhands out splits in a random order, without any consideration for order or locality.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.connector.file.src.assigners.FileSplitAssigner
FileSplitAssigner.Provider
-
-
Constructor Summary
Constructors Constructor Description SimpleSplitAssigner(Collection<FileSourceSplit> splits)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSplits(Collection<FileSourceSplit> newSplits)Adds a set of splits to this assigner.Optional<FileSourceSplit>getNext(String hostname)Gets the next split.Collection<FileSourceSplit>remainingSplits()Gets the remaining splits that this assigner has pending.StringtoString()
-
-
-
Constructor Detail
-
SimpleSplitAssigner
public SimpleSplitAssigner(Collection<FileSourceSplit> splits)
-
-
Method Detail
-
getNext
public Optional<FileSourceSplit> getNext(String hostname)
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
public void addSplits(Collection<FileSourceSplit> newSplits)
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
public Collection<FileSourceSplit> remainingSplits()
Description copied from interface:FileSplitAssignerGets the remaining splits that this assigner has pending.- Specified by:
remainingSplitsin interfaceFileSplitAssigner
-
-