@@ -54,6 +54,9 @@ using namespace arangodb::application_features;
5454using namespace arangodb ::options;
5555
5656namespace {
57+ std::unordered_set<std::string> const compressionTypes = {
58+ {" snappy" }, {" lz4" }, {" lz4hc" }, {" none" }};
59+
5760rocksdb::TransactionDBOptions rocksDBTrxDefaults;
5861rocksdb::Options rocksDBDefaults;
5962rocksdb::BlockBasedTableOptions rocksDBTableOptionsDefaults;
@@ -133,6 +136,7 @@ RocksDBOptionFeature::RocksDBOptionFeature(Server& server)
133136 _transactionLockStripes (
134137 std::max (NumberOfCores::getValue(), std::size_t(16 ))),
135138 _transactionLockTimeout(rocksDBTrxDefaults.transaction_lock_timeout),
139+ _compressionType(" snappy" ),
136140 _totalWriteBufferSize(rocksDBDefaults.db_write_buffer_size),
137141 _writeBufferSize(rocksDBDefaults.write_buffer_size),
138142 _maxWriteBufferNumber(8 + 2 ), // number of column families plus 2
@@ -221,6 +225,13 @@ void RocksDBOptionFeature::collectOptions(
221225 " regular data directory" ,
222226 new StringParameter (&_walDirectory));
223227
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+
224235 options
225236 ->addOption (" --rocksdb.target-file-size-base" ,
226237 " per-file target file size for compaction (in bytes). the "
@@ -698,6 +709,7 @@ void RocksDBOptionFeature::start() {
698709 LOG_TOPIC (" f66e4" , TRACE, Logger::ROCKSDB)
699710 << " using RocksDB options:"
700711 << " wal_dir: '" << _walDirectory << " '"
712+ << " , compression type: " << _compressionType
701713 << " , write_buffer_size: " << _writeBufferSize
702714 << " , total_write_buffer_size: " << _totalWriteBufferSize
703715 << " , max_write_buffer_number: " << _maxWriteBufferNumber
0 commit comments