You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@quickstep.apache.org by na...@apache.org on 2016/07/12 01:04:05 UTC

incubator-quickstep git commit: Oops, initialize hash_fn_ in Bloom filter

Repository: incubator-quickstep
Updated Branches:
  refs/heads/expt_bloom_filter_hash_fn 5fff6b6a9 -> e7c279205


Oops, initialize hash_fn_ in Bloom filter


Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/e7c27920
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/e7c27920
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/e7c27920

Branch: refs/heads/expt_bloom_filter_hash_fn
Commit: e7c279205e4410e036b2c01d61928d5a4ff9860a
Parents: 5fff6b6
Author: Navneet Potti <na...@gmail.com>
Authored: Mon Jul 11 19:48:05 2016 -0500
Committer: Navneet Potti <na...@gmail.com>
Committed: Mon Jul 11 19:48:05 2016 -0500

----------------------------------------------------------------------
 utility/BloomFilter.hpp | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/e7c27920/utility/BloomFilter.hpp
----------------------------------------------------------------------
diff --git a/utility/BloomFilter.hpp b/utility/BloomFilter.hpp
index 332cb0f..ec6b2b7 100644
--- a/utility/BloomFilter.hpp
+++ b/utility/BloomFilter.hpp
@@ -304,14 +304,23 @@ class BloomFilter {
   }
 
  private:
-  std::vector<std::uint32_t> hash_fn_;
   const std::uint32_t hash_fn_count_;
   std::uint64_t array_size_in_bytes_;
   std::uint64_t array_size_;
   std::unique_ptr<std::uint8_t> bit_array_;
   std::uint32_t inserted_element_count_;
   const bool is_bit_array_owner_;
-
+  static constexpr std::size_t kMaxNumHashFns = 32;
+  const std::uint32_t hash_fn_[kMaxNumHashFns] = { // hash_fn_[i] is 2**(i+1) - 1
+      0x00000001, 0x00000003, 0x00000007, 0x0000000f,
+      0x0000001f, 0x0000003f, 0x0000007f, 0x000000ff,
+      0x000001ff, 0x000003ff, 0x000007ff, 0x00000fff,
+      0x00001fff, 0x00003fff, 0x00007fff, 0x0000ffff,
+      0x0001ffff, 0x0003ffff, 0x0007ffff, 0x000fffff,
+      0x001fffff, 0x003fffff, 0x007fffff, 0x00ffffff,
+      0x01ffffff, 0x03ffffff, 0x07ffffff, 0x0fffffff,
+      0x1fffffff, 0x3fffffff, 0x7fffffff, 0xffffffff
+    };
   alignas(kCacheLineBytes) mutable SpinSharedMutex<false> bloom_filter_insert_mutex_;
 
   DISALLOW_COPY_AND_ASSIGN(BloomFilter);