RocksDBConfigSetter
在文档中描述:
https://docs.confluent.io/current/streams/developer-guide/config-streams.html#rocksdb-config-setter
public static class CustomRocksDBConfig implements RocksDBConfigSetter {
@Override
public void setConfig(final String storeName, final Options options, final Map<String, Object> configs) {
BlockBasedTableConfig tableConfig = new org.rocksdb.BlockBasedTableConfig();
tableConfig.setBlockCacheSize(16 * 1024 * 1024L);
tableConfig.setBlockSize(16 * 1024L);
tableConfig.setCacheIndexAndFilterBlocks(true);
options.setTableFormatConfig(tableConfig);
options.setMaxWriteBufferNumber(2);
}
}
另外,在storeBuilder上设置withCachingDisabled()与设置withCachingEnabled()之间有什么区别,但是将缓存最大字节缓冲配置设置为0吗?
注意,这将在下一版本中修复:
https://issues.apache.org/jira/browse/KAFKA-6998