]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/table/bloom_block.h
import 14.2.4 nautilus point release
[ceph.git] / ceph / src / rocksdb / table / bloom_block.h
1 // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
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).
5 #pragma once
6
7 #include <vector>
8 #include <string>
9 #include "util/dynamic_bloom.h"
10
11 namespace rocksdb {
12 class Logger;
13
14 class BloomBlockBuilder {
15 public:
16 static const std::string kBloomBlock;
17
18 explicit BloomBlockBuilder(uint32_t num_probes = 6) : bloom_(num_probes) {}
19
20 void SetTotalBits(Allocator* allocator, uint32_t total_bits,
21 uint32_t locality, size_t huge_page_tlb_size,
22 Logger* logger) {
23 bloom_.SetTotalBits(allocator, total_bits, locality, huge_page_tlb_size,
24 logger);
25 }
26
27 uint32_t GetNumBlocks() const { return bloom_.GetNumBlocks(); }
28
29 void AddKeysHashes(const std::vector<uint32_t>& keys_hashes);
30
31 Slice Finish();
32
33 private:
34 DynamicBloom bloom_;
35 };
36
37 }; // namespace rocksdb