diff --git a/.gitignore b/.gitignore index 7157b16ea..e2d24c97b 100644 --- a/.gitignore +++ b/.gitignore @@ -100,4 +100,6 @@ inode_vptrs *.txt __pycache__/ *.csv -debug.* \ No newline at end of file + +include/csv2/ +debug.* diff --git a/include/rocksdb/filter_policy.h b/include/rocksdb/filter_policy.h index 584bb1355..7eb9e79e2 100644 --- a/include/rocksdb/filter_policy.h +++ b/include/rocksdb/filter_policy.h @@ -60,7 +60,7 @@ class FilterBitsBuilder { // Generate the filter using the keys that are added, and the specified hash // function id. The return value of this function would be the filter bits, The // ownership of actual data is set to buf (WaLSM+) - virtual Slice Finish(std::unique_ptr* buf, const int /* filter_id */) { + virtual Slice FinishWithId(std::unique_ptr* buf, const int /* filter_id */) { buf->reset(); fprintf(stderr, "error call FilterBitsBuilder::Finish(buf, filter_id)\n"); exit(1); @@ -105,14 +105,14 @@ class FilterBitsReader { #ifdef ART_PLUS // Check if the entry match the bits in filter using the specified hash function (WaLSM+) - virtual bool MayMatch(const Slice& /* entry */, const int /* hash_id */) { + virtual bool MayMatchWithId(const Slice& /* entry */, const int /* hash_id */) { fprintf(stderr, "Error call FilterBitsReader::MayMatch(entry, hash_id)"); exit(1); return true; } // Check if an array of entries match the bits in filter using the specified hash function (WaLSM+) - virtual void MayMatch(int /* num_keys */, Slice** /* keys */, bool* /* may_match */, const int /* hash_id */) { + virtual void MayMatchWithId(int /* num_keys */, Slice** /* keys */, bool* /* may_match */, const int /* hash_id */) { fprintf(stderr, "Error call FilterBitsReader::MayMatch(num_keys, keys, may_match, hash_id)"); exit(1); } diff --git a/table/block_based/filter_policy.cc b/table/block_based/filter_policy.cc index 79b7a36ef..da03f1d5f 100644 --- a/table/block_based/filter_policy.cc +++ b/table/block_based/filter_policy.cc @@ -569,7 +569,7 @@ class MultiLegacyBloomBitsBuilder : public FilterBitsBuilder { virtual void AddKey(const Slice& key) override; virtual Slice Finish(std::unique_ptr* buf) override; - virtual Slice Finish(std::unique_ptr* buf, + virtual Slice FinishWithId(std::unique_ptr* buf, const int hash_id) override; private: @@ -612,7 +612,7 @@ Slice MultiLegacyBloomBitsBuilder::Finish(std::unique_ptr* buf) { return Slice(); } -Slice MultiLegacyBloomBitsBuilder::Finish(std::unique_ptr* buf, +Slice MultiLegacyBloomBitsBuilder::FinishWithId(std::unique_ptr* buf, int hash_id) { return bits_builders_[hash_id]->Finish(buf); } @@ -673,7 +673,7 @@ class LegacyBloomBitsReader : public FilterBitsReader { // passed to FilterBitsBuilder::AddKey. This method may return true or false // if the key was not on the list, but it should aim to return false with a // high probability. (WaLSM+) - bool MayMatch(const Slice& key, const int hash_id) override { + bool MayMatchWithId(const Slice& key, const int hash_id) override { uint32_t hash = BloomHashId(key, hash_id); uint32_t byte_offset; LegacyBloomImpl::PrepareHashMayMatch( @@ -683,7 +683,7 @@ class LegacyBloomBitsReader : public FilterBitsReader { } // check whether keys is in filter array (WaLSM+) - virtual void MayMatch(int num_keys, Slice** keys, bool* may_match, const int hash_id) override { + virtual void MayMatchWithId(int num_keys, Slice** keys, bool* may_match, const int hash_id) override { std::array hashes; std::array byte_offsets; for (int i = 0; i < num_keys; ++i) { diff --git a/table/block_based/full_filter_block.cc b/table/block_based/full_filter_block.cc index 57ac08dac..f6ecbeb1c 100644 --- a/table/block_based/full_filter_block.cc +++ b/table/block_based/full_filter_block.cc @@ -201,7 +201,7 @@ bool FullFilterBlockReader::MayMatch( filter_block.GetValue()->filter_bits_reader(); if (filter_bits_reader) { - if (filter_bits_reader->MayMatch(entry, hash_id)) { + if (filter_bits_reader->MayMatchWithId(entry, hash_id)) { PERF_COUNTER_ADD(bloom_sst_hit_count, 1); return true; } else { @@ -322,7 +322,7 @@ void FullFilterBlockReader::MayMatch( } #ifdef ART_PLUS - filter_bits_reader->MayMatch(num_keys, &keys[0], &may_match[0], hash_id); + filter_bits_reader->MayMatchWithId(num_keys, &keys[0], &may_match[0], hash_id); #else filter_bits_reader->MayMatch(num_keys, &keys[0], &may_match[0]); #endif diff --git a/table/block_based/partitioned_filter_block.cc b/table/block_based/partitioned_filter_block.cc index faf7537db..48bad15b2 100644 --- a/table/block_based/partitioned_filter_block.cc +++ b/table/block_based/partitioned_filter_block.cc @@ -105,7 +105,7 @@ void PartitionedFilterBlockBuilder::MaybeCutAFilterBlock( #ifdef ART_PLUS for (int i = 0; i < filter_count_; ++i) { filter_gc[i].push_back(std::unique_ptr(nullptr)); - Slice filter = filter_bits_builder_->Finish(&filter_gc[i].back(), i); + Slice filter = filter_bits_builder_->FinishWithId(&filter_gc[i].back(), i); std::string& index_key = p_index_builder_->GetPartitionKey(); filters[i].push_back({index_key, filter, segment_id_base_.fetch_add(1, std::memory_order_relaxed)}); } @@ -646,7 +646,7 @@ Slice generate_modified_internal_key(std::unique_ptr& buf, Slice o EncodeFixed32R(modified_key_buf, filter_index); std::memcpy(modified_key_buf + 4, original_user_key.data(), original_user_key.size()); EncodeFixed32R(modified_key_buf + 4 + original_user_key.size(), segment_id); - std::memcpy(modified_key_buf + 4 + original_user_key.size() + 4, original_user_key.data_, original_user_key.size()); + std::memcpy(modified_key_buf + 4 + original_user_key.size() + 4, original_internal_bytes.data_, original_internal_bytes.size()); Slice modified_key = Slice(modified_key_buf, modified_key_buf_size); buf.reset(modified_key_buf);