From b15d5425b9ca5ee1ed3de747838f49b811a0b154 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Wed, 13 Oct 2010 21:36:51 +0000 Subject: [PATCH] Needed to change the zk port elsewhere too to make default 21818 rather than 21810; and still further places git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1022300 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/hadoop/hbase/client/HConnectionManager.java | 2 ++ .../apache/hadoop/hbase/zookeeper/TestHQuorumPeer.java | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java b/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java index fbffd0bccc0..d07201c8d46 100644 --- a/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java +++ b/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java @@ -634,6 +634,8 @@ public class HConnectionManager { try { // locate the root or meta region metaLocation = locateRegion(parentTable, metaKey); + // If null still, go around again. + if (metaLocation == null) continue; HRegionInterface server = getHRegionConnection(metaLocation.getServerAddress()); diff --git a/src/test/java/org/apache/hadoop/hbase/zookeeper/TestHQuorumPeer.java b/src/test/java/org/apache/hadoop/hbase/zookeeper/TestHQuorumPeer.java index e2f97d7a965..1ffa70460ca 100644 --- a/src/test/java/org/apache/hadoop/hbase/zookeeper/TestHQuorumPeer.java +++ b/src/test/java/org/apache/hadoop/hbase/zookeeper/TestHQuorumPeer.java @@ -44,13 +44,14 @@ import static org.junit.Assert.*; */ public class TestHQuorumPeer { private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static int PORT_NO = 21818; private Path dataDir; @Before public void setup() throws IOException { // Set it to a non-standard port. TEST_UTIL.getConfiguration().setInt("hbase.zookeeper.property.clientPort", - 21818); + PORT_NO); this.dataDir = HBaseTestingUtility.getTestDir(this.getClass().getName()); FileSystem fs = FileSystem.get(TEST_UTIL.getConfiguration()); if (fs.exists(this.dataDir)) { @@ -68,7 +69,7 @@ public class TestHQuorumPeer { conf.set("hbase.zookeeper.property.dataDir", this.dataDir.toString()); Properties properties = ZKConfig.makeZKProps(conf); assertEquals(dataDir.toString(), (String)properties.get("dataDir")); - assertEquals(Integer.valueOf(21810), + assertEquals(Integer.valueOf(PORT_NO), Integer.valueOf(properties.getProperty("clientPort"))); assertEquals("localhost:2888:3888", properties.get("server.0")); assertEquals(null, properties.get("server.1")); @@ -77,7 +78,8 @@ public class TestHQuorumPeer { conf.set(HConstants.ZOOKEEPER_QUORUM, "a.foo.bar,b.foo.bar,c.foo.bar"); properties = ZKConfig.makeZKProps(conf); assertEquals(dataDir.toString(), properties.get("dataDir")); - assertEquals(Integer.valueOf(21810), Integer.valueOf(properties.getProperty("clientPort"))); + assertEquals(Integer.valueOf(PORT_NO), + Integer.valueOf(properties.getProperty("clientPort"))); assertEquals("a.foo.bar:2888:3888", properties.get("server.0")); assertEquals("b.foo.bar:2888:3888", properties.get("server.1")); assertEquals("c.foo.bar:2888:3888", properties.get("server.2"));