YugabyteDB (2.13.1.0-b60, 21121d69985fbf76aa6958d8f04a9bfa936293b5)

Coverage Report

Created: 2022-03-22 16:43

/Users/deen/code/yugabyte-db/src/yb/rocksdb/db/experimental.cc
Line
Count
Source (jump to first uncovered line)
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
// The following only applies to changes made to this file as part of YugaByte development.
7
//
8
// Portions Copyright (c) YugaByte, Inc.
9
//
10
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
11
// in compliance with the License.  You may obtain a copy of the License at
12
//
13
// http://www.apache.org/licenses/LICENSE-2.0
14
//
15
// Unless required by applicable law or agreed to in writing, software distributed under the License
16
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
17
// or implied.  See the License for the specific language governing permissions and limitations
18
// under the License.
19
//
20
21
22
#include "yb/rocksdb/db/db_impl.h"
23
24
namespace rocksdb {
25
namespace experimental {
26
27
#ifndef ROCKSDB_LITE
28
29
Status SuggestCompactRange(DB* db, ColumnFamilyHandle* column_family,
30
6
                           const Slice* begin, const Slice* end) {
31
6
  auto dbimpl = dynamic_cast<DBImpl*>(db);
32
6
  if (dbimpl == nullptr) {
33
0
    return STATUS(InvalidArgument, "Didn't recognize DB object");
34
0
  }
35
36
6
  return dbimpl->SuggestCompactRange(column_family, begin, end);
37
6
}
38
39
3
Status PromoteL0(DB* db, ColumnFamilyHandle* column_family, int target_level) {
40
3
  auto dbimpl = dynamic_cast<DBImpl*>(db);
41
3
  if (dbimpl == nullptr) {
42
0
    return STATUS(InvalidArgument, "Didn't recognize DB object");
43
0
  }
44
3
  return dbimpl->PromoteL0(column_family, target_level);
45
3
}
46
47
#else  // ROCKSDB_LITE
48
49
Status SuggestCompactRange(DB* db, ColumnFamilyHandle* column_family,
50
                           const Slice* begin, const Slice* end) {
51
  return STATUS(NotSupported, "Not supported in RocksDB LITE");
52
}
53
54
Status PromoteL0(DB* db, ColumnFamilyHandle* column_family, int target_level) {
55
  return STATUS(NotSupported, "Not supported in RocksDB LITE");
56
}
57
58
#endif  // ROCKSDB_LITE
59
60
6
Status SuggestCompactRange(DB* db, const Slice* begin, const Slice* end) {
61
6
  return SuggestCompactRange(db, db->DefaultColumnFamily(), begin, end);
62
6
}
63
64
}  // namespace experimental
65
}  // namespace rocksdb