Skip to content

Commit

Permalink
support lz4 and zstd compression type (#798)
Browse files Browse the repository at this point in the history
  • Loading branch information
Axlgrep authored and whoiami committed Nov 11, 2019
1 parent 5dfb534 commit 33b8e67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion conf/pika.conf
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ max-cache-statistic-keys : 0
# When 'delete' or 'overwrite' a specific multi-data structure key 'small-compaction-threshold' times,
# a small compact is triggered automatically, default is 5000, limited in [1, 100000]
small-compaction-threshold : 5000
# Compression
# Compression type supported [snappy, zlib, lz4, zstd]
compression : snappy
# max-background-flushes: default is 1, limited in [1, 4]
max-background-flushes : 1
Expand Down
4 changes: 4 additions & 0 deletions src/pika_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ void PikaServer::RocksdbOptionInit(blackwidow::BlackwidowOptions* bw_option) {
bw_option->options.compression = rocksdb::CompressionType::kSnappyCompression;
} else if (g_pika_conf->compression() == "zlib") {
bw_option->options.compression = rocksdb::CompressionType::kZlibCompression;
} else if (g_pika_conf->compression() == "lz4") {
bw_option->options.compression = rocksdb::CompressionType::kLZ4Compression;
} else if (g_pika_conf->compression() == "zstd") {
bw_option->options.compression = rocksdb::CompressionType::kZSTD;
}

bw_option->table_options.block_size = g_pika_conf->block_size();
Expand Down

0 comments on commit 33b8e67

Please sign in to comment.