Skip to content

Commit

Permalink
[master] modernize code w.r.t. virtual/override keywords
Browse files Browse the repository at this point in the history
This patch does not contain any functional modifications.

Change-Id: Ibf5871424f569e50bb3cae9d1554ba4c02b8372c
Reviewed-on: http://gerrit.cloudera.org:8080/13066
Tested-by: Alexey Serbin <[email protected]>
Reviewed-by: Adar Dembo <[email protected]>
  • Loading branch information
alexeyserbin committed Apr 19, 2019
1 parent 1f61479 commit 51a14ea
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 79 deletions.
15 changes: 7 additions & 8 deletions src/kudu/master/master-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
#include "kudu/gutil/dynamic_annotations.h"
#include "kudu/gutil/gscoped_ptr.h"
#include "kudu/gutil/map-util.h"
#include "kudu/gutil/port.h"
#include "kudu/gutil/strings/split.h"
#include "kudu/gutil/strings/substitute.h"
#include "kudu/gutil/strings/util.h"
Expand Down Expand Up @@ -117,7 +116,7 @@ namespace master {

class MasterTest : public KuduTest {
protected:
virtual void SetUp() OVERRIDE {
void SetUp() override {
KuduTest::SetUp();

// In this test, we create tables to test catalog manager behavior,
Expand All @@ -138,7 +137,7 @@ class MasterTest : public KuduTest {
mini_master_->bound_rpc_addr().host()));
}

virtual void TearDown() OVERRIDE {
void TearDown() override {
mini_master_->Shutdown();
KuduTest::TearDown();
}
Expand Down Expand Up @@ -1064,16 +1063,16 @@ class MasterMetadataVerifier : public TableVisitor,
dead_table_names_(std::move(dead_table_names)) {
}

virtual Status VisitTable(const std::string& table_id,
const SysTablesEntryPB& metadata) OVERRIDE {
Status VisitTable(const std::string& table_id,
const SysTablesEntryPB& metadata) override {
InsertOrDie(&visited_tables_by_id_, table_id,
{ table_id, metadata.name(), metadata.state() });
return Status::OK();
}

virtual Status VisitTablet(const std::string& table_id,
const std::string& tablet_id,
const SysTabletsEntryPB& metadata) OVERRIDE {
Status VisitTablet(const std::string& table_id,
const std::string& tablet_id,
const SysTabletsEntryPB& metadata) override {
InsertOrDie(&visited_tablets_by_id_, tablet_id,
{ tablet_id, table_id, metadata.state() });
return Status::OK();
Expand Down
5 changes: 2 additions & 3 deletions src/kudu/master/master_path_handlers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
#include "kudu/consensus/metadata.pb.h"
#include "kudu/consensus/quorum_util.h"
#include "kudu/gutil/map-util.h"
#include "kudu/gutil/port.h"
#include "kudu/gutil/ref_counted.h"
#include "kudu/gutil/stringprintf.h"
#include "kudu/gutil/strings/ascii_ctype.h"
Expand Down Expand Up @@ -512,7 +511,7 @@ class JsonDumper : public TableVisitor, public TabletVisitor {
}

Status VisitTable(const std::string& table_id,
const SysTablesEntryPB& metadata) OVERRIDE {
const SysTablesEntryPB& metadata) override {
if (metadata.state() != SysTablesEntryPB::RUNNING) {
return Status::OK();
}
Expand All @@ -533,7 +532,7 @@ class JsonDumper : public TableVisitor, public TabletVisitor {

Status VisitTablet(const std::string& table_id,
const std::string& tablet_id,
const SysTabletsEntryPB& metadata) OVERRIDE {
const SysTabletsEntryPB& metadata) override {
if (metadata.state() != SysTabletsEntryPB::RUNNING) {
return Status::OK();
}
Expand Down
124 changes: 65 additions & 59 deletions src/kudu/master/master_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
#ifndef KUDU_MASTER_MASTER_SERVICE_H
#define KUDU_MASTER_MASTER_SERVICE_H

#pragma once

#include <cstdint>

Expand Down Expand Up @@ -95,61 +95,69 @@ class MasterServiceImpl : public MasterServiceIf {
google::protobuf::Message* resp,
rpc::RpcContext* context) override;

virtual void Ping(const PingRequestPB* req,
PingResponsePB* resp,
rpc::RpcContext* rpc) OVERRIDE;

virtual void TSHeartbeat(const TSHeartbeatRequestPB* req,
TSHeartbeatResponsePB* resp,
rpc::RpcContext* rpc) OVERRIDE;

virtual void GetTabletLocations(const GetTabletLocationsRequestPB* req,
GetTabletLocationsResponsePB* resp,
rpc::RpcContext* rpc) OVERRIDE;

virtual void CreateTable(const CreateTableRequestPB* req,
CreateTableResponsePB* resp,
rpc::RpcContext* rpc) OVERRIDE;
virtual void IsCreateTableDone(const IsCreateTableDoneRequestPB* req,
IsCreateTableDoneResponsePB* resp,
rpc::RpcContext* rpc) OVERRIDE;
virtual void DeleteTable(const DeleteTableRequestPB* req,
DeleteTableResponsePB* resp,
rpc::RpcContext* rpc) OVERRIDE;
virtual void AlterTable(const AlterTableRequestPB* req,
AlterTableResponsePB* resp,
rpc::RpcContext* rpc) OVERRIDE;
virtual void IsAlterTableDone(const IsAlterTableDoneRequestPB* req,
IsAlterTableDoneResponsePB* resp,
rpc::RpcContext* rpc) OVERRIDE;
virtual void ListTables(const ListTablesRequestPB* req,
ListTablesResponsePB* resp,
rpc::RpcContext* rpc) OVERRIDE;
virtual void GetTableLocations(const GetTableLocationsRequestPB* req,
GetTableLocationsResponsePB* resp,
rpc::RpcContext* rpc) OVERRIDE;
virtual void GetTableSchema(const GetTableSchemaRequestPB* req,
GetTableSchemaResponsePB* resp,
rpc::RpcContext* rpc) OVERRIDE;
virtual void ListTabletServers(const ListTabletServersRequestPB* req,
ListTabletServersResponsePB* resp,
rpc::RpcContext* rpc) OVERRIDE;

virtual void ListMasters(const ListMastersRequestPB* req,
ListMastersResponsePB* resp,
rpc::RpcContext* rpc) OVERRIDE;

virtual void GetMasterRegistration(const GetMasterRegistrationRequestPB* req,
GetMasterRegistrationResponsePB* resp,
rpc::RpcContext* rpc) OVERRIDE;

virtual void ConnectToMaster(const ConnectToMasterRequestPB* req,
ConnectToMasterResponsePB* resp,
rpc::RpcContext* rpc) OVERRIDE;

virtual void ReplaceTablet(const ReplaceTabletRequestPB* req,
ReplaceTabletResponsePB* resp,
rpc::RpcContext* rpc) OVERRIDE;
void Ping(const PingRequestPB* req,
PingResponsePB* resp,
rpc::RpcContext* rpc) override;

void TSHeartbeat(const TSHeartbeatRequestPB* req,
TSHeartbeatResponsePB* resp,
rpc::RpcContext* rpc) override;

void GetTabletLocations(const GetTabletLocationsRequestPB* req,
GetTabletLocationsResponsePB* resp,
rpc::RpcContext* rpc) override;

void CreateTable(const CreateTableRequestPB* req,
CreateTableResponsePB* resp,
rpc::RpcContext* rpc) override;

void IsCreateTableDone(const IsCreateTableDoneRequestPB* req,
IsCreateTableDoneResponsePB* resp,
rpc::RpcContext* rpc) override;

void DeleteTable(const DeleteTableRequestPB* req,
DeleteTableResponsePB* resp,
rpc::RpcContext* rpc) override;

void AlterTable(const AlterTableRequestPB* req,
AlterTableResponsePB* resp,
rpc::RpcContext* rpc) override;

void IsAlterTableDone(const IsAlterTableDoneRequestPB* req,
IsAlterTableDoneResponsePB* resp,
rpc::RpcContext* rpc) override;

void ListTables(const ListTablesRequestPB* req,
ListTablesResponsePB* resp,
rpc::RpcContext* rpc) override;

void GetTableLocations(const GetTableLocationsRequestPB* req,
GetTableLocationsResponsePB* resp,
rpc::RpcContext* rpc) override;

void GetTableSchema(const GetTableSchemaRequestPB* req,
GetTableSchemaResponsePB* resp,
rpc::RpcContext* rpc) override;

void ListTabletServers(const ListTabletServersRequestPB* req,
ListTabletServersResponsePB* resp,
rpc::RpcContext* rpc) override;

void ListMasters(const ListMastersRequestPB* req,
ListMastersResponsePB* resp,
rpc::RpcContext* rpc) override;

void GetMasterRegistration(const GetMasterRegistrationRequestPB* req,
GetMasterRegistrationResponsePB* resp,
rpc::RpcContext* rpc) override;

void ConnectToMaster(const ConnectToMasterRequestPB* req,
ConnectToMasterResponsePB* resp,
rpc::RpcContext* rpc) override;

void ReplaceTablet(const ReplaceTabletRequestPB* req,
ReplaceTabletResponsePB* resp,
rpc::RpcContext* rpc) override;

bool SupportsFeature(uint32_t feature) const override;

Expand All @@ -161,5 +169,3 @@ class MasterServiceImpl : public MasterServiceIf {

} // namespace master
} // namespace kudu

#endif
18 changes: 9 additions & 9 deletions src/kudu/master/sys_catalog-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
// specific language governing permissions and limitations
// under the License.

#include "kudu/master/sys_catalog.h"

#include <memory>
#include <string>
#include <utility>
Expand All @@ -26,14 +28,12 @@
#include "kudu/common/schema.h"
#include "kudu/common/wire_protocol.h"
#include "kudu/gutil/gscoped_ptr.h"
#include "kudu/gutil/port.h"
#include "kudu/gutil/ref_counted.h"
#include "kudu/master/catalog_manager.h"
#include "kudu/master/master.h"
#include "kudu/master/master.pb.h"
#include "kudu/master/master.proxy.h"
#include "kudu/master/mini_master.h"
#include "kudu/master/sys_catalog.h"
#include "kudu/rpc/messenger.h"
#include "kudu/security/cert.h"
#include "kudu/security/crypto.h"
Expand Down Expand Up @@ -67,7 +67,7 @@ namespace master {

class SysCatalogTest : public KuduTest {
protected:
virtual void SetUp() OVERRIDE {
void SetUp() override {
KuduTest::SetUp();

// Start master
Expand All @@ -84,7 +84,7 @@ class SysCatalogTest : public KuduTest {
mini_master_->bound_rpc_addr().host()));
}

virtual void TearDown() OVERRIDE {
void TearDown() override {
mini_master_->Shutdown();
KuduTest::TearDown();
}
Expand All @@ -101,8 +101,8 @@ class TestTableLoader : public TableVisitor {
tables.clear();
}

virtual Status VisitTable(const string& table_id,
const SysTablesEntryPB& metadata) OVERRIDE {
Status VisitTable(const string& table_id,
const SysTablesEntryPB& metadata) override {
// Setup the table info
scoped_refptr<TableInfo> table = new TableInfo(table_id);
TableMetadataLock l(table.get(), LockMode::WRITE);
Expand Down Expand Up @@ -224,9 +224,9 @@ class TestTabletLoader : public TabletVisitor {
tablets.clear();
}

virtual Status VisitTablet(const string& /*table_id*/,
const string& tablet_id,
const SysTabletsEntryPB& metadata) OVERRIDE {
Status VisitTablet(const string& /*table_id*/,
const string& tablet_id,
const SysTabletsEntryPB& metadata) override {
// Setup the tablet info
scoped_refptr<TabletInfo> tablet = new TabletInfo(nullptr, tablet_id);
TabletMetadataLock l(tablet.get(), LockMode::WRITE);
Expand Down

0 comments on commit 51a14ea

Please sign in to comment.