hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r956745 - in /hbase/branches/0.89.20100621: ./ src/main/java/org/apache/hadoop/hbase/client/ src/main/java/org/apache/hadoop/hbase/master/ src/main/java/org/apache/hadoop/hbase/regionserver/ src/main/java/org/apache/hadoop/hbase/zookeeper/ ...
Date Tue, 22 Jun 2010 00:18:10 GMT
Author: todd
Date: Tue Jun 22 00:18:09 2010
New Revision: 956745

URL: http://svn.apache.org/viewvc?rev=956745&view=rev
Log:
Revert "HBASE-2735  Make HBASE-2694 replication-friendly"

Modified:
    hbase/branches/0.89.20100621/CHANGES.txt
    hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
    hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
    hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java
    hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/master/RegionManager.java
    hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/master/ZKUnassignedWatcher.java
    hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
    hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/regionserver/RSZookeeperUpdater.java
    hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java
    hbase/branches/0.89.20100621/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
    hbase/branches/0.89.20100621/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java

Modified: hbase/branches/0.89.20100621/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.89.20100621/CHANGES.txt?rev=956745&r1=956744&r2=956745&view=diff
==============================================================================
--- hbase/branches/0.89.20100621/CHANGES.txt (original)
+++ hbase/branches/0.89.20100621/CHANGES.txt Tue Jun 22 00:18:09 2010
@@ -1,4 +1,9 @@
 HBase Change Log
+
+Development Release 0.89.20100621
+  All of 0.21.0 below, plus the following patches for stabilization:
+
+
 Release 0.21.0 - Unreleased
   INCOMPATIBLE CHANGES
    HBASE-1822  Remove the deprecated APIs
@@ -716,7 +721,6 @@ Release 0.21.0 - Unreleased
    HBASE-2726  Region Server should never abort without an informative log
                message
    HBASE-2724  Update to new release of Guava library
-   HBASE-2735  Make HBASE-2694 replication-friendly
    HBASE-2683  Make it obvious in the documentation that ZooKeeper needs 
                permanent storage
 

Modified: hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java?rev=956745&r1=956744&r2=956745&view=diff
==============================================================================
--- hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
(original)
+++ hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
Tue Jun 22 00:18:09 2010
@@ -228,8 +228,9 @@ public class HConnectionManager {
      */
     public synchronized ZooKeeperWrapper getZooKeeperWrapper() throws IOException {
       if(zooKeeperWrapper == null) {
-        zooKeeperWrapper =
-            ZooKeeperWrapper.createInstance(conf, HConnectionManager.class.getName());
+        String zkWrapperName = HConnectionManager.class.getName() + "-" + 
+                               ZooKeeperWrapper.getZookeeperClusterKey(conf);
+        zooKeeperWrapper = ZooKeeperWrapper.createInstance(conf, zkWrapperName);
         zooKeeperWrapper.registerListener(this);
       }
       return zooKeeperWrapper;

Modified: hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/master/HMaster.java?rev=956745&r1=956744&r2=956745&view=diff
==============================================================================
--- hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
(original)
+++ hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
Tue Jun 22 00:18:09 2010
@@ -206,8 +206,7 @@ public class HMaster extends Thread impl
     // We'll succeed if we are only  master or if we win the race when many
     // masters.  Otherwise we park here inside in writeAddressToZooKeeper.
     // TODO: Bring up the UI to redirect to active Master.
-    zooKeeperWrapper =
-        ZooKeeperWrapper.createInstance(conf, HMaster.class.getName());
+    zooKeeperWrapper = ZooKeeperWrapper.createInstance(conf, HMaster.class.getName());
     zooKeeperWrapper.registerListener(this);
     this.zkMasterAddressWatcher =
       new ZKMasterAddressWatcher(this.zooKeeperWrapper, this.shutdownRequested);
@@ -222,7 +221,7 @@ public class HMaster extends Thread impl
     // Start the unassigned watcher - which will create the unassgined region 
     // in ZK. This is needed before RegionManager() constructor tries to assign 
     // the root region.
-    ZKUnassignedWatcher.start(this.conf);
+    ZKUnassignedWatcher.start();
     // init the various event handlers
     HBaseEventHandler.init(serverManager);
     // start the "close region" executor service
@@ -1149,8 +1148,7 @@ public class HMaster extends Thread impl
 
       zooKeeperWrapper.close();
       try {
-        zooKeeperWrapper =
-            ZooKeeperWrapper.createInstance(conf, HMaster.class.getName());
+        zooKeeperWrapper = ZooKeeperWrapper.createInstance(conf, HMaster.class.getName());
         zooKeeperWrapper.registerListener(this);
         this.zkMasterAddressWatcher.setZookeeper(zooKeeperWrapper);
         if(!this.zkMasterAddressWatcher.

Modified: hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java?rev=956745&r1=956744&r2=956745&view=diff
==============================================================================
--- hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java
(original)
+++ hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java
Tue Jun 22 00:18:09 2010
@@ -115,9 +115,7 @@ public class ProcessRegionOpen extends P
       } else {
         master.getRegionManager().removeRegion(regionInfo);
       }
-      ZooKeeperWrapper zkWrapper =
-          ZooKeeperWrapper.getInstance(master.getConfiguration(),
-              HMaster.class.getName());
+      ZooKeeperWrapper zkWrapper = ZooKeeperWrapper.getInstance(HMaster.class.getName());
       zkWrapper.deleteUnassignedRegion(regionInfo.getEncodedName());
       return true;
     }

Modified: hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/master/RegionManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/master/RegionManager.java?rev=956745&r1=956744&r2=956745&view=diff
==============================================================================
--- hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/master/RegionManager.java
(original)
+++ hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/master/RegionManager.java
Tue Jun 22 00:18:09 2010
@@ -136,8 +136,7 @@ public class RegionManager {
     Configuration conf = master.getConfiguration();
 
     this.master = master;
-    this.zkWrapper =
-        ZooKeeperWrapper.getInstance(conf, HMaster.class.getName());
+    this.zkWrapper = ZooKeeperWrapper.getInstance(HMaster.class.getName());
     this.maxAssignInOneGo = conf.getInt("hbase.regions.percheckin", 10);
     this.loadBalancer = new LoadBalancer(conf);
 

Modified: hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/master/ZKUnassignedWatcher.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/master/ZKUnassignedWatcher.java?rev=956745&r1=956744&r2=956745&view=diff
==============================================================================
--- hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/master/ZKUnassignedWatcher.java
(original)
+++ hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/master/ZKUnassignedWatcher.java
Tue Jun 22 00:18:09 2010
@@ -24,7 +24,6 @@ import java.util.List;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.executor.HBaseEventHandler.HBaseEventType;
 import org.apache.hadoop.hbase.master.handler.MasterCloseRegionHandler;
 import org.apache.hadoop.hbase.master.handler.MasterOpenRegionHandler;
@@ -40,17 +39,21 @@ import org.apache.zookeeper.Watcher.Even
  */
 public class ZKUnassignedWatcher implements Watcher {
   private static final Log LOG = LogFactory.getLog(ZKUnassignedWatcher.class);
+  
+  // TODO: Start move this to HConstants
+  static final String ROOT_TABLE_NAME_STR = "-ROOT-";
+  static final String META_TABLE_NAME_STR = ".META.";
+  // TODO: End move this to HConstants
 
   private ZooKeeperWrapper zkWrapper = null;
 
-  public static void start(Configuration conf) throws IOException {
-    new ZKUnassignedWatcher(conf);
+  public static void start() throws IOException {
+    new ZKUnassignedWatcher();
     LOG.debug("Started ZKUnassigned watcher");
   }
 
-  public ZKUnassignedWatcher(Configuration conf) throws IOException {
-    zkWrapper =
-        ZooKeeperWrapper.getInstance(conf, HMaster.class.getName());
+  public ZKUnassignedWatcher() throws IOException {
+    zkWrapper = ZooKeeperWrapper.getInstance(HMaster.class.getName());
     // If the UNASSIGNED ZNode does not exist, create it.
     zkWrapper.createZNodeIfNotExists(zkWrapper.getRegionInTransitionZNode());
     // TODO: get the outstanding changes in UNASSIGNED

Modified: hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java?rev=956745&r1=956744&r2=956745&view=diff
==============================================================================
--- hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
(original)
+++ hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Tue Jun 22 00:18:09 2010
@@ -321,8 +321,7 @@ public class HRegionServer implements HR
   }
 
   private void reinitializeZooKeeper() throws IOException {
-    zooKeeperWrapper =
-        ZooKeeperWrapper.createInstance(conf, serverInfo.getServerName());
+    zooKeeperWrapper = ZooKeeperWrapper.createInstance(conf, serverInfo.getServerName());
     zooKeeperWrapper.registerListener(this);
     watchMasterAddress();
   }
@@ -1406,8 +1405,7 @@ public class HRegionServer implements HR
     Integer mapKey = Bytes.mapKey(regionInfo.getRegionName());
     HRegion region = this.onlineRegions.get(mapKey);
     RSZookeeperUpdater zkUpdater = 
-      new RSZookeeperUpdater(conf, serverInfo.getServerName(),
-          regionInfo.getEncodedName());
+      new RSZookeeperUpdater(serverInfo.getServerName(), regionInfo.getEncodedName());
     if (region == null) {
       try {
         zkUpdater.startRegionOpenEvent(null, true);
@@ -1491,8 +1489,7 @@ public class HRegionServer implements HR
   throws IOException {
     RSZookeeperUpdater zkUpdater = null;
     if(reportWhenCompleted) {
-      zkUpdater = new RSZookeeperUpdater(conf,
-          serverInfo.getServerName(), hri.getEncodedName());
+      zkUpdater = new RSZookeeperUpdater(serverInfo.getServerName(), hri.getEncodedName());
       zkUpdater.startRegionCloseEvent(null, false);
     }
     HRegion region = this.removeFromOnlineRegions(hri);

Modified: hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/regionserver/RSZookeeperUpdater.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/regionserver/RSZookeeperUpdater.java?rev=956745&r1=956744&r2=956745&view=diff
==============================================================================
--- hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/regionserver/RSZookeeperUpdater.java
(original)
+++ hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/regionserver/RSZookeeperUpdater.java
Tue Jun 22 00:18:09 2010
@@ -6,8 +6,6 @@ import java.io.IOException;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HMsg;
 import org.apache.hadoop.hbase.executor.RegionTransitionEventData;
 import org.apache.hadoop.hbase.executor.HBaseEventHandler;
@@ -37,14 +35,12 @@ public class RSZookeeperUpdater {
   private int zkVersion = 0;
   HBaseEventType lastUpdatedState;
 
-  public RSZookeeperUpdater(Configuration conf,
-                            String regionServerName, String regionName) {
-    this(conf, regionServerName, regionName, 0);
+  public RSZookeeperUpdater(String regionServerName, String regionName) {
+    this(regionServerName, regionName, 0);
   }
   
-  public RSZookeeperUpdater(Configuration conf, String regionServerName,
-                            String regionName, int zkVersion) {
-    this.zkWrapper = ZooKeeperWrapper.getInstance(conf, regionServerName);
+  public RSZookeeperUpdater(String regionServerName, String regionName, int zkVersion) {
+    this.zkWrapper = ZooKeeperWrapper.getInstance(regionServerName);
     this.regionServerName = regionServerName;
     this.regionName = regionName;
     // get the region ZNode we have to create

Modified: hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java?rev=956745&r1=956744&r2=956745&view=diff
==============================================================================
--- hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java
(original)
+++ hbase/branches/0.89.20100621/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java
Tue Jun 22 00:18:09 2010
@@ -137,22 +137,20 @@ public class ZooKeeperWrapper implements
   private List<Watcher> listeners = Collections.synchronizedList(new ArrayList<Watcher>());
 
   // return the singleton given the name of the instance
-  public static ZooKeeperWrapper getInstance(Configuration conf, String name) {
-    name = getZookeeperClusterKey(conf, name);
+  public static ZooKeeperWrapper getInstance(String name) {
     return INSTANCES.get(name);
   }
   // creates only one instance
   public static ZooKeeperWrapper createInstance(Configuration conf, String name) {
-    if (getInstance(conf, name) != null) {
-      return getInstance(conf, name);
+    if (getInstance(name) != null) {
+      return getInstance(name);
     }
     ZooKeeperWrapper.createLock.lock();
     try {
-      if (getInstance(conf, name) == null) {
+      if (getInstance(name) == null) {
         try {
-          String fullname = getZookeeperClusterKey(conf, name);
-          ZooKeeperWrapper instance = new ZooKeeperWrapper(conf, fullname);
-          INSTANCES.put(fullname, instance);
+          ZooKeeperWrapper instance = new ZooKeeperWrapper(conf, name);
+          INSTANCES.put(name, instance);
         }
         catch (Exception e) {
           LOG.error("<" + name + ">" + "Error creating a ZooKeeperWrapper " + e);
@@ -162,7 +160,7 @@ public class ZooKeeperWrapper implements
     finally {
       createLock.unlock();
     }
-    return getInstance(conf, name);
+    return getInstance(name);
   }
 
   /**
@@ -824,25 +822,13 @@ public class ZooKeeperWrapper implements
   }
 
   /**
-   * List all znodes in the specified path
-   * @param znode path to list
-   * @return a list of all the znodes
-   */
-  public List<String> listZnodes(String znode) {
-    return listZnodes(znode, this);
-  }
-
-  /**
    * List all znodes in the specified path and set a watcher on each
    * @param znode path to list
    * @param watcher watch to set, can be null
    * @return a list of all the znodes
    */
-  public List<String> listZnodes(String znode, Watcher watcher) {
+  public List<String> listZnodes(String znode) {
     List<String> nodes = null;
-    if (watcher == null) {
-      watcher = this;
-    }
     try {
       if (checkExistenceOf(znode)) {
         nodes = zooKeeper.getChildren(znode, this);
@@ -921,34 +907,9 @@ public class ZooKeeperWrapper implements
     }
   }
 
-  /**
-   * Get the key to the ZK ensemble for this configuration without
-   * adding a name at the end
-   * @param conf Configuration to use to build the key
-   * @return ensemble key without a name
-   */
   public static String getZookeeperClusterKey(Configuration conf) {
-    return getZookeeperClusterKey(conf, null);
-  }
-
-  /**
-   * Get the key to the ZK ensemble for this configuration and append
-   * a name at the end
-   * @param conf Configuration to use to build the key
-   * @param name Name that should be appended at the end if not empty or null
-   * @return ensemble key with a name (if any)
-   */
-  public static String getZookeeperClusterKey(Configuration conf, String name) {
-    String quorum = conf.get(HConstants.ZOOKEEPER_QUORUM.replaceAll(
-        "[\\t\\n\\x0B\\f\\r]", ""));
-    StringBuilder builder = new StringBuilder(quorum);
-    builder.append(":");
-    builder.append(conf.get(HConstants.ZOOKEEPER_ZNODE_PARENT));
-    if (name != null && !name.isEmpty()) {
-      builder.append(",");
-      builder.append(name);
-    }
-    return builder.toString();
+    return (conf.get(HConstants.ZOOKEEPER_QUORUM)
+            + ":" + conf.get(HConstants.ZOOKEEPER_ZNODE_PARENT));
   }
 
   /**

Modified: hbase/branches/0.89.20100621/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89.20100621/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java?rev=956745&r1=956744&r2=956745&view=diff
==============================================================================
--- hbase/branches/0.89.20100621/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
(original)
+++ hbase/branches/0.89.20100621/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
Tue Jun 22 00:18:09 2010
@@ -706,9 +706,7 @@ public class HBaseTestingUtility {
   }
 
   public void expireSession(ZooKeeperWrapper nodeZK) throws Exception{
-    ZooKeeperWrapper zkw =
-        ZooKeeperWrapper.createInstance(conf,
-            ZooKeeperWrapper.class.getName());
+    ZooKeeperWrapper zkw = ZooKeeperWrapper.createInstance(conf, ZooKeeperWrapper.class.getName());
     zkw.registerListener(EmptyWatcher.instance);
     String quorumServers = zkw.getQuorumServers();
     int sessionTimeout = 5 * 1000; // 5 seconds

Modified: hbase/branches/0.89.20100621/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89.20100621/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java?rev=956745&r1=956744&r2=956745&view=diff
==============================================================================
--- hbase/branches/0.89.20100621/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java
(original)
+++ hbase/branches/0.89.20100621/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java
Tue Jun 22 00:18:09 2010
@@ -91,8 +91,7 @@ public class TestZooKeeper {
       throws IOException, InterruptedException {
     new HTable(conf, HConstants.META_TABLE_NAME);
 
-    ZooKeeperWrapper zkw =
-        ZooKeeperWrapper.createInstance(conf, TestZooKeeper.class.getName());
+    ZooKeeperWrapper zkw = ZooKeeperWrapper.createInstance(conf, TestZooKeeper.class.getName());
     zkw.registerListener(EmptyWatcher.instance);
     String quorumServers = zkw.getQuorumServers();
     int sessionTimeout = 5 * 1000; // 5 seconds
@@ -179,8 +178,7 @@ public class TestZooKeeper {
    */
   @Test
   public void testZNodeDeletes() throws Exception {
-    ZooKeeperWrapper zkw =
-        ZooKeeperWrapper.createInstance(conf, TestZooKeeper.class.getName());
+    ZooKeeperWrapper zkw = ZooKeeperWrapper.createInstance(conf, TestZooKeeper.class.getName());
     zkw.registerListener(EmptyWatcher.instance);
     zkw.ensureExists("/l1/l2/l3/l4");
     try {



Mime
View raw message