From f0e0f6c8a79080ae68d43db91f695a6f27f25b36 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Wed, 3 Nov 2010 22:45:59 +0000 Subject: [PATCH] HBASE-2828 HTable unnecessarily coupled with HMaster -- Added comment that we do not want dependency on Master git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1030745 13f79535-47bb-0310-9956-ffa450edef68 --- pom.xml | 1 + src/main/java/org/apache/hadoop/hbase/client/HTable.java | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index d5162e7e195..9655223f47c 100644 --- a/pom.xml +++ b/pom.xml @@ -261,6 +261,7 @@ generate-html + generate-pdf pre-site diff --git a/src/main/java/org/apache/hadoop/hbase/client/HTable.java b/src/main/java/org/apache/hadoop/hbase/client/HTable.java index 9060536732c..69dc91634f2 100644 --- a/src/main/java/org/apache/hadoop/hbase/client/HTable.java +++ b/src/main/java/org/apache/hadoop/hbase/client/HTable.java @@ -197,13 +197,13 @@ public class HTable implements HTableInterface { } /** - * TODO Might want to change this to public, would be nice if the number - * of threads would automatically change when servers were added and removed * @return the number of region servers that are currently running * @throws IOException if a remote or network exception occurs */ - int getCurrentNrHRS() throws IOException { + public int getCurrentNrHRS() throws IOException { try { + // We go to zk rather than to master to get count of regions to avoid + // HTable having a Master dependency. See HBase-2828 return ZKUtil.getNumberOfChildren(this.connection.getZooKeeperWatcher(), this.connection.getZooKeeperWatcher().rsZNode); } catch (KeeperException ke) {