Set default compression types
This commit is contained in:
parent
9309692062
commit
dffb8eb3eb
@ -44,6 +44,7 @@ import org.rocksdb.ColumnFamilyHandle;
|
|||||||
import org.rocksdb.CompactRangeOptions;
|
import org.rocksdb.CompactRangeOptions;
|
||||||
import org.rocksdb.CompactionPriority;
|
import org.rocksdb.CompactionPriority;
|
||||||
import org.rocksdb.CompactionStyle;
|
import org.rocksdb.CompactionStyle;
|
||||||
|
import org.rocksdb.CompressionOptions;
|
||||||
import org.rocksdb.CompressionType;
|
import org.rocksdb.CompressionType;
|
||||||
import org.rocksdb.DBOptions;
|
import org.rocksdb.DBOptions;
|
||||||
import org.rocksdb.DbPath;
|
import org.rocksdb.DbPath;
|
||||||
@ -303,6 +304,9 @@ public class LLLocalKeyValueDatabase implements LLKeyValueDatabase {
|
|||||||
options.setTargetFileSizeMultiplier(2); // Each level is 2 times the previous level
|
options.setTargetFileSizeMultiplier(2); // Each level is 2 times the previous level
|
||||||
if (!databaseOptions.volumes().isEmpty()) {
|
if (!databaseOptions.volumes().isEmpty()) {
|
||||||
options.setCompressionPerLevel(databaseOptions.volumes().stream().map(v -> v.compression().getType()).toList());
|
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.setManualWalFlush(false);
|
||||||
options.setMinWriteBufferNumberToMerge(3);
|
options.setMinWriteBufferNumberToMerge(3);
|
||||||
|
Loading…
Reference in New Issue
Block a user