]>
Commit | Line | Data |
---|---|---|
7c673cae | 1 | // Copyright (c) 2011-present, Facebook, Inc. All rights reserved. |
11fdf7f2 TL |
2 | // This source code is licensed under both the GPLv2 (found in the |
3 | // COPYING file in the root directory) and Apache 2.0 License | |
4 | // (found in the LICENSE.Apache file in the root directory). | |
7c673cae FG |
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 | } |