hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1310922 - /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
Date Sat, 07 Apr 2012 23:32:15 GMT
Author: stack
Date: Sat Apr  7 23:32:14 2012
New Revision: 1310922

URL: http://svn.apache.org/viewvc?rev=1310922&view=rev
Log:
HBASE-5618 SplitLogManager - prevent unnecessary attempts to resubmits

Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java?rev=1310922&r1=1310921&r2=1310922&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
(original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
Sat Apr  7 23:32:14 2012
@@ -537,6 +537,7 @@ public class SplitLogManager extends Zoo
           version) == false) {
         LOG.debug("failed to resubmit task " + path +
             " version changed");
+        task.heartbeatNoDetails(EnvironmentEdgeManager.currentTimeMillis());
         return false;
       }
     } catch (NoNodeException e) {
@@ -544,6 +545,11 @@ public class SplitLogManager extends Zoo
           " task done (or forced done by removing the znode)");
       getDataSetWatchSuccess(path, null, Integer.MIN_VALUE);
       return false;
+    } catch (KeeperException.BadVersionException e) {
+      LOG.debug("failed to resubmit task " + path +
+          " version changed");
+      task.heartbeatNoDetails(EnvironmentEdgeManager.currentTimeMillis());
+      return false;
     } catch (KeeperException e) {
       tot_mgr_resubmit_failed.incrementAndGet();
       LOG.warn("failed to resubmit " + path, e);
@@ -714,7 +720,12 @@ public class SplitLogManager extends Zoo
 
   @Override
   public void nodeDataChanged(String path) {
-    if (tasks.get(path) != null || ZKSplitLog.isRescanNode(watcher, path)) {
+    Task task;
+    task = tasks.get(path);
+    if (task != null || ZKSplitLog.isRescanNode(watcher, path)) {
+      if (task != null) {
+        task.heartbeatNoDetails(EnvironmentEdgeManager.currentTimeMillis());
+      }
       getDataSetWatch(path, zkretries);
     }
   }
@@ -810,7 +821,11 @@ public class SplitLogManager extends Zoo
     }
 
     public boolean isUnassigned() {
-      return (last_update == -1);
+      return (cur_worker_name == null);
+    }
+
+    public void heartbeatNoDetails(long time) {
+      last_update = time;
     }
 
     public void heartbeat(long time, int version, String worker) {



Mime
View raw message