YugabyteDB (2.13.0.0-b42, bfc6a6643e7399ac8a0e81d06a3ee6d6571b33ab)

Coverage Report

Created: 2022-03-09 17:30

/Users/deen/code/yugabyte-db/src/yb/tablet/tablet_component.cc
Line
Count
Source (jump to first uncovered line)
1
// Copyright (c) YugaByte, Inc.
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
4
// in compliance with the License.  You may obtain a copy of the License at
5
//
6
// http://www.apache.org/licenses/LICENSE-2.0
7
//
8
// Unless required by applicable law or agreed to in writing, software distributed under the License
9
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
10
// or implied.  See the License for the specific language governing permissions and limitations
11
// under the License.
12
//
13
14
#include "yb/tablet/tablet_component.h"
15
16
#include "yb/common/index.h"
17
18
#include "yb/tablet/tablet.h"
19
#include "yb/tablet/tablet_metadata.h"
20
21
namespace yb {
22
namespace tablet {
23
24
Result<TabletScopedRWOperationPauses> TabletComponent::StartShutdownRocksDBs(
25
862
    DisableFlushOnShutdown disable_flush_on_shutdown) {
26
862
  return tablet_.StartShutdownRocksDBs(disable_flush_on_shutdown);
27
862
}
28
29
CHECKED_STATUS TabletComponent::CompleteShutdownRocksDBs(
30
862
    Destroy destroy, TabletScopedRWOperationPauses* ops_pauses) {
31
862
  return tablet_.CompleteShutdownRocksDBs(destroy, ops_pauses);
32
862
}
33
34
862
Status TabletComponent::OpenRocksDBs() {
35
862
  return tablet_.OpenKeyValueTablet();
36
862
}
37
38
4.16k
std::string TabletComponent::LogPrefix() const {
39
4.16k
  return tablet_.LogPrefix();
40
4.16k
}
41
42
1.43k
RaftGroupMetadata& TabletComponent::metadata() const {
43
1.43k
  return *tablet_.metadata();
44
1.43k
}
45
46
1.57k
RWOperationCounter& TabletComponent::pending_op_counter() const {
47
1.57k
  return tablet_.pending_non_abortable_op_counter_;
48
1.57k
}
49
50
2.26k
rocksdb::DB& TabletComponent::regular_db() const {
51
2.26k
  return *tablet_.regular_db_;
52
2.26k
}
53
54
1.55k
bool TabletComponent::has_regular_db() const {
55
1.55k
  return tablet_.regular_db_ != nullptr;
56
1.55k
}
57
58
964
rocksdb::DB& TabletComponent::intents_db() const {
59
964
  return *tablet_.intents_db_;
60
964
}
61
62
3.63k
bool TabletComponent::has_intents_db() const {
63
3.63k
  return tablet_.intents_db_ != nullptr;
64
3.63k
}
65
66
2.41k
std::mutex& TabletComponent::create_checkpoint_lock() const {
67
2.41k
  return tablet_.create_checkpoint_lock_;
68
2.41k
}
69
70
1.72k
rocksdb::Env& TabletComponent::rocksdb_env() const {
71
1.72k
  return tablet_.rocksdb_env();
72
1.72k
}
73
74
0
void TabletComponent::RefreshYBMetaDataCache() {
75
0
  tablet_.ResetYBMetaDataCache();
76
0
  if (!metadata().index_map()->empty()) {
77
0
    tablet_.CreateNewYBMetaDataCache();
78
0
  }
79
0
}
80
81
} // namespace tablet
82
} // namespace yb