Use LZ4 compression as fallback

This commit is contained in:
Andrea Cavalli 2022-06-09 00:13:44 +02:00
parent 563defb2ff
commit 8c2f3b89b6

View File

@ -217,7 +217,9 @@ public class LLLocalKeyValueDatabase implements LLKeyValueDatabase {
if (isDisableAutoCompactions()) {
columnFamilyOptions.setDisableAutoCompactions(true);
}
columnFamilyOptions.setEnableBlobFiles(columnOptions.blobFiles());
var blobFiles = columnOptions.blobFiles();
columnFamilyOptions.setEnableBlobFiles(blobFiles);
if (blobFiles) {
if (columnOptions.blobFileSize().isPresent()) {
columnFamilyOptions.setBlobFileSize(columnOptions.blobFileSize().get());
}
@ -226,9 +228,12 @@ public class LLLocalKeyValueDatabase implements LLKeyValueDatabase {
}
if (columnOptions.blobCompressionType().isPresent()) {
columnFamilyOptions.setCompressionType(columnOptions.blobCompressionType().get().getType());
} else {
columnFamilyOptions.setCompressionType(CompressionType.LZ4_COMPRESSION);
}
columnFamilyOptions.setBlobCompactionReadaheadSize(4 * SizeUnit.MB);
columnFamilyOptions.setEnableBlobGarbageCollection(true);
}
// This option is not supported with multiple db paths
// https://www.arangodb.com/docs/stable/programs-arangod-rocksdb.html