Class RecordsBySplits.Builder<E>
- java.lang.Object
-
- org.apache.flink.connector.base.source.reader.RecordsBySplits.Builder<E>
-
- Enclosing class:
- RecordsBySplits<E>
public static class RecordsBySplits.Builder<E> extends Object
A utility builder to collect records in individual calls, rather than put a finished collection in theRecordsBySplits(Map, Set)constructor.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(String splitId, E record)Add the record from the given split ID.voidadd(org.apache.flink.api.connector.source.SourceSplit split, E record)Add the record from the given source split.voidaddAll(String splitId, Collection<E> records)Add multiple records from the given split ID.voidaddAll(org.apache.flink.api.connector.source.SourceSplit split, Collection<E> records)Add multiple records from the given source split.voidaddFinishedSplit(String splitId)Mark the split with the given ID as finished.voidaddFinishedSplits(Collection<String> splitIds)Mark multiple splits with the given IDs as finished.RecordsBySplits<E>build()
-
-
-
Method Detail
-
add
public void add(String splitId, E record)
Add the record from the given split ID.- Parameters:
splitId- the split ID the record was from.record- the record to add.
-
add
public void add(org.apache.flink.api.connector.source.SourceSplit split, E record)Add the record from the given source split.- Parameters:
split- the source split the record was from.record- the record to add.
-
addAll
public void addAll(String splitId, Collection<E> records)
Add multiple records from the given split ID.- Parameters:
splitId- the split ID given the records were from.records- the records to add.
-
addAll
public void addAll(org.apache.flink.api.connector.source.SourceSplit split, Collection<E> records)Add multiple records from the given source split.- Parameters:
split- the source split the records were from.records- the records to add.
-
addFinishedSplit
public void addFinishedSplit(String splitId)
Mark the split with the given ID as finished.- Parameters:
splitId- the ID of the finished split.
-
addFinishedSplits
public void addFinishedSplits(Collection<String> splitIds)
Mark multiple splits with the given IDs as finished.- Parameters:
splitIds- the IDs of the finished splits.
-
build
public RecordsBySplits<E> build()
-
-