]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/utilities/compaction_filters/remove_emptyvalue_compactionfilter.cc
add subtree-ish sources for 12.0.3
[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 the BSD-style license found in the
3 // LICENSE file in the root directory of this source tree. An additional grant
4 // of patent rights can be found in the PATENTS file in the same directory.
5
6 #ifndef ROCKSDB_LITE
7
8 #include <string>
9
10 #include "rocksdb/slice.h"
11 #include "utilities/compaction_filters/remove_emptyvalue_compactionfilter.h"
12
13 namespace rocksdb {
14
15 const char* RemoveEmptyValueCompactionFilter::Name() const {
16 return "RemoveEmptyValueCompactionFilter";
17 }
18
19 bool RemoveEmptyValueCompactionFilter::Filter(int level,
20 const Slice& key,
21 const Slice& existing_value,
22 std::string* new_value,
23 bool* value_changed) const {
24
25 // remove kv pairs that have empty values
26 return existing_value.empty();
27 }
28
29 } // namespace rocksdb
30 #endif // !ROCKSDB_LITE