]>
git.proxmox.com Git - ceph.git/blob - 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.
6 #include "rocksdb/experimental.h"
8 #include "db/db_impl.h"
11 namespace experimental
{
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");
22 return dbimpl
->SuggestCompactRange(column_family
, begin
, end
);
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");
30 return dbimpl
->PromoteL0(column_family
, target_level
);
35 Status
SuggestCompactRange(DB
* db
, ColumnFamilyHandle
* column_family
,
36 const Slice
* begin
, const Slice
* end
) {
37 return Status::NotSupported("Not supported in RocksDB LITE");
40 Status
PromoteL0(DB
* db
, ColumnFamilyHandle
* column_family
, int target_level
) {
41 return Status::NotSupported("Not supported in RocksDB LITE");
44 #endif // ROCKSDB_LITE
46 Status
SuggestCompactRange(DB
* db
, const Slice
* begin
, const Slice
* end
) {
47 return SuggestCompactRange(db
, db
->DefaultColumnFamily(), begin
, end
);
50 } // namespace experimental
51 } // namespace rocksdb