@@ -54,6 +54,9 @@ using namespace arangodb::application_features;
54
54
using namespace arangodb ::options;
55
55
56
56
namespace {
57
+ std::unordered_set<std::string> const compressionTypes = {
58
+ {" snappy" }, {" lz4" }, {" lz4hc" }, {" none" }};
59
+
57
60
rocksdb::TransactionDBOptions rocksDBTrxDefaults;
58
61
rocksdb::Options rocksDBDefaults;
59
62
rocksdb::BlockBasedTableOptions rocksDBTableOptionsDefaults;
@@ -133,6 +136,7 @@ RocksDBOptionFeature::RocksDBOptionFeature(Server& server)
133
136
_transactionLockStripes (
134
137
std::max (NumberOfCores::getValue(), std::size_t(16 ))),
135
138
_transactionLockTimeout(rocksDBTrxDefaults.transaction_lock_timeout),
139
+ _compressionType(" snappy" ),
136
140
_totalWriteBufferSize(rocksDBDefaults.db_write_buffer_size),
137
141
_writeBufferSize(rocksDBDefaults.write_buffer_size),
138
142
_maxWriteBufferNumber(8 + 2 ), // number of column families plus 2
@@ -221,6 +225,13 @@ void RocksDBOptionFeature::collectOptions(
221
225
" regular data directory" ,
222
226
new StringParameter (&_walDirectory));
223
227
228
+ options
229
+ ->addOption (" --rocksdb.compression-type" ,
230
+ " compression algorithm to use within RocksDB" ,
231
+ new DiscreteValuesParameter<StringParameter>(
232
+ &_compressionType, ::compressionTypes))
233
+ .setIntroducedIn (31000 );
234
+
224
235
options
225
236
->addOption (" --rocksdb.target-file-size-base" ,
226
237
" per-file target file size for compaction (in bytes). the "
@@ -698,6 +709,7 @@ void RocksDBOptionFeature::start() {
698
709
LOG_TOPIC (" f66e4" , TRACE, Logger::ROCKSDB)
699
710
<< " using RocksDB options:"
700
711
<< " wal_dir: '" << _walDirectory << " '"
712
+ << " , compression type: " << _compressionType
701
713
<< " , write_buffer_size: " << _writeBufferSize
702
714
<< " , total_write_buffer_size: " << _totalWriteBufferSize
703
715
<< " , max_write_buffer_number: " << _maxWriteBufferNumber
0 commit comments