]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/db/experimental.cc
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / rocksdb / db / experimental.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 #include "rocksdb/experimental.h"
7
8 #include "db/db_impl.h"
9
10 namespace rocksdb {
11 namespace experimental {
12
13 #ifndef ROCKSDB_LITE
14
15 Status SuggestCompactRange(DB* db, ColumnFamilyHandle* column_family,
16 const Slice* begin, const Slice* end) {
17 auto dbimpl = dynamic_cast<DBImpl*>(db);
18 if (dbimpl == nullptr) {
19 return Status::InvalidArgument("Didn't recognize DB object");
20 }
21
22 return dbimpl->SuggestCompactRange(column_family, begin, end);
23 }
24
25 Status PromoteL0(DB* db, ColumnFamilyHandle* column_family, int target_level) {
26 auto dbimpl = dynamic_cast<DBImpl*>(db);
27 if (dbimpl == nullptr) {
28 return Status::InvalidArgument("Didn't recognize DB object");
29 }
30 return dbimpl->PromoteL0(column_family, target_level);
31 }
32
33 #else // ROCKSDB_LITE
34
35 Status SuggestCompactRange(DB* db, ColumnFamilyHandle* column_family,
36 const Slice* begin, const Slice* end) {
37 return Status::NotSupported("Not supported in RocksDB LITE");
38 }
39
40 Status PromoteL0(DB* db, ColumnFamilyHandle* column_family, int target_level) {
41 return Status::NotSupported("Not supported in RocksDB LITE");
42 }
43
44 #endif // ROCKSDB_LITE
45
46 Status SuggestCompactRange(DB* db, const Slice* begin, const Slice* end) {
47 return SuggestCompactRange(db, db->DefaultColumnFamily(), begin, end);
48 }
49
50 } // namespace experimental
51 } // namespace rocksdb