Repository: hbase Updated Branches: refs/heads/0.98 7139c90e3 -> 6e6cf74c1
Amend HBASE-12795 Backport HBASE-12429 (Add port to ClusterManager's actions) to 0.98 Keep around methods in HBaseCluster and MiniHBaseCluster used by Apache Phoenix unit tests Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/6e6cf74c Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/6e6cf74c Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/6e6cf74c Branch: refs/heads/0.98 Commit: 6e6cf74c1161035545d95921816121eb3a516fe0 Parents: 7139c90 Author: Andrew Purtell <apurt...@apache.org> Authored: Mon Mar 2 19:00:10 2015 -0800 Committer: Andrew Purtell <apurt...@apache.org> Committed: Mon Mar 2 19:01:28 2015 -0800 ---------------------------------------------------------------------- .../org/apache/hadoop/hbase/HBaseCluster.java | 20 ++++++++++++++++++++ .../apache/hadoop/hbase/MiniHBaseCluster.java | 5 +++++ 2 files changed, 25 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/6e6cf74c/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseCluster.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseCluster.java index b5f2485..c6bb25d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseCluster.java @@ -139,6 +139,26 @@ public abstract class HBaseCluster implements Closeable, Configurable { * @return whether the operation finished with success * @throws IOException if something goes wrong or timeout occurs */ + @Deprecated + public void waitForRegionServerToStart(String hostname, long timeout) throws IOException { + long start = System.currentTimeMillis(); + while ((System.currentTimeMillis() - start) < timeout) { + for (ServerName server : getClusterStatus().getServers()) { + if (server.getHostname().equals(hostname)) { + return; + } + } + Threads.sleep(100); + } + throw new IOException("did timeout " + timeout + "ms waiting for region server to start: " + + hostname); + } + + /** + * Wait for the specified region server to join the cluster + * @return whether the operation finished with success + * @throws IOException if something goes wrong or timeout occurs + */ public void waitForRegionServerToStart(String hostname, int port, long timeout) throws IOException { long start = System.currentTimeMillis(); http://git-wip-us.apache.org/repos/asf/hbase/blob/6e6cf74c/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java index 293d62e..bcb0841 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java @@ -232,6 +232,11 @@ public class MiniHBaseCluster extends HBaseCluster { } } + @Deprecated + public void startRegionServer(String hostname) throws IOException { + this.startRegionServer(); + } + @Override public void startRegionServer(String hostname, int port) throws IOException { this.startRegionServer();