Class Offsets<P extends Partition,O extends OffsetContext>

java.lang.Object
io.debezium.pipeline.spi.Offsets<P,O>
All Implemented Interfaces:
Iterable<Map.Entry<P,O>>

public final class Offsets<P extends Partition,O extends OffsetContext> extends Object implements Iterable<Map.Entry<P,O>>
Keeps track the source partitions to be processed by the connector task and their respective offsets.
  • Field Details

  • Constructor Details

    • Offsets

      private Offsets(Map<P,O> offsets)
  • Method Details

    • of

      public static <P extends Partition, O extends OffsetContext> Offsets<P,O> of(P partition, O position)
    • of

      public static <P extends Partition, O extends OffsetContext> Offsets<P,O> of(Map<P,O> offsets)
    • resetOffset

      public void resetOffset(P partition)
    • getPartitions

      public Set<P> getPartitions()
    • getOffsets

      public Map<P,O> getOffsets()
    • iterator

      public Iterator<Map.Entry<P,O>> iterator()
      Specified by:
      iterator in interface Iterable<P extends Partition>
    • getTheOnlyPartition

      public P getTheOnlyPartition()
      Returns the offset of the only partition that the task is configured to use. This method is meant to be used only by the connectors that do not implement handling multiple partitions per task.
    • getTheOnlyOffset

      public O getTheOnlyOffset()
      Returns the offset of the only offset that the task is configured to use. This method is meant to be used only by the connectors that do not implement handling multiple partitions per task.