sijie closed pull request #1181: Allow to disable LZ4 compression in 
KeyValueStorageRocksDB
URL: https://github.com/apache/bookkeeper/pull/1181
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/KeyValueStorageRocksDB.java
 
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/KeyValueStorageRocksDB.java
index ed4053114..1ecc4ba68 100644
--- 
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/KeyValueStorageRocksDB.java
+++ 
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/KeyValueStorageRocksDB.java
@@ -65,6 +65,7 @@
     private final WriteBatch emptyBatch;
 
     private static final String ROCKSDB_LOG_LEVEL = 
"dbStorage_rocksDB_logLevel";
+    private static final String ROCKSDB_LZ4_COMPRESSION_ENABLED = 
"dbStorage_rocksDB_lz4CompressionEnabled";
     private static final String ROCKSDB_WRITE_BUFFER_SIZE_MB = 
"dbStorage_rocksDB_writeBufferSizeMB";
     private static final String ROCKSDB_SST_SIZE_MB = 
"dbStorage_rocksDB_sstSizeInMB";
     private static final String ROCKSDB_BLOCK_SIZE = 
"dbStorage_rocksDB_blockSize";
@@ -104,7 +105,11 @@ public KeyValueStorageRocksDB(String path, DbConfigType 
dbConfigType, ServerConf
                 int blockSize = conf.getInt(ROCKSDB_BLOCK_SIZE, 64 * 1024);
                 long blockCacheSize = conf.getLong(ROCKSDB_BLOCK_CACHE_SIZE, 
256 * 1024 * 1024);
                 int bloomFilterBitsPerKey = 
conf.getInt(ROCKSDB_BLOOM_FILTERS_BITS_PER_KEY, 10);
+                boolean lz4CompressionEnabled = 
conf.getBoolean(ROCKSDB_LZ4_COMPRESSION_ENABLED, true);
 
+                if (lz4CompressionEnabled) {
+                    
options.setCompressionType(CompressionType.LZ4_COMPRESSION);
+                }
                 options.setCompressionType(CompressionType.LZ4_COMPRESSION);
                 options.setWriteBufferSize(writeBufferSizeMB * 1024 * 1024);
                 options.setMaxWriteBufferNumber(4);


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to