]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/java/src/test/java/org/rocksdb/FilterTest.java
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / rocksdb / java / src / test / java / org / rocksdb / FilterTest.java
1 // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
2 // This source code is licensed under the BSD-style license found in the
3 // LICENSE file in the root directory of this source tree. An additional grant
4 // of patent rights can be found in the PATENTS file in the same directory.
5
6 package org.rocksdb;
7
8 import org.junit.ClassRule;
9 import org.junit.Test;
10
11 public class FilterTest {
12
13 @ClassRule
14 public static final RocksMemoryResource rocksMemoryResource =
15 new RocksMemoryResource();
16
17 @Test
18 public void filter() {
19 // new Bloom filter
20 final BlockBasedTableConfig blockConfig = new BlockBasedTableConfig();
21 try(final Options options = new Options()) {
22
23 try(final Filter bloomFilter = new BloomFilter()) {
24 blockConfig.setFilter(bloomFilter);
25 options.setTableFormatConfig(blockConfig);
26 }
27
28 try(final Filter bloomFilter = new BloomFilter(10)) {
29 blockConfig.setFilter(bloomFilter);
30 options.setTableFormatConfig(blockConfig);
31 }
32
33 try(final Filter bloomFilter = new BloomFilter(10, false)) {
34 blockConfig.setFilter(bloomFilter);
35 options.setTableFormatConfig(blockConfig);
36 }
37 }
38 }
39 }