This is an automated email from the ASF dual-hosted git repository.

sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new b80b72e  Allow to disable LZ4 compression in KeyValueStorageRocksDB
b80b72e is described below

commit b80b72e046adce3e4e74ebbeda595dc4b4e920c2
Author: Matteo Merli <[email protected]>
AuthorDate: Tue Feb 20 02:18:27 2018 -0800

    Allow to disable LZ4 compression in KeyValueStorageRocksDB
    
    In some environments (eg: windows), LZ4 is not statically linked with the 
RocksDB JNI library bundled in the jar. In this cases we need to allow to 
disable LZ4 compression on the SST tables.
    
    Author: Matteo Merli <[email protected]>
    
    Reviewers: Enrico Olivelli <[email protected]>, Sijie Guo 
<[email protected]>
    
    This closes #1181 from merlimat/allow-disabling-lz4-in-rocksdb
---
 .../apache/bookkeeper/bookie/storage/ldb/KeyValueStorageRocksDB.java | 5 +++++
 1 file changed, 5 insertions(+)

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 ed40531..1ecc4ba 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 @@ public class KeyValueStorageRocksDB implements 
KeyValueStorage {
     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 class KeyValueStorageRocksDB implements 
KeyValueStorage {
                 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);

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to