FilterPolicy consolidation, part 1/2 (#5963)

Summary:
The parts that are used to implement FilterPolicy /
NewBloomFilterPolicy and not used other than for the block-based table
should be consolidated under table/block_based/filter_policy*. I don't
foresee sharing these APIs with e.g. the Plain Table because they don't
expose hashes for reuse in indexing.

This change is step 1 of 2:
(a) mv table/full_filter_bits_builder.h to
table/block_based/filter_policy_internal.h which I expect to expand
soon to internally reveal more implementation details for testing.
(b) consolidate eventual contents of table/block_based/filter_policy.cc
in util/bloom.cc, which has the most elaborate revision history
(see step 2 ...)

Step 2 soon to follow:
mv util/bloom.cc table/block_based/filter_policy.cc
This gets its own PR so that git has the best chance of following the
rename for blame purposes. Note that low-level shared implementation
details of Bloom filters are in util/bloom_impl.h.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/5963

Test Plan: make check

Differential Revision: D18121199

Pulled By: pdillinger

fbshipit-source-id: 8f21732c3d8909777e3240e4ac3123d73140326a
main
Peter Dillinger 5 years ago committed by Facebook Github Bot
parent 2837008525
commit dd19014a7a
  1. 1
      CMakeLists.txt
  2. 1
      TARGETS
  3. 1
      src.mk
  4. 0
      table/block_based/filter_policy_internal.h
  5. 2
      table/block_based/full_filter_block_test.cc
  6. 2
      table/block_based/partitioned_filter_block_test.cc
  7. 4
      util/bloom.cc
  8. 2
      util/bloom_test.cc
  9. 16
      util/filter_policy.cc

@ -646,7 +646,6 @@ set(SOURCES
util/concurrent_task_limiter_impl.cc util/concurrent_task_limiter_impl.cc
util/crc32c.cc util/crc32c.cc
util/dynamic_bloom.cc util/dynamic_bloom.cc
util/filter_policy.cc
util/hash.cc util/hash.cc
util/murmurhash.cc util/murmurhash.cc
util/random.cc util/random.cc

@ -274,7 +274,6 @@ cpp_library(
"util/concurrent_task_limiter_impl.cc", "util/concurrent_task_limiter_impl.cc",
"util/crc32c.cc", "util/crc32c.cc",
"util/dynamic_bloom.cc", "util/dynamic_bloom.cc",
"util/filter_policy.cc",
"util/hash.cc", "util/hash.cc",
"util/murmurhash.cc", "util/murmurhash.cc",
"util/random.cc", "util/random.cc",

@ -166,7 +166,6 @@ LIB_SOURCES = \
util/concurrent_task_limiter_impl.cc \ util/concurrent_task_limiter_impl.cc \
util/crc32c.cc \ util/crc32c.cc \
util/dynamic_bloom.cc \ util/dynamic_bloom.cc \
util/filter_policy.cc \
util/hash.cc \ util/hash.cc \
util/murmurhash.cc \ util/murmurhash.cc \
util/random.cc \ util/random.cc \

@ -7,7 +7,7 @@
#include "rocksdb/filter_policy.h" #include "rocksdb/filter_policy.h"
#include "table/block_based/block_based_table_reader.h" #include "table/block_based/block_based_table_reader.h"
#include "table/block_based/mock_block_based_table.h" #include "table/block_based/mock_block_based_table.h"
#include "table/full_filter_bits_builder.h" #include "table/block_based/filter_policy_internal.h"
#include "test_util/testharness.h" #include "test_util/testharness.h"
#include "test_util/testutil.h" #include "test_util/testutil.h"
#include "util/coding.h" #include "util/coding.h"

@ -9,7 +9,7 @@
#include "table/block_based/block_based_table_reader.h" #include "table/block_based/block_based_table_reader.h"
#include "table/block_based/partitioned_filter_block.h" #include "table/block_based/partitioned_filter_block.h"
#include "table/full_filter_bits_builder.h" #include "table/block_based/filter_policy_internal.h"
#include "index_builder.h" #include "index_builder.h"
#include "logging/logging.h" #include "logging/logging.h"

@ -12,7 +12,7 @@
#include "rocksdb/slice.h" #include "rocksdb/slice.h"
#include "table/block_based/block_based_filter_block.h" #include "table/block_based/block_based_filter_block.h"
#include "table/block_based/full_filter_block.h" #include "table/block_based/full_filter_block.h"
#include "table/full_filter_bits_builder.h" #include "table/block_based/filter_policy_internal.h"
#include "third-party/folly/folly/ConstexprMath.h" #include "third-party/folly/folly/ConstexprMath.h"
#include "util/bloom_impl.h" #include "util/bloom_impl.h"
#include "util/coding.h" #include "util/coding.h"
@ -340,4 +340,6 @@ const FilterPolicy* NewBloomFilterPolicy(int bits_per_key,
return new BloomFilterPolicy(bits_per_key, use_block_based_builder); return new BloomFilterPolicy(bits_per_key, use_block_based_builder);
} }
FilterPolicy::~FilterPolicy() { }
} // namespace rocksdb } // namespace rocksdb

@ -21,7 +21,7 @@ int main() {
#include "logging/logging.h" #include "logging/logging.h"
#include "memory/arena.h" #include "memory/arena.h"
#include "rocksdb/filter_policy.h" #include "rocksdb/filter_policy.h"
#include "table/full_filter_bits_builder.h" #include "table/block_based/filter_policy_internal.h"
#include "test_util/testharness.h" #include "test_util/testharness.h"
#include "test_util/testutil.h" #include "test_util/testutil.h"
#include "util/gflags_compat.h" #include "util/gflags_compat.h"

@ -1,16 +0,0 @@
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
// This source code is licensed under both the GPLv2 (found in the
// COPYING file in the root directory) and Apache 2.0 License
// (found in the LICENSE.Apache file in the root directory).
//
// Copyright (c) 2012 The LevelDB Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. See the AUTHORS file for names of contributors.
#include "rocksdb/filter_policy.h"
namespace rocksdb {
FilterPolicy::~FilterPolicy() { }
} // namespace rocksdb
Loading…
Cancel
Save