From dffb8eb3eb4e08fa62e33ca92c8331cf32e2947e Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Mon, 27 Dec 2021 17:49:22 +0100 Subject: [PATCH] Set default compression types --- .../dbengine/database/disk/LLLocalKeyValueDatabase.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/it/cavallium/dbengine/database/disk/LLLocalKeyValueDatabase.java b/src/main/java/it/cavallium/dbengine/database/disk/LLLocalKeyValueDatabase.java index a7661d4..5ac5842 100644 --- a/src/main/java/it/cavallium/dbengine/database/disk/LLLocalKeyValueDatabase.java +++ b/src/main/java/it/cavallium/dbengine/database/disk/LLLocalKeyValueDatabase.java @@ -44,6 +44,7 @@ import org.rocksdb.ColumnFamilyHandle; import org.rocksdb.CompactRangeOptions; import org.rocksdb.CompactionPriority; import org.rocksdb.CompactionStyle; +import org.rocksdb.CompressionOptions; import org.rocksdb.CompressionType; import org.rocksdb.DBOptions; import org.rocksdb.DbPath; @@ -303,6 +304,9 @@ public class LLLocalKeyValueDatabase implements LLKeyValueDatabase { options.setTargetFileSizeMultiplier(2); // Each level is 2 times the previous level if (!databaseOptions.volumes().isEmpty()) { options.setCompressionPerLevel(databaseOptions.volumes().stream().map(v -> v.compression().getType()).toList()); + } else { + options.setCompressionType(CompressionType.LZ4_COMPRESSION); + options.setBottommostCompressionType(CompressionType.LZ4HC_COMPRESSION); } options.setManualWalFlush(false); options.setMinWriteBufferNumberToMerge(3);