hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jg...@apache.org
Subject svn commit: r1028911 - in /hbase/trunk: CHANGES.txt src/main/java/org/apache/hadoop/hbase/master/HMaster.java src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWatcher.java
Date Fri, 29 Oct 2010 21:32:11 GMT
Author: jgray
Date: Fri Oct 29 21:32:11 2010
New Revision: 1028911

URL: http://svn.apache.org/viewvc?rev=1028911&view=rev
Log:
HBASE-3172 Reverse order of AssignmentManager and MetaNodeTracker in ZooKeeperWatcher

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWatcher.java

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1028911&r1=1028910&r2=1028911&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Fri Oct 29 21:32:11 2010
@@ -624,6 +624,8 @@ Release 0.21.0 - Unreleased
                and assorted fixes around this + TestRollingRestart added
    HBASE-3160  Use more intelligent priorities for PriorityCompactionQueue
                (Nicolas Spiegelberg via Stack)
+   HBASE-3172  Reverse order of AssignmentManager and MetaNodeTracker in
+               ZooKeeperWatcher
 
 
   IMPROVEMENTS

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/HMaster.java?rev=1028911&r1=1028910&r2=1028911&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/HMaster.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/HMaster.java Fri Oct 29 21:32:11
2010
@@ -342,7 +342,7 @@ implements HMasterInterface, HMasterRegi
 
     this.assignmentManager = new AssignmentManager(this, serverManager,
       this.catalogTracker, this.executorService);
-    zooKeeper.registerListener(assignmentManager);
+    zooKeeper.registerListenerFirst(assignmentManager);
 
     this.regionServerTracker = new RegionServerTracker(zooKeeper, this,
       this.serverManager);

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWatcher.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWatcher.java?rev=1028911&r1=1028910&r2=1028911&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWatcher.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWatcher.java Fri
Oct 29 21:32:11 2010
@@ -21,8 +21,9 @@ package org.apache.hadoop.hbase.zookeepe
 
 import java.io.IOException;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
-import java.util.concurrent.CopyOnWriteArraySet;
+import java.util.concurrent.CopyOnWriteArrayList;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -64,8 +65,8 @@ public class ZooKeeperWatcher implements
   private Abortable abortable;
 
   // listeners to be notified
-  private final Set<ZooKeeperListener> listeners =
-    new CopyOnWriteArraySet<ZooKeeperListener>();
+  private final List<ZooKeeperListener> listeners =
+    new CopyOnWriteArrayList<ZooKeeperListener>();
 
   // set of unassigned nodes watched
   private Set<String> unassignedNodes = new HashSet<String>();
@@ -201,6 +202,15 @@ public class ZooKeeperWatcher implements
   }
 
   /**
+   * Register the specified listener to receive ZooKeeper events and add it as
+   * the first in the list of current listeners.
+   * @param listener
+   */
+  public void registerListenerFirst(ZooKeeperListener listener) {
+    listeners.add(0, listener);
+  }
+
+  /**
    * Get the connection to ZooKeeper.
    * @return connection reference to zookeeper
    */



Mime
View raw message