Class LastKey<K extends Comparable<K>>

java.lang.Object
io.aiven.commons.kafka.connector.source.lookback.LastKey<K>
Type Parameters:
K - the key type.
All Implemented Interfaces:
Lookback<K>

public class LastKey<K extends Comparable<K>> extends Object implements Lookback<K>
A Lookback that only tracks the last key seen.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(K key)
    Adds a key to the lookback tracking.
    boolean
    contains(K key)
    Determines if the key is in the lookback.
    get()
    Gets the key to query for.
    int
    Gets the number of keys this Lookback can store.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.aiven.commons.kafka.connector.source.lookback.Lookback

    resize
  • Constructor Details

    • LastKey

      public LastKey()
      Constructor.
  • Method Details

    • add

      public void add(K key)
      Description copied from interface: Lookback
      Adds a key to the lookback tracking.
      Specified by:
      add in interface Lookback<K extends Comparable<K>>
      Parameters:
      key - the key to add.
    • get

      public K get()
      Description copied from interface: Lookback
      Gets the key to query for.
      Specified by:
      get in interface Lookback<K extends Comparable<K>>
      Returns:
      the key to query for.
    • size

      public int size()
      Description copied from interface: Lookback
      Gets the number of keys this Lookback can store.
      Specified by:
      size in interface Lookback<K extends Comparable<K>>
      Returns:
      the number of keys this Lookback can store.
    • contains

      public boolean contains(K key)
      Description copied from interface: Lookback
      Determines if the key is in the lookback.
      Specified by:
      contains in interface Lookback<K extends Comparable<K>>
      Parameters:
      key - the key to search for.
      Returns:
      true if this lookback holds the key.