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,18 +217,23 @@ public class LLLocalKeyValueDatabase implements LLKeyValueDatabase {
if (isDisableAutoCompactions()) {
columnFamilyOptions.setDisableAutoCompactions(true);
}
columnFamilyOptions.setEnableBlobFiles(columnOptions.blobFiles());
if (columnOptions.blobFileSize().isPresent()) {
columnFamilyOptions.setBlobFileSize(columnOptions.blobFileSize().get());
var blobFiles = columnOptions.blobFiles();
columnFamilyOptions.setEnableBlobFiles(blobFiles);
if (blobFiles) {
if (columnOptions.blobFileSize().isPresent()) {
columnFamilyOptions.setBlobFileSize(columnOptions.blobFileSize().get());
}
if (columnOptions.minBlobSize().isPresent()) {
columnFamilyOptions.setMinBlobSize(columnOptions.minBlobSize().get());
}
if (columnOptions.blobCompressionType().isPresent()) {
columnFamilyOptions.setCompressionType(columnOptions.blobCompressionType().get().getType());
} else {
columnFamilyOptions.setCompressionType(CompressionType.LZ4_COMPRESSION);
}
columnFamilyOptions.setBlobCompactionReadaheadSize(4 * SizeUnit.MB);
columnFamilyOptions.setEnableBlobGarbageCollection(true);
}
if (columnOptions.minBlobSize().isPresent()) {
columnFamilyOptions.setMinBlobSize(columnOptions.minBlobSize().get());
}
if (columnOptions.blobCompressionType().isPresent()) {
columnFamilyOptions.setCompressionType(columnOptions.blobCompressionType().get().getType());
}
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