From 33b8e6711b4117bb514b97864ba3c6b9def81b9b Mon Sep 17 00:00:00 2001 From: Axlgrep Date: Mon, 11 Nov 2019 11:50:43 +0800 Subject: [PATCH] support lz4 and zstd compression type (#798) --- conf/pika.conf | 2 +- src/pika_server.cc | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/conf/pika.conf b/conf/pika.conf index 909b98f01f..826270c72e 100644 --- a/conf/pika.conf +++ b/conf/pika.conf @@ -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 diff --git a/src/pika_server.cc b/src/pika_server.cc index da6e20d9d5..20dd39a70a 100644 --- a/src/pika_server.cc +++ b/src/pika_server.cc @@ -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();