svn commit: r718269 - in /hadoop/zookeeper/trunk: CHANGES.txt conf/log4j.properties
Author: mahadev Date: Mon Nov 17 08:13:31 2008 New Revision: 718269 URL: http://svn.apache.org/viewvc?rev=718269&view=rev Log: ZOOKEEPER-223. change default level in root logger to INFO. (pat via mahadev) Modified: hadoop/zookeeper/trunk/CHANGES.txt hadoop/zookeeper/trunk/conf/log4j.properties Modified: hadoop/zookeeper/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/CHANGES.txt?rev=718269&r1=718268&r2=718269&view=diff == --- hadoop/zookeeper/trunk/CHANGES.txt (original) +++ hadoop/zookeeper/trunk/CHANGES.txt Mon Nov 17 08:13:31 2008 @@ -1,11 +1,12 @@ Trunk - + Non-backward compatible changes: Backward compatibile changes: - BUGFIXES: - +BUGFIXES: + ZOOKEEPER-223. change default level in root logger to INFO. (pat via +mahadev) Release 3.0.0 - 2008-10-21 Modified: hadoop/zookeeper/trunk/conf/log4j.properties URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/conf/log4j.properties?rev=718269&r1=718268&r2=718269&view=diff == --- hadoop/zookeeper/trunk/conf/log4j.properties (original) +++ hadoop/zookeeper/trunk/conf/log4j.properties Mon Nov 17 08:13:31 2008 @@ -5,7 +5,7 @@ # Format is " (, )+ # DEFAULT: console appender only -log4j.rootLogger=DEBUG, CONSOLE +log4j.rootLogger=INFO, CONSOLE # Example with rolling log file #log4j.rootLogger=DEBUG, CONSOLE, ROLLINGFILE
svn commit: r718314 - in /hadoop/zookeeper/branches/branch-3.0: CHANGES.txt conf/log4j.properties
Author: mahadev Date: Mon Nov 17 10:31:14 2008 New Revision: 718314 URL: http://svn.apache.org/viewvc?rev=718314&view=rev Log: ZOOKEEPER-223. change default level in root logger to INFO. (pat via mahadev) Modified: hadoop/zookeeper/branches/branch-3.0/CHANGES.txt hadoop/zookeeper/branches/branch-3.0/conf/log4j.properties Modified: hadoop/zookeeper/branches/branch-3.0/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/zookeeper/branches/branch-3.0/CHANGES.txt?rev=718314&r1=718313&r2=718314&view=diff == --- hadoop/zookeeper/branches/branch-3.0/CHANGES.txt (original) +++ hadoop/zookeeper/branches/branch-3.0/CHANGES.txt Mon Nov 17 10:31:14 2008 @@ -1,3 +1,14 @@ +Trunk + +Non-backward compatible changes: + +Backward compatibile changes: + +BUGFIXES: + ZOOKEEPER-223. change default level in root logger to INFO. (pat via +mahadev) + + Release 3.0.0 - 2008-10-21 Non-backward compatible changes: Modified: hadoop/zookeeper/branches/branch-3.0/conf/log4j.properties URL: http://svn.apache.org/viewvc/hadoop/zookeeper/branches/branch-3.0/conf/log4j.properties?rev=718314&r1=718313&r2=718314&view=diff == --- hadoop/zookeeper/branches/branch-3.0/conf/log4j.properties (original) +++ hadoop/zookeeper/branches/branch-3.0/conf/log4j.properties Mon Nov 17 10:31:14 2008 @@ -5,7 +5,7 @@ # Format is " (, )+ # DEFAULT: console appender only -log4j.rootLogger=DEBUG, CONSOLE +log4j.rootLogger=INFO, CONSOLE # Example with rolling log file #log4j.rootLogger=DEBUG, CONSOLE, ROLLINGFILE
svn commit: r718433 - in /hadoop/zookeeper/trunk: CHANGES.txt src/java/main/org/apache/zookeeper/server/SyncRequestProcessor.java src/java/test/org/apache/zookeeper/test/DBSizeTest.java
Author: mahadev Date: Mon Nov 17 15:18:47 2008 New Revision: 718433 URL: http://svn.apache.org/viewvc?rev=718433&view=rev Log: ZOOKEEPER-212. fix the snapshot to be asynchronous. (mahadev and ben) Added: hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/DBSizeTest.java Modified: hadoop/zookeeper/trunk/CHANGES.txt hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/SyncRequestProcessor.java Modified: hadoop/zookeeper/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/CHANGES.txt?rev=718433&r1=718432&r2=718433&view=diff == --- hadoop/zookeeper/trunk/CHANGES.txt (original) +++ hadoop/zookeeper/trunk/CHANGES.txt Mon Nov 17 15:18:47 2008 @@ -7,7 +7,8 @@ BUGFIXES: ZOOKEEPER-223. change default level in root logger to INFO. (pat via mahadev) - + + ZOOKEEPER-212. fix the snapshot to be asynchronous. (mahadev and ben) Release 3.0.0 - 2008-10-21 Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/SyncRequestProcessor.java URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/SyncRequestProcessor.java?rev=718433&r1=718432&r2=718433&view=diff == --- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/SyncRequestProcessor.java (original) +++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/SyncRequestProcessor.java Mon Nov 17 15:18:47 2008 @@ -37,6 +37,8 @@ private LinkedBlockingQueue queuedRequests = new LinkedBlockingQueue(); private RequestProcessor nextProcessor; boolean timeToDie = false; +Thread snapInProcess = null; + /** * Transactions that have been written and are waiting to be flushed to * disk. Basically this is the list of SyncItems whose callbacks will be @@ -60,10 +62,6 @@ start(); } -private void startSnapshot() throws IOException { -zks.takeSnapshot(); -} - @Override public void run() { try { @@ -89,7 +87,21 @@ // roll the log zks.getLogWriter().rollLog(); // take a snapshot -startSnapshot(); +if (snapInProcess != null && snapInProcess.isAlive()) { +LOG.warn("Too busy to snap, skipping"); +} +else { +snapInProcess = new Thread("Snapshot Thread") { +public void run() { + try { + zks.takeSnapshot(); + } catch(Exception e) { + LOG.warn("Unexpected exception", e); + } +} +}; +snapInProcess.start(); +} logCount = 0; } toFlush.add(si); Added: hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/DBSizeTest.java URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/DBSizeTest.java?rev=718433&view=auto == --- hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/DBSizeTest.java (added) +++ hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/DBSizeTest.java Mon Nov 17 15:18:47 2008 @@ -0,0 +1,66 @@ +package org.apache.zookeeper.test; + +import java.io.IOException; + +import org.apache.zookeeper.AsyncCallback; +import org.apache.zookeeper.CreateMode; +import org.apache.zookeeper.KeeperException; +import org.apache.zookeeper.ZooKeeper; +import org.apache.zookeeper.ZooDefs.Ids; +import org.junit.Test; + +public class DBSizeTest extends ClientBase { +String snapCount; +@Override +protected void setUp() throws Exception { +// Change the snapcount to happen more often +snapCount = System.getProperty("zookeeper.snapCount", "1024"); +System.setProperty("zookeeper.snapCount", "10"); +super.setUp(); +} + + +@Override +protected void tearDown() throws Exception { +System.setProperty("zookeeper.snapCount", snapCount); +super.tearDown(); +} + + +// Test that the latency of requests doesn't increase with +// the size of the database +@Test +public void testDBScale() +throws IOException, InterruptedException, KeeperException +{ +String path = "/SIZE"; +byte data[] = new byte[1024]; +ZooKeeper zk = null; +try { +zk = creat
svn commit: r718434 - in /hadoop/zookeeper/branches/branch-3.0: CHANGES.txt src/java/main/org/apache/zookeeper/server/SyncRequestProcessor.java src/java/test/org/apache/zookeeper/test/DBSizeTest.java
Author: mahadev Date: Mon Nov 17 15:21:05 2008 New Revision: 718434 URL: http://svn.apache.org/viewvc?rev=718434&view=rev Log: ZOOKEEPER-212. fix the snapshot to be asynchronous. (mahadev and ben) Added: hadoop/zookeeper/branches/branch-3.0/src/java/test/org/apache/zookeeper/test/DBSizeTest.java Modified: hadoop/zookeeper/branches/branch-3.0/CHANGES.txt hadoop/zookeeper/branches/branch-3.0/src/java/main/org/apache/zookeeper/server/SyncRequestProcessor.java Modified: hadoop/zookeeper/branches/branch-3.0/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/zookeeper/branches/branch-3.0/CHANGES.txt?rev=718434&r1=718433&r2=718434&view=diff == --- hadoop/zookeeper/branches/branch-3.0/CHANGES.txt (original) +++ hadoop/zookeeper/branches/branch-3.0/CHANGES.txt Mon Nov 17 15:21:05 2008 @@ -7,7 +7,8 @@ BUGFIXES: ZOOKEEPER-223. change default level in root logger to INFO. (pat via mahadev) - + + ZOOKEEPER-212. fix the snapshot to be asynchronous. (mahadev and ben) Release 3.0.0 - 2008-10-21 Modified: hadoop/zookeeper/branches/branch-3.0/src/java/main/org/apache/zookeeper/server/SyncRequestProcessor.java URL: http://svn.apache.org/viewvc/hadoop/zookeeper/branches/branch-3.0/src/java/main/org/apache/zookeeper/server/SyncRequestProcessor.java?rev=718434&r1=718433&r2=718434&view=diff == --- hadoop/zookeeper/branches/branch-3.0/src/java/main/org/apache/zookeeper/server/SyncRequestProcessor.java (original) +++ hadoop/zookeeper/branches/branch-3.0/src/java/main/org/apache/zookeeper/server/SyncRequestProcessor.java Mon Nov 17 15:21:05 2008 @@ -37,6 +37,8 @@ private LinkedBlockingQueue queuedRequests = new LinkedBlockingQueue(); private RequestProcessor nextProcessor; boolean timeToDie = false; +Thread snapInProcess = null; + /** * Transactions that have been written and are waiting to be flushed to * disk. Basically this is the list of SyncItems whose callbacks will be @@ -60,10 +62,6 @@ start(); } -private void startSnapshot() throws IOException { -zks.takeSnapshot(); -} - @Override public void run() { try { @@ -89,7 +87,21 @@ // roll the log zks.getLogWriter().rollLog(); // take a snapshot -startSnapshot(); +if (snapInProcess != null && snapInProcess.isAlive()) { +LOG.warn("Too busy to snap, skipping"); +} +else { +snapInProcess = new Thread("Snapshot Thread") { +public void run() { + try { + zks.takeSnapshot(); + } catch(Exception e) { + LOG.warn("Unexpected exception", e); + } +} +}; +snapInProcess.start(); +} logCount = 0; } toFlush.add(si); Added: hadoop/zookeeper/branches/branch-3.0/src/java/test/org/apache/zookeeper/test/DBSizeTest.java URL: http://svn.apache.org/viewvc/hadoop/zookeeper/branches/branch-3.0/src/java/test/org/apache/zookeeper/test/DBSizeTest.java?rev=718434&view=auto == --- hadoop/zookeeper/branches/branch-3.0/src/java/test/org/apache/zookeeper/test/DBSizeTest.java (added) +++ hadoop/zookeeper/branches/branch-3.0/src/java/test/org/apache/zookeeper/test/DBSizeTest.java Mon Nov 17 15:21:05 2008 @@ -0,0 +1,66 @@ +package org.apache.zookeeper.test; + +import java.io.IOException; + +import org.apache.zookeeper.AsyncCallback; +import org.apache.zookeeper.CreateMode; +import org.apache.zookeeper.KeeperException; +import org.apache.zookeeper.ZooKeeper; +import org.apache.zookeeper.ZooDefs.Ids; +import org.junit.Test; + +public class DBSizeTest extends ClientBase { +String snapCount; +@Override +protected void setUp() throws Exception { +// Change the snapcount to happen more often +snapCount = System.getProperty("zookeeper.snapCount", "1024"); +System.setProperty("zookeeper.snapCount", "10"); +super.setUp(); +} + + +@Override +protected void tearDown() throws Exception { +System.setProperty("zookeeper.snapCount", snapCount); +super.tearDown(); +} + + +// Test that the latency of requests doesn't increase with +// the size of the database +@Test +public void testDBScale() +
svn commit: r718440 - in /hadoop/zookeeper/trunk: CHANGES.txt docs/zookeeperProgrammers.html docs/zookeeperProgrammers.pdf src/docs/src/documentation/content/xdocs/zookeeperProgrammers.xml
Author: mahadev Date: Mon Nov 17 15:48:37 2008 New Revision: 718440 URL: http://svn.apache.org/viewvc?rev=718440&view=rev Log: ZOOKEEPER-213. fix programmer guide C api docs to be in sync with latest zookeeper.h (pat via mahadev) Modified: hadoop/zookeeper/trunk/CHANGES.txt hadoop/zookeeper/trunk/docs/zookeeperProgrammers.html hadoop/zookeeper/trunk/docs/zookeeperProgrammers.pdf hadoop/zookeeper/trunk/src/docs/src/documentation/content/xdocs/zookeeperProgrammers.xml Modified: hadoop/zookeeper/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/CHANGES.txt?rev=718440&r1=718439&r2=718440&view=diff == --- hadoop/zookeeper/trunk/CHANGES.txt (original) +++ hadoop/zookeeper/trunk/CHANGES.txt Mon Nov 17 15:48:37 2008 @@ -10,6 +10,9 @@ ZOOKEEPER-212. fix the snapshot to be asynchronous. (mahadev and ben) + ZOOKEEPER-213. fix programmer guide C api docs to be in sync with latest +zookeeper.h (pat via mahadev) + Release 3.0.0 - 2008-10-21 Non-backward compatible changes: Modified: hadoop/zookeeper/trunk/docs/zookeeperProgrammers.html URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/docs/zookeeperProgrammers.html?rev=718440&r1=718439&r2=718440&view=diff == --- hadoop/zookeeper/trunk/docs/zookeeperProgrammers.html (original) +++ hadoop/zookeeper/trunk/docs/zookeeperProgrammers.html Mon Nov 17 15:48:37 2008 @@ -240,7 +240,7 @@ Builtin ACL Schemes -Zookeeper C client API +ZooKeeper C client API @@ -262,7 +262,7 @@ Installation -Using the Client +Using the C Client @@ -499,7 +499,7 @@ the watch and then clear the watch. When a watch triggers, ZooKeeper sends the client a notification. More information about watches can be found in the section - Zookeeper Watches. + ZooKeeper Watches. [tbd] @@ -926,12 +926,35 @@ ZooKeeper access control using ACLs -ZooKeeper uses ACLs to control access to its znodes (the data nodes of a ZooKeeper data tree). The ACL implementation is quite similar to UNIX file access permissions: it employs permission bits to allow/disallow various operations against a node and the scope to which the bits apply. Unlike standard UNIX permissions, a ZooKeeper node is not limited by the three standard scopes for user (owner of the file), group, and world (other). ZooKeeper does not have a notion of an owner of a znode. Instead, an ACL specifies sets of ids and permissions that are associated with those ids. -ZooKeeper supports pluggable authentication schemes. Ids are specified using the form scheme:id, where scheme is a the authentication scheme that the id corresponds to. For example, host:host1.corp.com is an id for a host named host1.corp.com. -When a client connects to ZooKeeper and authenticates itself, ZooKeeper associates all the ids that correspond to a client with the clients connection. These ids are checked against the ACLs of znodes when a clients tries to access a node. ACLs are made up of pairs of (scheme:expression, perms). The format of the expression is specific to the scheme. For example, the pair (ip:19.22.0.0/16, READ) gives the READ permission to any clients with an IP address that starts with 19.22. +ZooKeeper uses ACLs to control access to its znodes (the +data nodes of a ZooKeeper data tree). The ACL implementation is +quite similar to UNIX file access permissions: it employs +permission bits to allow/disallow various operations against a +node and the scope to which the bits apply. Unlike standard UNIX +permissions, a ZooKeeper node is not limited by the three standard +scopes for user (owner of the file), group, and world +(other). ZooKeeper does not have a notion of an owner of a +znode. Instead, an ACL specifies sets of ids and permissions that +are associated with those ids. +ZooKeeper supports pluggable authentication schemes. Ids are +specified using the form scheme:id, +where scheme is a the authentication scheme +that the id corresponds to. For +example, host:host1.corp.com is an id for a +host named host1.corp.com. +When a client connects to ZooKeeper and authenticates +itself, ZooKeeper associates all the ids that correspond to a +client with the clients connection. These ids are checked against +the ACLs of znodes when a clients tries to access a node. ACLs are +made up of pairs of (scheme:expression, +perms). The format of +the expression is specific to the scheme. For +example, the pair (ip:19.22.0.0/16, READ) +gives the READ permission to any clients with +an IP address that starts with 19.22. ACL Permissions -Zookeeper supports the following permissions: +ZooKeeper supports the following permissions: @@ -960,11 +983,31 @@ -
svn commit: r718441 - in /hadoop/zookeeper/branches/branch-3.0: CHANGES.txt docs/zookeeperProgrammers.html docs/zookeeperProgrammers.pdf src/docs/src/documentation/content/xdocs/zookeeperProgrammers.x
Author: mahadev Date: Mon Nov 17 15:50:50 2008 New Revision: 718441 URL: http://svn.apache.org/viewvc?rev=718441&view=rev Log: ZOOKEEPER-213. fix programmer guide C api docs to be in sync with latest zookeeper.h (pat via mahadev) Modified: hadoop/zookeeper/branches/branch-3.0/CHANGES.txt hadoop/zookeeper/branches/branch-3.0/docs/zookeeperProgrammers.html hadoop/zookeeper/branches/branch-3.0/docs/zookeeperProgrammers.pdf hadoop/zookeeper/branches/branch-3.0/src/docs/src/documentation/content/xdocs/zookeeperProgrammers.xml Modified: hadoop/zookeeper/branches/branch-3.0/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/zookeeper/branches/branch-3.0/CHANGES.txt?rev=718441&r1=718440&r2=718441&view=diff == --- hadoop/zookeeper/branches/branch-3.0/CHANGES.txt (original) +++ hadoop/zookeeper/branches/branch-3.0/CHANGES.txt Mon Nov 17 15:50:50 2008 @@ -10,6 +10,9 @@ ZOOKEEPER-212. fix the snapshot to be asynchronous. (mahadev and ben) + ZOOKEEPER-213. fix programmer guide C api docs to be in sync with latest +zookeeper.h (pat via mahadev) + Release 3.0.0 - 2008-10-21 Non-backward compatible changes: Modified: hadoop/zookeeper/branches/branch-3.0/docs/zookeeperProgrammers.html URL: http://svn.apache.org/viewvc/hadoop/zookeeper/branches/branch-3.0/docs/zookeeperProgrammers.html?rev=718441&r1=718440&r2=718441&view=diff == --- hadoop/zookeeper/branches/branch-3.0/docs/zookeeperProgrammers.html (original) +++ hadoop/zookeeper/branches/branch-3.0/docs/zookeeperProgrammers.html Mon Nov 17 15:50:50 2008 @@ -240,7 +240,7 @@ Builtin ACL Schemes -Zookeeper C client API +ZooKeeper C client API @@ -262,7 +262,7 @@ Installation -Using the Client +Using the C Client @@ -499,7 +499,7 @@ the watch and then clear the watch. When a watch triggers, ZooKeeper sends the client a notification. More information about watches can be found in the section - Zookeeper Watches. + ZooKeeper Watches. [tbd] @@ -926,12 +926,35 @@ ZooKeeper access control using ACLs -ZooKeeper uses ACLs to control access to its znodes (the data nodes of a ZooKeeper data tree). The ACL implementation is quite similar to UNIX file access permissions: it employs permission bits to allow/disallow various operations against a node and the scope to which the bits apply. Unlike standard UNIX permissions, a ZooKeeper node is not limited by the three standard scopes for user (owner of the file), group, and world (other). ZooKeeper does not have a notion of an owner of a znode. Instead, an ACL specifies sets of ids and permissions that are associated with those ids. -ZooKeeper supports pluggable authentication schemes. Ids are specified using the form scheme:id, where scheme is a the authentication scheme that the id corresponds to. For example, host:host1.corp.com is an id for a host named host1.corp.com. -When a client connects to ZooKeeper and authenticates itself, ZooKeeper associates all the ids that correspond to a client with the clients connection. These ids are checked against the ACLs of znodes when a clients tries to access a node. ACLs are made up of pairs of (scheme:expression, perms). The format of the expression is specific to the scheme. For example, the pair (ip:19.22.0.0/16, READ) gives the READ permission to any clients with an IP address that starts with 19.22. +ZooKeeper uses ACLs to control access to its znodes (the +data nodes of a ZooKeeper data tree). The ACL implementation is +quite similar to UNIX file access permissions: it employs +permission bits to allow/disallow various operations against a +node and the scope to which the bits apply. Unlike standard UNIX +permissions, a ZooKeeper node is not limited by the three standard +scopes for user (owner of the file), group, and world +(other). ZooKeeper does not have a notion of an owner of a +znode. Instead, an ACL specifies sets of ids and permissions that +are associated with those ids. +ZooKeeper supports pluggable authentication schemes. Ids are +specified using the form scheme:id, +where scheme is a the authentication scheme +that the id corresponds to. For +example, host:host1.corp.com is an id for a +host named host1.corp.com. +When a client connects to ZooKeeper and authenticates +itself, ZooKeeper associates all the ids that correspond to a +client with the clients connection. These ids are checked against +the ACLs of znodes when a clients tries to access a node. ACLs are +made up of pairs of (scheme:expression, +perms). The format of +the expression is specific to the scheme. For +example, the pair (ip:19.22.0.0/16, READ) +gives the READ permission to any clients with +an IP address that starts with
svn commit: r718445 - in /hadoop/zookeeper/trunk: CHANGES.txt src/java/test/org/apache/zookeeper/test/WatcherTest.java
Author: mahadev Date: Mon Nov 17 16:11:13 2008 New Revision: 718445 URL: http://svn.apache.org/viewvc?rev=718445&view=rev Log: ZOOKEEPER-219. fix events.poll timeout in watcher test to be longer. (pat via mahadev) Modified: hadoop/zookeeper/trunk/CHANGES.txt hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/WatcherTest.java Modified: hadoop/zookeeper/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/CHANGES.txt?rev=718445&r1=718444&r2=718445&view=diff == --- hadoop/zookeeper/trunk/CHANGES.txt (original) +++ hadoop/zookeeper/trunk/CHANGES.txt Mon Nov 17 16:11:13 2008 @@ -13,6 +13,9 @@ ZOOKEEPER-213. fix programmer guide C api docs to be in sync with latest zookeeper.h (pat via mahadev) + ZOOKEEPER-219. fix events.poll timeout in watcher test to be longer. (pat +via mahadev) + Release 3.0.0 - 2008-10-21 Non-backward compatible changes: Modified: hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/WatcherTest.java URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/WatcherTest.java?rev=718445&r1=718444&r2=718445&view=diff == --- hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/WatcherTest.java (original) +++ hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/WatcherTest.java Mon Nov 17 16:11:13 2008 @@ -61,7 +61,7 @@ * case verifies that we see all of the data events on a particular node. * There was a bug (ZOOKEEPER-137) that resulted in events being dropped * in some cases (timing). - * + * * @throws IOException * @throws InterruptedException * @throws KeeperException @@ -74,7 +74,7 @@ try { MyWatcher watcher = new MyWatcher(); zk = createClient(watcher, hostPort); - + StatCallback scb = new StatCallback() { public void processResult(int rc, String path, Object ctx, Stat stat) { @@ -86,20 +86,20 @@ // don't do anything } }; - + String names[] = new String[10]; for (int i = 0; i < names.length; i++) { String name = zk.create("/tc-", "initialvalue".getBytes(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT_SEQUENTIAL); names[i] = name; - + Stat stat = new Stat(); zk.getData(name, watcher, stat); zk.setData(name, "new".getBytes(), stat.getVersion(), scb, null); stat = zk.exists(name, watcher); zk.delete(name, stat.getVersion(), vcb, null); } - + for (int i = 0; i < names.length; i++) { String name = names[i]; WatchedEvent event = watcher.events.poll(10, TimeUnit.SECONDS); @@ -126,7 +126,7 @@ testWatcherAutoReset(zk, watcher, watcher); zk.close(); } - + @Test public void testWatcherAutoResetWithLocal() throws Exception { ZooKeeper zk = null; @@ -135,20 +135,20 @@ testWatcherAutoReset(zk, watcher, new MyWatcher()); zk.close(); } - + @Test public void testWatcherAutoResetDisabledWithGlobal() throws Exception { ClientCnxn.disableAutoWatchReset = true; testWatcherAutoResetWithGlobal(); } - + @Test public void testWatcherAutoResetDisabledWithLocal() throws Exception { ClientCnxn.disableAutoWatchReset = true; testWatcherAutoResetWithLocal(); } - -private void testWatcherAutoReset(ZooKeeper zk, MyWatcher globalWatcher, + +private void testWatcherAutoReset(ZooKeeper zk, MyWatcher globalWatcher, MyWatcher localWatcher) throws Exception { boolean isGlobal = (localWatcher == globalWatcher); // First test to see if the watch survives across reconnects @@ -163,9 +163,9 @@ zk.getData("/watchtest/child", localWatcher, new Stat()); zk.exists("/watchtest/child2", localWatcher); } - + assertTrue(localWatcher.events.isEmpty()); - + stopServer(); globalWatcher.waitForDisconnected(3000); localWatcher.waitForDisconnected(500); @@ -174,21 +174,21 @@ if (!isGlobal && !ClientCnxn.disableAutoWatchReset) { localWatcher.waitForConnected(500); } - + assertTrue(localWatcher.events.isEmpty()); zk.setData("/watchtest/child", new byte[1], -1); zk.create("/watchtest/child2", new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); - -WatchedEvent e = localWatcher.events.poll(1, TimeUnit.MILLISECONDS); + +Watc
svn commit: r718447 - in /hadoop/zookeeper/branches/branch-3.0: CHANGES.txt src/java/test/org/apache/zookeeper/test/WatcherTest.java
Author: mahadev Date: Mon Nov 17 16:12:23 2008 New Revision: 718447 URL: http://svn.apache.org/viewvc?rev=718447&view=rev Log: ZOOKEEPER-219. fix events.poll timeout in watcher test to be longer. (pat via mahadev) Modified: hadoop/zookeeper/branches/branch-3.0/CHANGES.txt hadoop/zookeeper/branches/branch-3.0/src/java/test/org/apache/zookeeper/test/WatcherTest.java Modified: hadoop/zookeeper/branches/branch-3.0/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/zookeeper/branches/branch-3.0/CHANGES.txt?rev=718447&r1=718446&r2=718447&view=diff == --- hadoop/zookeeper/branches/branch-3.0/CHANGES.txt (original) +++ hadoop/zookeeper/branches/branch-3.0/CHANGES.txt Mon Nov 17 16:12:23 2008 @@ -13,6 +13,9 @@ ZOOKEEPER-213. fix programmer guide C api docs to be in sync with latest zookeeper.h (pat via mahadev) + ZOOKEEPER-219. fix events.poll timeout in watcher test to be longer. (pat +via mahadev) + Release 3.0.0 - 2008-10-21 Non-backward compatible changes: Modified: hadoop/zookeeper/branches/branch-3.0/src/java/test/org/apache/zookeeper/test/WatcherTest.java URL: http://svn.apache.org/viewvc/hadoop/zookeeper/branches/branch-3.0/src/java/test/org/apache/zookeeper/test/WatcherTest.java?rev=718447&r1=718446&r2=718447&view=diff == --- hadoop/zookeeper/branches/branch-3.0/src/java/test/org/apache/zookeeper/test/WatcherTest.java (original) +++ hadoop/zookeeper/branches/branch-3.0/src/java/test/org/apache/zookeeper/test/WatcherTest.java Mon Nov 17 16:12:23 2008 @@ -61,7 +61,7 @@ * case verifies that we see all of the data events on a particular node. * There was a bug (ZOOKEEPER-137) that resulted in events being dropped * in some cases (timing). - * + * * @throws IOException * @throws InterruptedException * @throws KeeperException @@ -74,7 +74,7 @@ try { MyWatcher watcher = new MyWatcher(); zk = createClient(watcher, hostPort); - + StatCallback scb = new StatCallback() { public void processResult(int rc, String path, Object ctx, Stat stat) { @@ -86,20 +86,20 @@ // don't do anything } }; - + String names[] = new String[10]; for (int i = 0; i < names.length; i++) { String name = zk.create("/tc-", "initialvalue".getBytes(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT_SEQUENTIAL); names[i] = name; - + Stat stat = new Stat(); zk.getData(name, watcher, stat); zk.setData(name, "new".getBytes(), stat.getVersion(), scb, null); stat = zk.exists(name, watcher); zk.delete(name, stat.getVersion(), vcb, null); } - + for (int i = 0; i < names.length; i++) { String name = names[i]; WatchedEvent event = watcher.events.poll(10, TimeUnit.SECONDS); @@ -126,7 +126,7 @@ testWatcherAutoReset(zk, watcher, watcher); zk.close(); } - + @Test public void testWatcherAutoResetWithLocal() throws Exception { ZooKeeper zk = null; @@ -135,20 +135,20 @@ testWatcherAutoReset(zk, watcher, new MyWatcher()); zk.close(); } - + @Test public void testWatcherAutoResetDisabledWithGlobal() throws Exception { ClientCnxn.disableAutoWatchReset = true; testWatcherAutoResetWithGlobal(); } - + @Test public void testWatcherAutoResetDisabledWithLocal() throws Exception { ClientCnxn.disableAutoWatchReset = true; testWatcherAutoResetWithLocal(); } - -private void testWatcherAutoReset(ZooKeeper zk, MyWatcher globalWatcher, + +private void testWatcherAutoReset(ZooKeeper zk, MyWatcher globalWatcher, MyWatcher localWatcher) throws Exception { boolean isGlobal = (localWatcher == globalWatcher); // First test to see if the watch survives across reconnects @@ -163,9 +163,9 @@ zk.getData("/watchtest/child", localWatcher, new Stat()); zk.exists("/watchtest/child2", localWatcher); } - + assertTrue(localWatcher.events.isEmpty()); - + stopServer(); globalWatcher.waitForDisconnected(3000); localWatcher.waitForDisconnected(500); @@ -174,21 +174,21 @@ if (!isGlobal && !ClientCnxn.disableAutoWatchReset) { localWatcher.waitForConnected(500); } - + assertTrue(localWatcher.events.isEmpty()); zk.setData("/watchtest/child", new byte[1], -1); zk.create("/watchtest/child2", new byte[0], Ids.OPEN_ACL_UNSAFE,