You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ec...@apache.org on 2013/11/26 17:04:26 UTC

[03/10] git commit: ACCUMULO-1920 fix needs to be in 1.4 branch, too

ACCUMULO-1920 fix needs to be in 1.4 branch, too


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/51dd8050
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/51dd8050
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/51dd8050

Branch: refs/heads/1.6.0-SNAPSHOT
Commit: 51dd805097eeca9404b78e5b332c9aebb09c9ed4
Parents: 6446ad5
Author: Eric Newton <er...@gmail.com>
Authored: Tue Nov 26 11:03:23 2013 -0500
Committer: Eric Newton <er...@gmail.com>
Committed: Tue Nov 26 11:03:23 2013 -0500

----------------------------------------------------------------------
 .../accumulo/core/zookeeper/ZooSession.java     | 13 -----------
 .../apache/accumulo/server/monitor/Monitor.java | 24 ++++++++------------
 2 files changed, 10 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/51dd8050/src/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooSession.java
----------------------------------------------------------------------
diff --git a/src/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooSession.java b/src/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooSession.java
index 401be0a..b3db26f 100644
--- a/src/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooSession.java
+++ b/src/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooSession.java
@@ -18,10 +18,7 @@ package org.apache.accumulo.core.zookeeper;
 
 import java.io.IOException;
 import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.Collection;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Map;
 
 import org.apache.accumulo.core.util.UtilWaitThread;
@@ -52,17 +49,7 @@ class ZooSession {
   
   private static class AccumuloWatcher implements Watcher {
     
-    private HashSet<Watcher> watchers = new HashSet<Watcher>();
-    
     public void process(WatchedEvent event) {
-      // copy the watchers, in case the callback adds() more Watchers
-      // otherwise we get a ConcurrentModificationException
-      Collection<Watcher> watcherCopy = new ArrayList<Watcher>(watchers);
-      
-      for (Watcher watcher : watcherCopy) {
-        watcher.process(event);
-      }
-      
       if (event.getState() == KeeperState.Expired) {
         log.debug("Session expired, state of current session : " + event.getState());
       }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/51dd8050/src/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java
----------------------------------------------------------------------
diff --git a/src/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java b/src/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java
index 178d4f9..7a284f0 100644
--- a/src/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java
+++ b/src/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java
@@ -397,21 +397,17 @@ public class Monitor {
     try {
       // Read the gc location from its lock
       ZooReaderWriter zk = ZooReaderWriter.getInstance();
-      try {
-        String path = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZGC_LOCK;
-        List<String> locks = zk.getChildren(path, null);
-        if (locks != null && locks.size() > 0) {
-          Collections.sort(locks);
-          InetSocketAddress address = new ServerServices(new String(zk.getData(path + "/" + locks.get(0), null))).getAddress(Service.GC_CLIENT);
-          GCMonitorService.Iface client = ThriftUtil.getClient(new GCMonitorService.Client.Factory(), address, ServerConfiguration.getSystemConfiguration());
-          try {
-            result = client.getStatus(null, SecurityConstants.getSystemCredentials());
-          } finally {
-            ThriftUtil.returnClient(client);
-          }
+      String path = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZGC_LOCK;
+      List<String> locks = zk.getChildren(path, null);
+      if (locks != null && locks.size() > 0) {
+        Collections.sort(locks);
+        InetSocketAddress address = new ServerServices(new String(zk.getData(path + "/" + locks.get(0), null))).getAddress(Service.GC_CLIENT);
+        GCMonitorService.Iface client = ThriftUtil.getClient(new GCMonitorService.Client.Factory(), address, ServerConfiguration.getSystemConfiguration());
+        try {
+          result = client.getStatus(null, SecurityConstants.getSystemCredentials());
+        } finally {
+          ThriftUtil.returnClient(client);
         }
-      } finally {
-        zk.close();
       }
     } catch (Exception ex) {
       log.warn("Unable to contact the garbage collector", ex);