Skip to content

Commit

Permalink
Update HISTORY & add license to db/db_bloom_filter_test.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
udi-speedb committed Mar 7, 2024
1 parent 140c3ee commit bb86a5b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
3 changes: 2 additions & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
### New Features

### Enhancements
* set the default bucket size of hashspdb to be 400k for best memory use and performance (#854)
* set the default bucket size of hashspdb to be 400k for best memory use and performance (#854).
* Support Speedb's Paired Bloom Filter in db_bloom_filter_test (#810).

### Bug Fixes
* LOG Consistency:Display the pinning policy options same as block cache options / metadata cache options (#804).
Expand Down
35 changes: 25 additions & 10 deletions db/db_bloom_filter_test.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright (C) 2023 Speedb Ltd. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// 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
Expand Down Expand Up @@ -84,13 +98,11 @@ class DBBloomFilterTest : public DBTestBase {
class DBBloomFilterTestWithPairedBloomOnOff
: public DBTestBase,
public testing::WithParamInterface<bool> {
public:
public:
DBBloomFilterTestWithPairedBloomOnOff()
: DBTestBase("db_bloom_filter_tests", /*env_do_fsync=*/true) {}

void SetUp() override {
use_paired_bloom_ = GetParam();
}
void SetUp() override { use_paired_bloom_ = GetParam(); }

bool use_paired_bloom_ = false;
};
Expand Down Expand Up @@ -220,7 +232,8 @@ TEST_P(DBBloomFilterTestDefFormatVersion, KeyMayExist) {
ChangeOptions(kSkipPlainTable | kSkipHashIndex | kSkipFIFOCompaction));
}

TEST_P(DBBloomFilterTestWithPairedBloomOnOff, GetFilterByPrefixBloomCustomPrefixExtractor) {
TEST_P(DBBloomFilterTestWithPairedBloomOnOff,
GetFilterByPrefixBloomCustomPrefixExtractor) {
for (bool partition_filters : {true, false}) {
Options options = last_options_;
options.prefix_extractor =
Expand Down Expand Up @@ -820,7 +833,8 @@ INSTANTIATE_TEST_CASE_P(
std::make_tuple(kSpeedbPairedBloomFilter, false,
test::kDefaultFormatVersion)));

INSTANTIATE_TEST_CASE_P(DBBloomFilterTestWithPairedBloomOnOff, DBBloomFilterTestWithPairedBloomOnOff, testing::Bool());
INSTANTIATE_TEST_CASE_P(DBBloomFilterTestWithPairedBloomOnOff,
DBBloomFilterTestWithPairedBloomOnOff, testing::Bool());

INSTANTIATE_TEST_CASE_P(
FormatDef, DBBloomFilterTestWithParam,
Expand Down Expand Up @@ -2544,8 +2558,9 @@ TEST_P(DBBloomFilterTestWithPairedBloomOnOff, PrefixScan) {
} // end of while
}

// Speedb Paired Bloom Filters currently do NOT support the 'optimize_filters_for_hits' options =>
// This test doesn't cover paired bloom filters
// Speedb Paired Bloom Filters currently do NOT support the
// 'optimize_filters_for_hits' options => This test doesn't cover paired bloom
// filters
TEST_F(DBBloomFilterTest, OptimizeFiltersForHits) {
const int kNumKeysPerFlush = 1000;

Expand Down Expand Up @@ -3178,7 +3193,8 @@ TEST_F(DBBloomFilterTest, DynamicBloomFilterOptions) {
}
}

TEST_P(DBBloomFilterTestWithPairedBloomOnOff, SeekForPrevWithPartitionedFilters) {
TEST_P(DBBloomFilterTestWithPairedBloomOnOff,
SeekForPrevWithPartitionedFilters) {
Options options = CurrentOptions();
constexpr size_t kNumKeys = 10000;
static_assert(kNumKeys <= 10000, "kNumKeys have to be <= 10000");
Expand Down Expand Up @@ -3623,7 +3639,6 @@ TEST_P(DBBloomFilterTestWithPairedBloomOnOff, WeirdPrefixExtractorWithFilter3) {
}
}


} // namespace ROCKSDB_NAMESPACE

int main(int argc, char** argv) {
Expand Down

0 comments on commit bb86a5b

Please sign in to comment.