Stores Utility — Factory of State Stores

import org.apache.kafka.streams.state.Stores
val kvStore = Stores.inMemoryKeyValueStore("store-name")
scala> :type kvStore
org.apache.kafka.streams.state.KeyValueBytesStoreSupplier
Table 1. Stores API (Static Methods)
Method Description

inMemoryKeyValueStore

KeyValueBytesStoreSupplier inMemoryKeyValueStore(
  String name)

inMemorySessionStore

SessionBytesStoreSupplier inMemorySessionStore(
  String name,
  Duration retentionPeriod)

inMemoryWindowStore

WindowBytesStoreSupplier inMemoryWindowStore(
  String name,
  Duration retentionPeriod,
  Duration windowSize,
  boolean retainDuplicates)

Creates a WindowBytesStoreSupplier of WindowStores (i.e. InMemoryWindowBytesStoreSupplier)

keyValueStoreBuilder

StoreBuilder<KeyValueStore<K, V>> keyValueStoreBuilder(
  KeyValueBytesStoreSupplier supplier,
  Serde<K> keySerde,
  Serde<V> valueSerde)

lruMap

KeyValueBytesStoreSupplier lruMap(
  String name,
  int maxCacheSize)

Creates a KeyValueBytesStoreSupplier of KeyValueStores (i.e. MemoryNavigableLRUCache)

persistentKeyValueStore

KeyValueBytesStoreSupplier persistentKeyValueStore(
  String name)

Creates a KeyValueBytesStoreSupplier of KeyValueStores (i.e. RocksDbKeyValueBytesStoreSupplier)

persistentSessionStore

SessionBytesStoreSupplier persistentSessionStore(
  String name,
  Duration retentionPeriod)

persistentTimestampedKeyValueStore

KeyValueBytesStoreSupplier persistentTimestampedKeyValueStore(
  String name)

Creates a KeyValueBytesStoreSupplier of KeyValueStores (i.e. RocksDbKeyValueBytesStoreSupplier)

persistentTimestampedWindowStore

WindowBytesStoreSupplier persistentTimestampedWindowStore(
  String name,
  Duration retentionPeriod,
  Duration windowSize,
  boolean retainDuplicates)

persistentWindowStore

WindowBytesStoreSupplier persistentWindowStore(
  String name,
  Duration retentionPeriod,
  Duration windowSize,
  boolean retainDuplicates)
WindowBytesStoreSupplier persistentWindowStore(
  String name,
  Duration retentionPeriod,
  Duration windowSize,
  boolean retainDuplicates,
  boolean timestampedStore)
WindowBytesStoreSupplier persistentWindowStore(
  String name,
  long retentionPeriod,
  long windowSize,
  boolean retainDuplicates,
  long segmentInterval,
  boolean timestampedStore)

sessionStoreBuilder

StoreBuilder<SessionStore<K, V>> sessionStoreBuilder(
  SessionBytesStoreSupplier supplier,
  Serde<K> keySerde,
  Serde<V> valueSerde)

timestampedKeyValueStoreBuilder

StoreBuilder<TimestampedKeyValueStore<K, V>> timestampedKeyValueStoreBuilder(
  KeyValueBytesStoreSupplier supplier,
  Serde<K> keySerde,
  Serde<V> valueSerde)

timestampedWindowStoreBuilder

StoreBuilder<TimestampedWindowStore<K, V>> timestampedWindowStoreBuilder(
  WindowBytesStoreSupplier supplier,
  Serde<K> keySerde,
  Serde<V> valueSerde)

windowStoreBuilder

StoreBuilder<WindowStore<K, V>> windowStoreBuilder(
  WindowBytesStoreSupplier supplier,
  Serde<K> keySerde,
  Serde<V> valueSerde)

results matching ""

    No results matching ""