我正在使用 0.11.0.2 版的 Kafka Streams。
为了利用API,我使用builder 方法transform
创建了自己的 API 。问题是我对某些字段/方法的 javadoc 不够清楚。StateStoreSupplier
Stores.create
val storeSupplier = Stores.create(STORE_NAME)
.withStringKeys()
.withStringValues()
.persistent()
.disableLogging()
.windowed(WINDOW_SIZE, RETENTION, 3, false)
.enableCaching()
.build()
提到的变更日志将如何表示?
/**
* Indicates that a changelog should not be created for the key-value store
*/
PersistentKeyValueFactory<K, V> disableLogging();
这 4 个值如何相互影响?每个窗口都有最大数量的元素 - windowSize
?一旦到达新窗口就开始了?每个窗口都可以划分numSegments
为 RocksDB 磁盘上的文件吗?重复意味着键和值都相同,并且仅在同一窗口中检测到?
/**
* Set the persistent store as a windowed key-value store
* @param windowSize size of the windows
* @param retentionPeriod the maximum period of time in milli-second to keep each window in this store
* @param numSegments the maximum number of segments for rolling the windowed store
* @param retainDuplicates whether or not to retain duplicate data within the window
*/
PersistentKeyValueFactory<K, V> windowed(final long windowSize, long retentionPeriod, int numSegments, boolean retainDuplicates);
这里暗示了什么样的缓存?
/**
* Caching should be enabled on the created store.
*/
PersistentKeyValueFactory<K, V> enableCaching();