You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by al...@apache.org on 2019/04/19 05:58:28 UTC
[kudu] branch master updated: [master] modernize code w.r.t.
virtual/override keywords
This is an automated email from the ASF dual-hosted git repository.
alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
The following commit(s) were added to refs/heads/master by this push:
new 51a14ea [master] modernize code w.r.t. virtual/override keywords
51a14ea is described below
commit 51a14eacfa1148bb10513a3a8a6b2ecb2e148cad
Author: Alexey Serbin <al...@apache.org>
AuthorDate: Thu Apr 18 16:32:10 2019 -0700
[master] modernize code w.r.t. virtual/override keywords
This patch does not contain any functional modifications.
Change-Id: Ibf5871424f569e50bb3cae9d1554ba4c02b8372c
Reviewed-on: http://gerrit.cloudera.org:8080/13066
Tested-by: Alexey Serbin <as...@cloudera.com>
Reviewed-by: Adar Dembo <ad...@cloudera.com>
---
src/kudu/master/master-test.cc | 15 ++--
src/kudu/master/master_path_handlers.cc | 5 +-
src/kudu/master/master_service.h | 124 +++++++++++++++++---------------
src/kudu/master/sys_catalog-test.cc | 18 ++---
4 files changed, 83 insertions(+), 79 deletions(-)
diff --git a/src/kudu/master/master-test.cc b/src/kudu/master/master-test.cc
index 72f2b62..d7fd360 100644
--- a/src/kudu/master/master-test.cc
+++ b/src/kudu/master/master-test.cc
@@ -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"
@@ -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,
@@ -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();
}
@@ -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();
diff --git a/src/kudu/master/master_path_handlers.cc b/src/kudu/master/master_path_handlers.cc
index 2a128b3..601557d 100644
--- a/src/kudu/master/master_path_handlers.cc
+++ b/src/kudu/master/master_path_handlers.cc
@@ -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"
@@ -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();
}
@@ -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();
}
diff --git a/src/kudu/master/master_service.h b/src/kudu/master/master_service.h
index 8282291..3f1ebfd 100644
--- a/src/kudu/master/master_service.h
+++ b/src/kudu/master/master_service.h
@@ -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>
@@ -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;
@@ -161,5 +169,3 @@ class MasterServiceImpl : public MasterServiceIf {
} // namespace master
} // namespace kudu
-
-#endif
diff --git a/src/kudu/master/sys_catalog-test.cc b/src/kudu/master/sys_catalog-test.cc
index dd5d6a0..5f2f107 100644
--- a/src/kudu/master/sys_catalog-test.cc
+++ b/src/kudu/master/sys_catalog-test.cc
@@ -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>
@@ -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"
@@ -67,7 +67,7 @@ namespace master {
class SysCatalogTest : public KuduTest {
protected:
- virtual void SetUp() OVERRIDE {
+ void SetUp() override {
KuduTest::SetUp();
// Start master
@@ -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();
}
@@ -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);
@@ -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);