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
TheSimpleSplitAssigner
hands 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 void
addSplits(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.String
toString()
-
-
-
Constructor Detail
-
SimpleSplitAssigner
public SimpleSplitAssigner(Collection<FileSourceSplit> splits)
-
-
Method Detail
-
getNext
public Optional<FileSourceSplit> getNext(String hostname)
Description copied from interface:FileSplitAssigner
Gets 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:
getNext
in interfaceFileSplitAssigner
-
addSplits
public void addSplits(Collection<FileSourceSplit> newSplits)
Description copied from interface:FileSplitAssigner
Adds 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:
addSplits
in interfaceFileSplitAssigner
-
remainingSplits
public Collection<FileSourceSplit> remainingSplits()
Description copied from interface:FileSplitAssigner
Gets the remaining splits that this assigner has pending.- Specified by:
remainingSplits
in interfaceFileSplitAssigner
-
-