hadoop-zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject svn commit: r786156 [2/2] - in /hadoop/zookeeper/trunk: ./ src/java/main/org/apache/zookeeper/ src/java/main/org/apache/zookeeper/server/ src/java/main/org/apache/zookeeper/server/persistence/ src/java/main/org/apache/zookeeper/server/quorum/ src/java/...
Date Thu, 18 Jun 2009 16:37:50 GMT
Modified: hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/LETest.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/LETest.java?rev=786156&r1=786155&r2=786156&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/LETest.java (original)
+++ hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/LETest.java Thu Jun 18
16:37:49 2009
@@ -34,7 +34,7 @@
 public class LETest extends TestCase {
     volatile Vote votes[];
     volatile boolean leaderDies;
-    volatile long leader = -1; 
+    volatile long leader = -1;
     Random rand = new Random();
     class LEThread extends Thread {
         LeaderElection le;
@@ -59,7 +59,7 @@
                                 System.out.println("Leader " + i + " dying");
                                 leader = -2;
                             } else {
-                                leader = i; 
+                                leader = i;
                             }
                             LETest.this.notifyAll();
                         }
@@ -92,8 +92,8 @@
         votes = new Vote[count];
         for(int i = 0; i < count; i++) {
             peers.put(Long.valueOf(i), new QuorumServer(i, new InetSocketAddress("127.0.0.1",
baseport+100+i)));
-            tmpdir[i] = File.createTempFile("letest", "test");
-            port[i] = baseport+i;    
+            tmpdir[i] = ClientBase.createTmpDir();
+            port[i] = baseport+i;
         }
         LeaderElection le[] = new LeaderElection[count];
         leaderDies = true;

Modified: hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/PurgeTxnTest.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/PurgeTxnTest.java?rev=786156&r1=786155&r2=786156&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/PurgeTxnTest.java (original)
+++ hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/PurgeTxnTest.java Thu Jun
18 16:37:49 2009
@@ -52,7 +52,7 @@
         File tmpDir = ClientBase.createTmpDir();
         ClientBase.setupTestEnv();
         zks = new ZooKeeperServer(tmpDir, tmpDir, 3000);
-        SyncRequestProcessor.snapCount = 100;
+        SyncRequestProcessor.setSnapCount(100);
         final int PORT = Integer.parseInt(HOSTPORT.split(":")[1]);
         NIOServerCnxn.Factory f = new NIOServerCnxn.Factory(PORT);
         f.startup(zks);

Modified: hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/QuorumBase.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/QuorumBase.java?rev=786156&r1=786155&r2=786156&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/QuorumBase.java (original)
+++ hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/QuorumBase.java Thu Jun
18 16:37:49 2009
@@ -34,18 +34,15 @@
 public class QuorumBase extends ClientBase {
     private static final Logger LOG = Logger.getLogger(QuorumBase.class);
 
-
-
     File s1dir, s2dir, s3dir, s4dir, s5dir;
     QuorumPeer s1, s2, s3, s4, s5;
 
     protected void setUp() throws Exception {
         LOG.info("STARTING " + getName());
+        setupTestEnv();
 
         JMXEnv.setUp();
 
-        setupTestEnv();
-
         hostPort = "127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183,127.0.0.1:2184,127.0.0.1:2185";
 
         s1dir = ClientBase.createTmpDir();
@@ -108,11 +105,11 @@
         // make sure we have these 5 servers listed
         Set<String> ensureNames = new LinkedHashSet<String>();
         for (int i = 1; i <= 5; i++) {
-            ensureNames.add("InMemoryDataTree"); 
+            ensureNames.add("InMemoryDataTree");
         }
         for (int i = 1; i <= 5; i++) {
             ensureNames.add("name0=ReplicatedServer_id" + i
-                 + ",name1=replica." + i + ",name2="); 
+                 + ",name1=replica." + i + ",name2=");
         }
         for (int i = 1; i <= 5; i++) {
             for (int j = 1; j <= 5; j++) {
@@ -121,7 +118,7 @@
             }
         }
         for (int i = 1; i <= 5; i++) {
-            ensureNames.add("name0=ReplicatedServer_id" + i); 
+            ensureNames.add("name0=ReplicatedServer_id" + i);
         }
         JMXEnv.ensureAll(ensureNames.toArray(new String[ensureNames.size()]));
     }
@@ -144,7 +141,7 @@
         }
 
         JMXEnv.tearDown();
-        
+
         LOG.info("FINISHED " + getName());
     }
 

Modified: hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/RecoveryTest.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/RecoveryTest.java?rev=786156&r1=786155&r2=786156&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/RecoveryTest.java (original)
+++ hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/RecoveryTest.java Thu Jun
18 16:37:49 2009
@@ -74,8 +74,8 @@
         ClientBase.setupTestEnv();
         ZooKeeperServer zs = new ZooKeeperServer(tmpDir, tmpDir, 3000);
 
-        int oldSnapCount = SyncRequestProcessor.snapCount;
-        SyncRequestProcessor.snapCount = 1000;
+        int oldSnapCount = SyncRequestProcessor.getSnapCount();
+        SyncRequestProcessor.setSnapCount(1000);
         try {
             final int PORT = Integer.parseInt(HOSTPORT.split(":")[1]);
             NIOServerCnxn.Factory f = new NIOServerCnxn.Factory(PORT);
@@ -190,7 +190,7 @@
                        ClientBase.waitForServerDown(HOSTPORT,
                                                     CONNECTION_TIMEOUT));
         } finally {
-            SyncRequestProcessor.snapCount = oldSnapCount;
+            SyncRequestProcessor.setSnapCount(oldSnapCount);
         }
     }
 

Modified: hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/UpgradeTest.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/UpgradeTest.java?rev=786156&r1=786155&r2=786156&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/UpgradeTest.java (original)
+++ hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/UpgradeTest.java Thu Jun
18 16:37:49 2009
@@ -66,7 +66,7 @@
         UpgradeMain upgrade = new UpgradeMain(upgradeDir, upgradeDir);
         upgrade.runUpgrade();
         zks = new ZooKeeperServer(upgradeDir, upgradeDir, 3000);
-        SyncRequestProcessor.snapCount = 1000;
+        SyncRequestProcessor.setSnapCount(1000);
         final int PORT = Integer.parseInt(HOSTPORT.split(":")[1]);
         NIOServerCnxn.Factory f = new NIOServerCnxn.Factory(PORT);
         f.startup(zks);

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=786156&r1=786155&r2=786156&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 Thu Jun
18 16:37:49 2009
@@ -198,13 +198,13 @@
 
     @Test
     public void testWatcherAutoResetDisabledWithGlobal() throws Exception {
-        ClientCnxn.disableAutoWatchReset = true;
+        ClientCnxn.setDisableAutoResetWatch(true);
         testWatcherAutoResetWithGlobal();
     }
 
     @Test
     public void testWatcherAutoResetDisabledWithLocal() throws Exception {
-        ClientCnxn.disableAutoWatchReset = true;
+        ClientCnxn.setDisableAutoResetWatch(true);
         testWatcherAutoResetWithLocal();
     }
 
@@ -231,7 +231,7 @@
         localWatcher.waitForDisconnected(500);
         startServer();
         globalWatcher.waitForConnected(3000);
-        if (!isGlobal && !ClientCnxn.disableAutoWatchReset) {
+        if (!isGlobal && !ClientCnxn.getDisableAutoResetWatch()) {
             localWatcher.waitForConnected(500);
         }
 
@@ -241,7 +241,7 @@
                 CreateMode.PERSISTENT);
 
         WatchedEvent e = localWatcher.events.poll(10, TimeUnit.SECONDS);
-        if (!ClientCnxn.disableAutoWatchReset) {
+        if (!ClientCnxn.getDisableAutoResetWatch()) {
             assertEquals(e.getPath(), EventType.NodeDataChanged, e.getType());
             assertEquals("/watchtest/child", e.getPath());
         } else {
@@ -249,7 +249,7 @@
         }
 
         e = localWatcher.events.poll(10, TimeUnit.SECONDS);
-        if (!ClientCnxn.disableAutoWatchReset) {
+        if (!ClientCnxn.getDisableAutoResetWatch()) {
             // The create will trigger the get children and the exist
             // watches
             assertEquals(EventType.NodeCreated, e.getType());
@@ -259,7 +259,7 @@
         }
 
         e = localWatcher.events.poll(10, TimeUnit.SECONDS);
-        if (!ClientCnxn.disableAutoWatchReset) {
+        if (!ClientCnxn.getDisableAutoResetWatch()) {
             assertEquals(EventType.NodeChildrenChanged, e.getType());
             assertEquals("/watchtest", e.getPath());
         } else {
@@ -275,11 +275,11 @@
         try {
         try {
             localWatcher.waitForDisconnected(500);
-            if (!isGlobal && !ClientCnxn.disableAutoWatchReset) {
+            if (!isGlobal && !ClientCnxn.getDisableAutoResetWatch()) {
                 fail("Got an event when I shouldn't have");
             }
         } catch(TimeoutException toe) {
-            if (ClientCnxn.disableAutoWatchReset) {
+            if (ClientCnxn.getDisableAutoResetWatch()) {
                 fail("Didn't get an event when I should have");
             }
             // Else what we are expecting since there are no outstanding watches
@@ -320,7 +320,7 @@
         localWatcher.waitForDisconnected(500);
         startServer();
         globalWatcher.waitForConnected(3000);
-        if (!isGlobal && !ClientCnxn.disableAutoWatchReset) {
+        if (!isGlobal && !ClientCnxn.getDisableAutoResetWatch()) {
             localWatcher.waitForConnected(500);
         }
 
@@ -328,7 +328,7 @@
         zk.delete("/watchtest", -1);
 
         e = localWatcher.events.poll(10, TimeUnit.SECONDS);
-        if (!ClientCnxn.disableAutoWatchReset) {
+        if (!ClientCnxn.getDisableAutoResetWatch()) {
             assertEquals(EventType.NodeDeleted, e.getType());
             assertEquals("/watchtest/child", e.getPath());
         } else {



Mime
View raw message