hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1097284 - in /hbase/trunk/src: main/java/org/apache/hadoop/hbase/coprocessor/ main/java/org/apache/hadoop/hbase/master/ test/java/org/apache/hadoop/hbase/master/
Date Wed, 27 Apr 2011 23:43:45 GMT
Author: stack
Date: Wed Apr 27 23:43:45 2011
New Revision: 1097284

URL: http://svn.apache.org/viewvc?rev=1097284&view=rev
Log:
HBASE-1502 Remove need for heartbeats in HBase; fix broke build

Modified:
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseMasterObserver.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/ActiveMasterManager.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseMasterObserver.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseMasterObserver.java?rev=1097284&r1=1097283&r2=1097284&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseMasterObserver.java
(original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseMasterObserver.java
Wed Apr 27 23:43:45 2011
@@ -22,6 +22,7 @@ package org.apache.hadoop.hbase.coproces
 
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HRegionInfo;
+import org.apache.hadoop.hbase.HServerInfo;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.UnknownRegionException;
@@ -110,18 +111,6 @@ public class BaseMasterObserver implemen
   }
 
   @Override
-  public void preMove(ObserverContext<MasterCoprocessorEnvironment> ctx,
-      HRegionInfo region, HServerInfo srcServer, HServerInfo destServer)
-  throws UnknownRegionException {
-  }
-
-  @Override
-  public void postMove(ObserverContext<MasterCoprocessorEnvironment> ctx,
-      HRegionInfo region, HServerInfo srcServer, HServerInfo destServer)
-  throws UnknownRegionException {
-  }
-
-  @Override
   public void preAssign(ObserverContext<MasterCoprocessorEnvironment> ctx,
       byte[] regionName, boolean force) throws IOException {
   }
@@ -179,4 +168,16 @@ public class BaseMasterObserver implemen
   @Override
   public void stop(CoprocessorEnvironment ctx) throws IOException {
   }
+
+  @Override
+  public void preMove(ObserverContext<MasterCoprocessorEnvironment> ctx,
+      HRegionInfo region, ServerName srcServer, ServerName destServer)
+  throws UnknownRegionException {
+  }
+
+  @Override
+  public void postMove(ObserverContext<MasterCoprocessorEnvironment> ctx,
+      HRegionInfo region, ServerName srcServer, ServerName destServer)
+  throws UnknownRegionException {
+  }
 }

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/ActiveMasterManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/ActiveMasterManager.java?rev=1097284&r1=1097283&r2=1097284&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/ActiveMasterManager.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/ActiveMasterManager.java Wed
Apr 27 23:43:45 2011
@@ -187,7 +187,7 @@ class ActiveMasterManager extends ZooKee
         ZKUtil.getDataAndWatch(watcher, watcher.masterAddressZNode);
       // TODO: redo this to make it atomic (only added for tests)
       ServerName master = new ServerName(Bytes.toString(bytes));
-      if(master != null &&  master.equals(this.sn)) {
+      if (master != null &&  master.equals(this.sn)) {
         ZKUtil.deleteNode(watcher, watcher.masterAddressZNode);
       }
     } catch (KeeperException e) {

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java?rev=1097284&r1=1097283&r2=1097284&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java Wed Apr
27 23:43:45 2011
@@ -243,7 +243,8 @@ public class AssignmentManager extends Z
     processRegionsInTransition();
   }
 
-  public void processRegionsInTransition() throws KeeperException, IOException {
+  public void processRegionsInTransition()
+  throws KeeperException, IOException, InterruptedException {
     List<String> nodes = ZKUtil.listChildrenAndWatchForNewChildren(watcher,
       watcher.assignmentZNode);
     // Run through all regions.  If they are not assigned and not in RIT, then
@@ -265,7 +266,6 @@ public class AssignmentManager extends Z
     // If we found user regions out on cluster, its a failover.
     if (userRegionsOutOnCluster) {
       LOG.info("Found regions out on cluster or in RIT; failover");
-      processDeadServers(deadServers);
       if (!nodes.isEmpty()) {
         for (String encodedRegionName: nodes) {
           processRegionInTransition(encodedRegionName, null);
@@ -417,7 +417,7 @@ public class AssignmentManager extends Z
       boolean lateEvent = data.getStamp() <
           (System.currentTimeMillis() - 15000);
       LOG.debug("Handling transition=" + data.getEventType() +
-        ", server=" + data.getServerName() + ", region=" +
+        ", server=" + data.getOrigin() + ", region=" +
           prettyPrintedRegionName +
           (lateEvent? ", which is more than 15 seconds late" : ""));
       RegionState regionState = regionsInTransition.get(encodedName);

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=1097284&r1=1097283&r2=1097284&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 Wed Apr 27 23:43:45
2011
@@ -86,7 +86,6 @@ import org.apache.hadoop.hbase.zookeeper
 import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
 import org.apache.hadoop.io.MapWritable;
 import org.apache.hadoop.io.Text;
-import org.apache.hadoop.ipc.RemoteException;
 import org.apache.hadoop.net.DNS;
 import org.apache.zookeeper.KeeperException;
 import org.apache.zookeeper.Watcher;
@@ -321,7 +320,9 @@ implements HMasterInterface, HMasterRegi
    * @throws InterruptedException
    */
   private boolean becomeActiveMaster() throws InterruptedException {
-    this.activeMasterManager = new ActiveMasterManager(zooKeeper, address,
+    // TODO: This is wrong!!!! Should have new servername if we restart ourselves,
+    // if we come back to life.
+    this.activeMasterManager = new ActiveMasterManager(zooKeeper, this.serverName,
         this);
     this.zooKeeper.registerListener(activeMasterManager);
     stallIfBackupMaster(this.conf, this.activeMasterManager);
@@ -355,7 +356,7 @@ implements HMasterInterface, HMasterRegi
     boolean wasUp = this.clusterStatusTracker.isClusterUp();
     if (!wasUp) this.clusterStatusTracker.setClusterUp();
 
-    LOG.info("Server active/primary master; " + this.address +
+    LOG.info("Server active/primary master; " + this.serverName +
         ", sessionid=0x" +
         Long.toHexString(this.zooKeeper.getZooKeeper().getSessionId()) +
         ", cluster-up flag was=" + wasUp);
@@ -1101,7 +1102,7 @@ implements HMasterInterface, HMasterRegi
   private boolean tryRecoveringExpiredZKSession() throws InterruptedException,
       IOException, KeeperException {
     this.zooKeeper = new ZooKeeperWatcher(conf, MASTER + ":"
-        + address.getPort(), this);
+        + this.serverName.getPort(), this);
 
     if (!becomeActiveMaster()) {
       return false;

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java?rev=1097284&r1=1097283&r2=1097284&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java
(original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java
Wed Apr 27 23:43:45 2011
@@ -275,7 +275,7 @@ public class TestZKBasedOpenCloseRegion 
 
     // now ask the master to move the region to hr1, will fail
     TEST_UTIL.getHBaseAdmin().move(hri.getEncodedNameAsBytes(),
-        Bytes.toBytes(hr1.getServerName()));
+        Bytes.toBytes(hr1.getServerName().toString()));
 
     while (!reopenEventProcessed.get()) {
       Threads.sleep(100);
@@ -290,7 +290,7 @@ public class TestZKBasedOpenCloseRegion 
 
     // move the region again, but this time it will work
     TEST_UTIL.getHBaseAdmin().move(hri.getEncodedNameAsBytes(),
-        Bytes.toBytes(hr1.getServerName()));
+        Bytes.toBytes(hr1.getServerName().toString()));
 
     while (!reopenEventProcessed.get()) {
       Threads.sleep(100);



Mime
View raw message