YugabyteDB (2.13.1.0-b60, 21121d69985fbf76aa6958d8f04a9bfa936293b5)

Coverage Report

Created: 2022-03-22 16:43

/Users/deen/code/yugabyte-db/src/yb/master/master_admin_service.cc
Line
Count
Source
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/master/catalog_manager.h"
15
#include "yb/master/master_admin.service.h"
16
#include "yb/master/master_service.h"
17
#include "yb/master/master_service_base.h"
18
#include "yb/master/master_service_base-internal.h"
19
20
#include "yb/util/flag_tags.h"
21
22
DEFINE_test_flag(bool, timeout_non_leader_master_rpcs, false,
23
                 "Timeout all master requests to non leader.");
24
25
namespace yb {
26
namespace master {
27
28
namespace {
29
30
class MasterAdminServiceImpl : public MasterServiceBase, public MasterAdminIf {
31
 public:
32
  explicit MasterAdminServiceImpl(Master* master)
33
8.03k
      : MasterServiceBase(master), MasterAdminIf(master->metric_entity()) {}
34
35
  void IsInitDbDone(const IsInitDbDoneRequestPB* req,
36
                    IsInitDbDoneResponsePB* resp,
37
5.10k
                    rpc::RpcContext rpc) override {
38
5.10k
    HANDLE_ON_LEADER_WITHOUT_LOCK(CatalogManager, IsInitDbDone);
39
5.10k
  }
40
41
  MASTER_SERVICE_IMPL_ON_LEADER_WITH_LOCK(
42
      CatalogManager,
43
      (CompactSysCatalog)
44
      (CreateTransactionStatusTable)
45
      (DdlLog)
46
      (DeleteNotServingTablet)
47
      (FlushSysCatalog)
48
      (DisableTabletSplitting)
49
      (IsTabletSplittingComplete)
50
      (SplitTablet)
51
  )
52
53
  MASTER_SERVICE_IMPL_ON_LEADER_WITH_LOCK(
54
      FlushManager,
55
      (FlushTables)
56
      (IsFlushTablesDone)
57
  )
58
};
59
60
} // namespace
61
62
8.03k
std::unique_ptr<rpc::ServiceIf> MakeMasterAdminService(Master* master) {
63
8.03k
  return std::make_unique<MasterAdminServiceImpl>(master);
64
8.03k
}
65
66
} // namespace master
67
} // namespace yb