hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nspiegelb...@apache.org
Subject svn commit: r1202987 - /hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
Date Thu, 17 Nov 2011 01:45:48 GMT
Author: nspiegelberg
Date: Thu Nov 17 01:45:47 2011
New Revision: 1202987

URL: http://svn.apache.org/viewvc?rev=1202987&view=rev
Log:
fix TestRegionRebalancing

Summary: splitLog() should return success when region's logdire doesn't exist

Test Plan: TestRegionRebalancing now passes

Reviewers: kannan, nspiegelberg

Reviewed By: kannan

CC: hbase-eng@lists, kannan

Differential Revision: 354130

Task ID: 783061

Modified:
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/master/HMaster.java

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/master/HMaster.java?rev=1202987&r1=1202986&r2=1202987&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/master/HMaster.java (original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/master/HMaster.java Thu Nov
17 01:45:47 2011
@@ -965,6 +965,10 @@ public class HMaster extends Thread impl
     for (String serverName : serverNames) {
       Path logDir = new Path(this.rootdir,
           HLog.getHLogDirectoryName(serverName));
+      if (! fs.exists(logDir)) {
+        LOG.info("Log dir for server " + serverName + " does not exist");
+        continue;
+      }
       // rename the directory so a rogue RS doesn't create more HLogs
       if (!serverName.endsWith(HConstants.HLOG_SPLITTING_EXT)) {
         realServerNames.add(serverName);
@@ -986,6 +990,11 @@ public class HMaster extends Thread impl
       splitCount += contentSummary.getFileCount();
       splitLogSize += contentSummary.getSpaceConsumed();
     }
+    if (logDirs.size() == 0) {
+      LOG.info("No logs to split");
+      this.metrics.addSplit(0, 0, 0);
+      return;
+    }
     splitTime = EnvironmentEdgeManager.currentTimeMillis();
     if (distributedLogSplitting) {
       // handleDeadWorker() is also called in serverManager



Mime
View raw message