ThreadCache¶
Creating Instance¶
ThreadCache
takes the following to be created:
-
LogContext
- Maximum Cache Size
- StreamsMetricsImpl
ThreadCache
is created when:
GlobalStreamThread
is createdStandbyTaskCreator
is createdStreamThread
utility is used to create a StreamThread (and creates a ActiveTaskCreator)
Maximum Cache Size¶
ThreadCache
is given the maximum cache size (in bytes) when created.
The cache size is determined using cache.max.bytes.buffering configuration property when KafkaStreams
is created and requested to addStreamThread.
getOrCreateCache¶
NamedCache getOrCreateCache(
String name)
getOrCreateCache
...FIXME
getOrCreateCache
is used when:
ThreadCache
is requested to addDirtyEntryFlushListener, put, putIfAbsent, maybeEvict
put¶
void put(
String namespace,
Bytes key,
LRUCacheEntry value)
put
...FIXME
put
is used when:
CachingKeyValueStore
is requested toputInternal
andgetInternal
CachingSessionStore
is requested toput
CachingWindowStore
is requested toput
flush¶
void flush(
String namespace)
flush
...FIXME
flush
is used when:
CachingKeyValueStore
is requested toflush
,flushCache
,close
CachingSessionStore
is requested toflush
,flushCache
,close
CachingWindowStore
is requested toflush
,flushCache
,close
sizeBytes¶
long sizeBytes()
sizeBytes
is the sum of all the sizes of the NamedCaches.
sizeBytes
is used when:
ThreadCache
is requested to resize and maybeEvict