Add NoFilter

This commit is contained in:
Andrea Cavalli 2022-08-16 19:50:53 +02:00
parent ddd71d3b72
commit 1c02a601bc
2 changed files with 6 additions and 0 deletions

View File

@ -99,6 +99,7 @@ versions:
StandardFSDirectoryOptions StandardFSDirectoryOptions
] ]
Filter: [ Filter: [
NoFilter,
BloomFilter BloomFilter
] ]
ColumnOptions: [ ColumnOptions: [
@ -295,6 +296,8 @@ versions:
minBlobSize: -long minBlobSize: -long
blobFileSize: -long blobFileSize: -long
blobCompressionType: -Compression blobCompressionType: -Compression
NoFilter:
data: {}
BloomFilter: BloomFilter:
data: data:
bitsPerKey: int bitsPerKey: int

View File

@ -30,6 +30,7 @@ import it.cavallium.dbengine.rpc.current.data.DatabaseLevel;
import it.cavallium.dbengine.rpc.current.data.DatabaseOptions; import it.cavallium.dbengine.rpc.current.data.DatabaseOptions;
import it.cavallium.dbengine.rpc.current.data.DatabaseVolume; import it.cavallium.dbengine.rpc.current.data.DatabaseVolume;
import it.cavallium.dbengine.rpc.current.data.NamedColumnOptions; import it.cavallium.dbengine.rpc.current.data.NamedColumnOptions;
import it.cavallium.dbengine.rpc.current.data.NoFilter;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodHandles;
@ -335,6 +336,8 @@ public class LLLocalKeyValueDatabase extends Backuppable implements LLKeyValueDa
final BloomFilter bloomFilter = new BloomFilter(bloomFilterOptions.bitsPerKey()); final BloomFilter bloomFilter = new BloomFilter(bloomFilterOptions.bitsPerKey());
refs.track(bloomFilter); refs.track(bloomFilter);
tableOptions.setFilterPolicy(bloomFilter); tableOptions.setFilterPolicy(bloomFilter);
} else if (filterOptions instanceof NoFilter) {
tableOptions.setFilterPolicy(null);
} }
} }
boolean cacheIndexAndFilterBlocks = columnOptions.cacheIndexAndFilterBlocks() boolean cacheIndexAndFilterBlocks = columnOptions.cacheIndexAndFilterBlocks()