]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/utilities/compaction_filters/remove_emptyvalue_compactionfilter.cc
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / rocksdb / utilities / compaction_filters / remove_emptyvalue_compactionfilter.cc
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
6 #ifndef ROCKSDB_LITE
7
8 #include "utilities/compaction_filters/remove_emptyvalue_compactionfilter.h"
9
10 #include <string>
11
12 #include "rocksdb/slice.h"
13
14 namespace ROCKSDB_NAMESPACE {
15
16 bool RemoveEmptyValueCompactionFilter::Filter(int /*level*/,
17 const Slice& /*key*/,
18 const Slice& existing_value,
19 std::string* /*new_value*/,
20 bool* /*value_changed*/) const {
21 // remove kv pairs that have empty values
22 return existing_value.empty();
23 }
24
25 } // namespace ROCKSDB_NAMESPACE
26 #endif // !ROCKSDB_LITE