import org.apache.kafka.streams.state.Stores
val windowStore = Stores.persistentWindowStore("window-store-name", 1000, 2, 1000, true)
scala> :type windowStore
org.apache.kafka.streams.state.WindowBytesStoreSupplier
import org.apache.kafka.streams.state.internals.RocksDbWindowBytesStoreSupplier
assert(windowStore.isInstanceOf[RocksDbWindowBytesStoreSupplier])
RocksDbWindowBytesStoreSupplier
RocksDbWindowBytesStoreSupplier
is a concrete WindowBytesStoreSupplier that supplies RocksDBWindowStores over RocksDBSegmentedBytesStores.
In fact, RocksDbWindowBytesStoreSupplier
is the one and only known WindowBytesStoreSupplier.
RocksDbWindowBytesStoreSupplier
uses rocksdb-window-state as the metrics scope.
RocksDbWindowBytesStoreSupplier
is created when Stores
factory is requested to persistentWindowStore.
Creating State Store — get
Method
WindowStore<Bytes, byte[]> get()
Note
|
get is part of the StoreSupplier Contract to get a state store.
|
get
creates a RocksDBSegmentedBytesStore (with the name, the retentionPeriod and the segments).
get
then returns a new RocksDBWindowStore (with the RocksDBSegmentedBytesStore
and the retainDuplicates and the windowSize).