void init(
ProcessorContext context,
StateStore root)
CachingKeyValueStore
CachingKeyValueStore is a concrete KeyValueStore of Bytes keys and byte[] values (i.e. KeyValueStore<Bytes, byte[]>).
CachingKeyValueStore is also a concrete WrappedStateStore of KeyValueStore of Bytes keys and byte[] values (i.e. WrappedStateStore<KeyValueStore<Bytes, byte[]>, byte[], byte[]>).
CachingKeyValueStore is a concrete CachedStateStore.
CachingKeyValueStore is created when:
-
KeyValueStoreBuilderis requested to build a KeyValueStore with caching enabled -
TimestampedKeyValueStoreBuilderis requested to build a TimestampedKeyValueStore with caching enabled
CachingKeyValueStore takes a single KeyValueStore (underlying state store) to be created.
Initializing State Store — init Method
|
Note
|
init is part of the StateStore Contract to initialize the state store.
|
init initInternal with the ProcessorContext.
init then requests the underlying KeyValueStore to initialize.
In the end, init saves the current thread as the streamThread internal registry.
initInternal Internal Method
void initInternal(ProcessorContext context)
initInternal saves the ProcessorContext as the context internal registry.
initInternal requests the InternalProcessorContext for a ThreadCache that is saved as the cache internal registry.
initInternal creates the name of the cache for the task ID and the store name and that is saved as the cacheName internal registry.
In the end, initInternal requests the ThreadCache to addDirtyEntryFlushListener with the cache name and a DirtyEntryFlushListener that simply putAndMaybeForward the DirtyEntries.
|
Note
|
initInternal is used exclusively when CachingKeyValueStore is requested to initialize.
|
putAndMaybeForward Internal Method
void putAndMaybeForward(
ThreadCache.DirtyEntry entry,
InternalProcessorContext context)
putAndMaybeForward…FIXME
|
Note
|
putAndMaybeForward is used exclusively when CachingKeyValueStore is requested to initialize (via initInternal).
|
remove Method
void remove(final Windowed<Bytes> sessionKey)
|
Note
|
remove is part of SessionStore Contract to…FIXME.
|
remove…FIXME