From 42af3c756c4618ba706826c3dbfa6f8ad7d07985 Mon Sep 17 00:00:00 2001 From: Jean-Daniel Cryans Date: Wed, 3 Jun 2009 16:46:28 +0000 Subject: [PATCH] HBASE-1462 hclient still seems to depend on master git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@781468 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 1 + .../hadoop/hbase/client/HConnectionManager.java | 11 ++--------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index fe5c51b2efe..bc4d8326383 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -304,6 +304,7 @@ Release 0.20.0 - Unreleased in master and regionserver UIs HBASE-1448 Add a node in ZK to tell all masters to shutdown HBASE-1478 Remove hbase master options from shell (Nitay Joffe via Stack) + HBASE-1462 hclient still seems to depend on master OPTIMIZATIONS HBASE-1412 Change values for delete column and column family in KeyValue diff --git a/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java b/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java index 48143e9a039..2a657146349 100644 --- a/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java +++ b/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java @@ -328,7 +328,6 @@ public class HConnectionManager implements HConstants { public HRegionLocation getRegionLocation(final byte [] name, final byte [] row, boolean reload) throws IOException { - getMaster(); return reload? relocateRegion(name, row): locateRegion(name, row); } @@ -476,14 +475,12 @@ public class HConnectionManager implements HConstants { public HRegionLocation locateRegion(final byte [] tableName, final byte [] row) throws IOException{ - getMaster(); return locateRegion(tableName, row, true); } public HRegionLocation relocateRegion(final byte [] tableName, final byte [] row) throws IOException{ - getMaster(); return locateRegion(tableName, row, false); } @@ -795,7 +792,7 @@ public class HConnectionManager implements HConstants { public HRegionInterface getHRegionConnection( HServerAddress regionServer) throws IOException { - return getHRegionConnection(regionServer, true); + return getHRegionConnection(regionServer, false); } public synchronized ZooKeeperWrapper getZooKeeperWrapper() throws IOException { @@ -806,7 +803,7 @@ public class HConnectionManager implements HConstants { } /* - * Repeatedly try to find the root region by asking the master for where it is + * Repeatedly try to find the root region in ZK * @return HRegionLocation for root region if found * @throws NoServerForRegionException - if the root region can not be * located after retrying @@ -814,7 +811,6 @@ public class HConnectionManager implements HConstants { */ private HRegionLocation locateRootRegion() throws IOException { - getMaster(); // We lazily instantiate the ZooKeeper object because we don't want to // make the constructor have to throw IOException or handle it itself. @@ -901,7 +897,6 @@ public class HConnectionManager implements HConstants { public T getRegionServerWithRetries(ServerCallable callable) throws IOException, RuntimeException { - getMaster(); List exceptions = new ArrayList(); for(int tries = 0; tries < numRetries; tries++) { try { @@ -934,7 +929,6 @@ public class HConnectionManager implements HConstants { public T getRegionServerForWithoutRetries(ServerCallable callable) throws IOException, RuntimeException { - getMaster(); try { callable.instantiateServer(false); return callable.call(); @@ -957,7 +951,6 @@ public class HConnectionManager implements HConstants { boolean reload) throws IOException { boolean reloadFlag = reload; - getMaster(); List exceptions = new ArrayList(); HRegionLocation location = null; int tries = 0;