void init(
ProcessorContext context,
StateStore root)
ChangeLoggingKeyValueBytesStore
ChangeLoggingKeyValueBytesStore
is a concrete KeyValueStore of Bytes
keys and byte[]
values (i.e. KeyValueStore<Bytes, byte[]>
) that uses a StoreChangeLogger to log records.
ChangeLoggingKeyValueBytesStore
is also a concrete WrappedStateStore of KeyValueStore of Bytes
keys and byte[]
values (i.e. WrappedStateStore<KeyValueStore<Bytes, byte[]>, byte[], byte[]>
).
ChangeLoggingKeyValueBytesStore
is created exclusively when KeyValueStoreBuilder
is requested to build a KeyValueStore with logging enabled.
ChangeLoggingKeyValueBytesStore
takes a single KeyValueStore (inner state store) to be created.
Initializing State Store — init
Method
Note
|
init is part of the StateStore Contract to initialize the state store.
|
init
requests the inner KeyValueStore to initialize (with the given ProcessorContext and the root StateStore).
init
then creates a new StateSerdes
and StoreChangeLogger (for the name of the changelog topic per application ID and store name) that is saved as the changeLogger internal registry.
In the end, init
registers an eviction listener if the inner state store is a MemoryLRUCache for setWhenEldestRemoved
to log removed record (with the key evicted to be with null
value to indicate removal).
put
Method
void put(
Bytes key,
byte[] value)
Note
|
put is part of the StateStore Contract to…FIXME.
|
put
…FIXME
putIfAbsent
Method
byte[] putIfAbsent(
Bytes key,
byte[] value)
Note
|
putIfAbsent is part of the StateStore Contract to…FIXME.
|
putIfAbsent
…FIXME
putAll
Method
void putAll(List<KeyValue<Bytes, byte[]>> entries)
Note
|
putAll is part of the StateStore Contract to…FIXME.
|
putAll
…FIXME
delete
Method
byte[] delete(Bytes key)
Note
|
delete is part of the StateStore Contract to…FIXME.
|
delete
…FIXME
Logging Records — log
Method
void log(
Bytes key,
byte[] value)
log
simply requests the StoreChangeLogger to logChange with the key and the value.
Note
|
log is used when ChangeLoggingKeyValueBytesStore is requested to initialize, put, putIfAbsent, putAll, and delete.
|