ThreadCache¶
Creating Instance¶
ThreadCache takes the following to be created:
-
LogContext - Maximum Cache Size
- StreamsMetricsImpl
ThreadCache is created when:
GlobalStreamThreadis createdStandbyTaskCreatoris createdStreamThreadutility 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:
ThreadCacheis requested to addDirtyEntryFlushListener, put, putIfAbsent, maybeEvict
put¶
void put(
String namespace,
Bytes key,
LRUCacheEntry value)
put...FIXME
put is used when:
CachingKeyValueStoreis requested toputInternalandgetInternalCachingSessionStoreis requested toputCachingWindowStoreis requested toput
flush¶
void flush(
String namespace)
flush...FIXME
flush is used when:
CachingKeyValueStoreis requested toflush,flushCache,closeCachingSessionStoreis requested toflush,flushCache,closeCachingWindowStoreis requested toflush,flushCache,close
sizeBytes¶
long sizeBytes()
sizeBytes is the sum of all the sizes of the NamedCaches.
sizeBytes is used when:
ThreadCacheis requested to resize and maybeEvict