Interface StoreUpdateHandler<K,V>

All Superinterfaces:
AutoCloseable, Closeable, org.apache.kafka.common.Configurable
All Known Subinterfaces:
SchemaUpdateHandler
All Known Implementing Classes:
CompositeSchemaUpdateHandler, KafkaStoreMessageHandler

public interface StoreUpdateHandler<K,V> extends org.apache.kafka.common.Configurable, Closeable
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    cacheInitialized(Map<org.apache.kafka.common.TopicPartition,Long> checkpoints)
    Invoked after the cache is initialized.
    default Map<org.apache.kafka.common.TopicPartition,Long>
    checkpoint(int count)
    Retrieve the offsets to checkpoint.
    default void
     
    default void
     
    default void
    endBatch(int count)
    Invoked after a batch of updates.
    void
    handleUpdate(K key, V value, V oldValue, org.apache.kafka.common.TopicPartition tp, long offset, long timestamp)
    Invoked on every new K,V pair written to the store
    default void
    init(Map<org.apache.kafka.common.TopicPartition,Long> checkpoints)
    Invoked before the cache is initialized.
    default void
    startBatch(int count)
    Invoked before a batch of updates.
    validateUpdate(K key, V value, org.apache.kafka.common.TopicPartition tp, long offset, long timestamp)
    Invoked before every new K,V pair written to the store
  • Field Details

  • Method Details

    • configure

      default void configure(Map<String,?> map)
      Specified by:
      configure in interface org.apache.kafka.common.Configurable
    • init

      default void init(Map<org.apache.kafka.common.TopicPartition,Long> checkpoints) throws StoreInitializationException
      Invoked before the cache is initialized.
      Throws:
      StoreInitializationException
    • cacheInitialized

      default void cacheInitialized(Map<org.apache.kafka.common.TopicPartition,Long> checkpoints)
      Invoked after the cache is initialized.
    • startBatch

      default void startBatch(int count)
      Invoked before a batch of updates.
      Parameters:
      count - batch count
    • validateUpdate

      default StoreUpdateHandler.ValidationStatus validateUpdate(K key, V value, org.apache.kafka.common.TopicPartition tp, long offset, long timestamp)
      Invoked before every new K,V pair written to the store
      Parameters:
      key - Key associated with the data
      value - Data written to the store
      tp - Topic-partition
      offset - Offset of record
      timestamp - Timestamp of record
    • handleUpdate

      void handleUpdate(K key, V value, V oldValue, org.apache.kafka.common.TopicPartition tp, long offset, long timestamp)
      Invoked on every new K,V pair written to the store
      Parameters:
      key - Key associated with the data
      value - Data written to the store
      oldValue - the previous value associated with key, or null if there was no mapping for key
      tp - Topic-partition
      offset - Offset of record
      timestamp - Timestamp of record
    • checkpoint

      default Map<org.apache.kafka.common.TopicPartition,Long> checkpoint(int count)
      Retrieve the offsets to checkpoint.
      Parameters:
      count - batch count
      Returns:
      the offsets to checkpoint, or null
    • endBatch

      default void endBatch(int count)
      Invoked after a batch of updates.
      Parameters:
      count - batch count
    • close

      default void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException