You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by mp...@apache.org on 2017/06/28 01:28:24 UTC
kudu git commit: Rename MiniClusterBase to MiniCluster
Repository: kudu
Updated Branches:
refs/heads/master 600d01a5a -> bbed78cbd
Rename MiniClusterBase to MiniCluster
Change-Id: I40273d6ca7ac5fdc4cf2a6de374d374fe86cbf36
Reviewed-on: http://gerrit.cloudera.org:8080/7273
Reviewed-by: Todd Lipcon <to...@apache.org>
Tested-by: Kudu Jenkins
Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/bbed78cb
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/bbed78cb
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/bbed78cb
Branch: refs/heads/master
Commit: bbed78cbd198019591ca4ffe4bc5d0b4abfd430f
Parents: 600d01a
Author: Mike Percy <mp...@apache.org>
Authored: Mon Jun 19 15:22:32 2017 -0700
Committer: Mike Percy <mp...@apache.org>
Committed: Wed Jun 28 01:28:08 2017 +0000
----------------------------------------------------------------------
.../integration-tests/external_mini_cluster.h | 4 +-
.../integration-tests/internal_mini_cluster.h | 4 +-
src/kudu/integration-tests/mini_cluster.h | 90 ++++++++++++++++++++
src/kudu/integration-tests/mini_cluster_base.h | 90 --------------------
src/kudu/integration-tests/test_workload.cc | 2 +-
src/kudu/integration-tests/test_workload.h | 6 +-
6 files changed, 98 insertions(+), 98 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kudu/blob/bbed78cb/src/kudu/integration-tests/external_mini_cluster.h
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/external_mini_cluster.h b/src/kudu/integration-tests/external_mini_cluster.h
index 6f4a536..29b5edd 100644
--- a/src/kudu/integration-tests/external_mini_cluster.h
+++ b/src/kudu/integration-tests/external_mini_cluster.h
@@ -30,7 +30,7 @@
#include "kudu/client/client.h"
#include "kudu/gutil/macros.h"
#include "kudu/gutil/ref_counted.h"
-#include "kudu/integration-tests/mini_cluster_base.h"
+#include "kudu/integration-tests/mini_cluster.h"
#include "kudu/security/test/mini_kdc.h"
#include "kudu/util/monotime.h"
#include "kudu/util/net/net_util.h"
@@ -154,7 +154,7 @@ struct ExternalMiniClusterOptions {
// cluster participants, which isn't feasible in the normal InternalMiniCluster.
// On the other hand, there is little access to inspect the internal state
// of the daemons.
-class ExternalMiniCluster : public MiniClusterBase {
+class ExternalMiniCluster : public MiniCluster {
public:
// Constructs a cluster with the default options.
ExternalMiniCluster();
http://git-wip-us.apache.org/repos/asf/kudu/blob/bbed78cb/src/kudu/integration-tests/internal_mini_cluster.h
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/internal_mini_cluster.h b/src/kudu/integration-tests/internal_mini_cluster.h
index 969a8a2..74a167f 100644
--- a/src/kudu/integration-tests/internal_mini_cluster.h
+++ b/src/kudu/integration-tests/internal_mini_cluster.h
@@ -23,7 +23,7 @@
#include "kudu/client/shared_ptr.h"
#include "kudu/gutil/macros.h"
-#include "kudu/integration-tests/mini_cluster_base.h"
+#include "kudu/integration-tests/mini_cluster.h"
#include "kudu/util/env.h"
namespace kudu {
@@ -70,7 +70,7 @@ struct MiniClusterOptions {
// An in-process cluster with a MiniMaster and a configurable
// number of MiniTabletServers for use in tests.
-class InternalMiniCluster : public MiniClusterBase {
+class InternalMiniCluster : public MiniCluster {
public:
InternalMiniCluster(Env* env, const MiniClusterOptions& options);
virtual ~InternalMiniCluster();
http://git-wip-us.apache.org/repos/asf/kudu/blob/bbed78cb/src/kudu/integration-tests/mini_cluster.h
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/mini_cluster.h b/src/kudu/integration-tests/mini_cluster.h
new file mode 100644
index 0000000..00342c2
--- /dev/null
+++ b/src/kudu/integration-tests/mini_cluster.h
@@ -0,0 +1,90 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+#pragma once
+
+#include "kudu/client/shared_ptr.h"
+
+namespace kudu {
+class Status;
+
+namespace client {
+class KuduClient;
+class KuduClientBuilder;
+} // namespace client
+
+namespace master {
+class MasterServiceProxy;
+} // namespace master
+
+namespace rpc {
+class Messenger;
+} // namespace rpc
+
+// Mode to which node types a certain action (like Shutdown()) should apply.
+enum class ClusterNodes {
+ ALL,
+ MASTERS_ONLY,
+ TS_ONLY
+};
+
+// Base class for MiniCluster implementations. Provides some commonly-used
+// virtual methods that allow for abstracting the details of whether the
+// mini-cluster implementation is in-process or out-of-process.
+class MiniCluster {
+ public:
+ MiniCluster() {}
+ virtual ~MiniCluster() {}
+
+ // Start the cluster.
+ virtual Status Start() = 0;
+
+ // Convenience method for shutting down the whole cluster.
+ virtual void Shutdown() final {
+ ShutdownNodes(ClusterNodes::ALL);
+ }
+
+ // Shuts down the whole cluster or part of it, depending on the selected
+ // 'nodes'.
+ virtual void ShutdownNodes(ClusterNodes nodes) = 0;
+
+ virtual int num_masters() const = 0;
+
+ virtual int num_tablet_servers() const = 0;
+
+ // Create a client configured to talk to this cluster. 'builder' may contain
+ // override options for the client. The master address will be overridden to
+ // talk to the running master(s). If 'builder' is a nullptr, default options
+ // will be used.
+ //
+ // REQUIRES: the cluster must have already been Start()ed.
+ virtual Status CreateClient(client::KuduClientBuilder* builder,
+ client::sp::shared_ptr<client::KuduClient>* client) const = 0;
+
+ // Return a messenger for use by clients.
+ virtual std::shared_ptr<rpc::Messenger> messenger() const = 0;
+
+ // If the cluster is configured for a single non-distributed master,
+ // return a proxy to that master. Requires that the single master is
+ // running.
+ virtual std::shared_ptr<master::MasterServiceProxy> master_proxy() const = 0;
+
+ // Returns an RPC proxy to the master at 'idx'. Requires that the
+ // master at 'idx' is running.
+ virtual std::shared_ptr<master::MasterServiceProxy> master_proxy(int idx) const = 0;
+};
+
+} // namespace kudu
http://git-wip-us.apache.org/repos/asf/kudu/blob/bbed78cb/src/kudu/integration-tests/mini_cluster_base.h
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/mini_cluster_base.h b/src/kudu/integration-tests/mini_cluster_base.h
deleted file mode 100644
index 6c65506..0000000
--- a/src/kudu/integration-tests/mini_cluster_base.h
+++ /dev/null
@@ -1,90 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-#pragma once
-
-#include "kudu/client/shared_ptr.h"
-
-namespace kudu {
-class Status;
-
-namespace client {
-class KuduClient;
-class KuduClientBuilder;
-} // namespace client
-
-namespace master {
-class MasterServiceProxy;
-} // namespace master
-
-namespace rpc {
-class Messenger;
-} // namespace rpc
-
-// Mode to which node types a certain action (like Shutdown()) should apply.
-enum class ClusterNodes {
- ALL,
- MASTERS_ONLY,
- TS_ONLY
-};
-
-// Base class for InternalMiniCluster implementations. Provides some commonly-used
-// virtual methods that allow for abstracting the details of whether the
-// mini-cluster implementation is in-process or out-of-process.
-class MiniClusterBase {
- public:
- MiniClusterBase() {}
- virtual ~MiniClusterBase() {}
-
- // Start the cluster.
- virtual Status Start() = 0;
-
- // Convenience method for shutting down the whole cluster.
- virtual void Shutdown() final {
- ShutdownNodes(ClusterNodes::ALL);
- }
-
- // Shuts down the whole cluster or part of it, depending on the selected
- // 'nodes'.
- virtual void ShutdownNodes(ClusterNodes nodes) = 0;
-
- virtual int num_masters() const = 0;
-
- virtual int num_tablet_servers() const = 0;
-
- // Create a client configured to talk to this cluster. 'builder' may contain
- // override options for the client. The master address will be overridden to
- // talk to the running master(s). If 'builder' is a nullptr, default options
- // will be used.
- //
- // REQUIRES: the cluster must have already been Start()ed.
- virtual Status CreateClient(client::KuduClientBuilder* builder,
- client::sp::shared_ptr<client::KuduClient>* client) const = 0;
-
- // Return a messenger for use by clients.
- virtual std::shared_ptr<rpc::Messenger> messenger() const = 0;
-
- // If the cluster is configured for a single non-distributed master,
- // return a proxy to that master. Requires that the single master is
- // running.
- virtual std::shared_ptr<master::MasterServiceProxy> master_proxy() const = 0;
-
- // Returns an RPC proxy to the master at 'idx'. Requires that the
- // master at 'idx' is running.
- virtual std::shared_ptr<master::MasterServiceProxy> master_proxy(int idx) const = 0;
-};
-
-} // namespace kudu
http://git-wip-us.apache.org/repos/asf/kudu/blob/bbed78cb/src/kudu/integration-tests/test_workload.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/test_workload.cc b/src/kudu/integration-tests/test_workload.cc
index 402809f..37959a3 100644
--- a/src/kudu/integration-tests/test_workload.cc
+++ b/src/kudu/integration-tests/test_workload.cc
@@ -47,7 +47,7 @@ using client::sp::shared_ptr;
const char* const TestWorkload::kDefaultTableName = "test-workload";
-TestWorkload::TestWorkload(MiniClusterBase* cluster)
+TestWorkload::TestWorkload(MiniCluster* cluster)
: cluster_(cluster),
rng_(SeedRandom()),
num_write_threads_(4),
http://git-wip-us.apache.org/repos/asf/kudu/blob/bbed78cb/src/kudu/integration-tests/test_workload.h
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/test_workload.h b/src/kudu/integration-tests/test_workload.h
index a500165..6b0a1ea 100644
--- a/src/kudu/integration-tests/test_workload.h
+++ b/src/kudu/integration-tests/test_workload.h
@@ -34,7 +34,7 @@
namespace kudu {
-class MiniClusterBase;
+class MiniCluster;
// Utility class for generating a workload against a test cluster.
//
@@ -50,7 +50,7 @@ class TestWorkload {
public:
static const char* const kDefaultTableName;
- explicit TestWorkload(MiniClusterBase* cluster);
+ explicit TestWorkload(MiniCluster* cluster);
~TestWorkload();
void set_payload_bytes(int n) {
@@ -204,7 +204,7 @@ class TestWorkload {
void WriteThread();
void ReadThread();
- MiniClusterBase* cluster_;
+ MiniCluster* cluster_;
client::KuduClientBuilder client_builder_;
client::sp::shared_ptr<client::KuduClient> client_;
ThreadSafeRandom rng_;