From 3f8eb6e0edec1b21a9c4025729d2bd6bdff90246 Mon Sep 17 00:00:00 2001 From: Jean-Daniel Cryans Date: Fri, 19 Nov 2010 22:21:09 +0000 Subject: [PATCH] HBASE-3231 Update to zookeeper 3.3.2. git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1037053 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 1 + .../org/apache/hadoop/hbase/zookeeper/HQuorumPeer.java | 2 +- .../apache/hadoop/hbase/zookeeper/TestHQuorumPeer.java | 9 +++++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 6583f97d06c..d7574289cd0 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1166,6 +1166,7 @@ Release 0.90.0 - Unreleased HBASE-3227 Edit of log messages before branching. HBASE-3230 Refresh our hadoop jar and update zookeeper to just-released 3.3.2 + HBASE-3231 Update to zookeeper 3.3.2. NEW FEATURES diff --git a/src/main/java/org/apache/hadoop/hbase/zookeeper/HQuorumPeer.java b/src/main/java/org/apache/hadoop/hbase/zookeeper/HQuorumPeer.java index b5f763f7b13..d0a0dbcac1d 100644 --- a/src/main/java/org/apache/hadoop/hbase/zookeeper/HQuorumPeer.java +++ b/src/main/java/org/apache/hadoop/hbase/zookeeper/HQuorumPeer.java @@ -83,7 +83,7 @@ public class HQuorumPeer { return address.equals("localhost") || address.equals("127.0.0.1"); } - private static void writeMyID(Properties properties) throws IOException { + static void writeMyID(Properties properties) throws IOException { long myId = -1; Configuration conf = HBaseConfiguration.create(); 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 1ffa70460ca..bc71e5f90a0 100644 --- a/src/test/java/org/apache/hadoop/hbase/zookeeper/TestHQuorumPeer.java +++ b/src/test/java/org/apache/hadoop/hbase/zookeeper/TestHQuorumPeer.java @@ -91,7 +91,11 @@ public class TestHQuorumPeer { String s = "dataDir=" + this.dataDir.toString() + "\n" + "clientPort=2181\n" + - "server.0=${hbase.master.hostname}:2888:3888\n"; + "initLimit=2\n" + + "syncLimit=2\n" + + "server.0=${hbase.master.hostname}:2888:3888\n" + + "server.1=server1:2888:3888\n" + + "server.2=server2:2888:3888\n"; System.setProperty("hbase.master.hostname", "localhost"); InputStream is = new ByteArrayInputStream(s.getBytes()); @@ -103,13 +107,14 @@ public class TestHQuorumPeer { Integer.valueOf(properties.getProperty("clientPort"))); assertEquals("localhost:2888:3888", properties.get("server.0")); + HQuorumPeer.writeMyID(properties); QuorumPeerConfig config = new QuorumPeerConfig(); config.parseProperties(properties); assertEquals(this.dataDir.toString(), config.getDataDir()); assertEquals(2181, config.getClientPortAddress().getPort()); Map servers = config.getServers(); - assertEquals(1, servers.size()); + assertEquals(3, servers.size()); assertTrue(servers.containsKey(Long.valueOf(0))); QuorumServer server = servers.get(Long.valueOf(0)); assertEquals("localhost", server.addr.getHostName());