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 the RecordsBySplits(Map, Set) constructor.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • 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()