diff --git a/0009-format-RocksDBConfigSetter.patch b/0009-format-RocksDBConfigSetter.patch new file mode 100644 index 0000000000000000000000000000000000000000..1ea90dd752f7e6427973465bcdd128c723a5bc74 --- /dev/null +++ b/0009-format-RocksDBConfigSetter.patch @@ -0,0 +1,67 @@ +diff --git a/docs/streams/developer-guide/config-streams.html b/docs/streams/developer-guide/config-streams.html +index aa817ed47e..738d3f72ec 100644 +--- a/docs/streams/developer-guide/config-streams.html ++++ b/docs/streams/developer-guide/config-streams.html +@@ -698,34 +698,35 @@ +
The RocksDB configuration. Kafka Streams uses RocksDB as the default storage engine for persistent stores. To change the default
+ configuration for RocksDB, you can implement RocksDBConfigSetter
and provide your custom class via rocksdb.config.setter.
Here is an example that adjusts the memory size consumed by RocksDB.
+- public static class CustomRocksDBConfig implements RocksDBConfigSetter {
+- // This object should be a member variable so it can be closed in RocksDBConfigSetter#close.
+- private org.rocksdb.Cache cache = new org.rocksdb.LRUCache(16 * 1024L * 1024L);
++
++
++public static class CustomRocksDBConfig implements RocksDBConfigSetter {
++ // This object should be a member variable so it can be closed in RocksDBConfigSetter#close.
++ private org.rocksdb.Cache cache = new org.rocksdb.LRUCache(16 * 1024L * 1024L);
+
+- @Override
+- public void setConfig(final String storeName, final Options options, final Map<String, Object> configs) {
+- // See #1 below.
+- BlockBasedTableConfig tableConfig = (BlockBasedTableConfig) options.tableFormatConfig();
+- tableConfig.setBlockCache(cache);
+- // See #2 below.
+- tableConfig.setBlockSize(16 * 1024L);
+- // See #3 below.
+- tableConfig.setCacheIndexAndFilterBlocks(true);
+- options.setTableFormatConfig(tableConfig);
+- // See #4 below.
+- options.setMaxWriteBufferNumber(2);
+- }
+-
+- @Override
+- public void close(final String storeName, final Options options) {
+- // See #5 below.
+- cache.close();
+- }
+- }
+-
+- Properties streamsSettings = new Properties();
+- streamsConfig.put(StreamsConfig.ROCKSDB_CONFIG_SETTER_CLASS_CONFIG, CustomRocksDBConfig.class);
+-
++ @Override
++ public void setConfig(final String storeName, final Options options, final Map<String, Object> configs) {
++ // See #1 below.
++ BlockBasedTableConfig tableConfig = (BlockBasedTableConfig) options.tableFormatConfig();
++ tableConfig.setBlockCache(cache);
++ // See #2 below.
++ tableConfig.setBlockSize(16 * 1024L);
++ // See #3 below.
++ tableConfig.setCacheIndexAndFilterBlocks(true);
++ options.setTableFormatConfig(tableConfig);
++ // See #4 below.
++ options.setMaxWriteBufferNumber(2);
++ }
++ @Override
++ public void close(final String storeName, final Options options) {
++ // See #5 below.
++ cache.close();
++ }
++}
++Properties streamsSettings = new Properties();
++streamsConfig.put(StreamsConfig.ROCKSDB_CONFIG_SETTER_CLASS_CONFIG, CustomRocksDBConfig.class);
++
++
+