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 2f6ac2f..0c2a0f2 100644 --- a/src/main/java/it/cavallium/dbengine/database/disk/LLLocalKeyValueDatabase.java +++ b/src/main/java/it/cavallium/dbengine/database/disk/LLLocalKeyValueDatabase.java @@ -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