accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1449730 - /accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/recovery/RecoverLease.java
Date Mon, 25 Feb 2013 14:49:40 GMT
Author: ecn
Date: Mon Feb 25 14:49:40 2013
New Revision: 1449730

URL: http://svn.apache.org/r1449730
Log:
ACCUMULO-1053 allow I/O exceptions to propagate out to FATE

Modified:
    accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/recovery/RecoverLease.java

Modified: accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/recovery/RecoverLease.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/recovery/RecoverLease.java?rev=1449730&r1=1449729&r2=1449730&view=diff
==============================================================================
--- accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/recovery/RecoverLease.java
(original)
+++ accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/recovery/RecoverLease.java
Mon Feb 25 14:49:40 2013
@@ -16,8 +16,6 @@
  */
 package org.apache.accumulo.server.master.recovery;
 
-import java.io.IOException;
-
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.fate.Repo;
@@ -71,31 +69,22 @@ public class RecoverLease extends Master
     if (fs instanceof TraceFileSystem)
       fs = ((TraceFileSystem) fs).getImplementation();
     
-    try {
-      if (fs instanceof DistributedFileSystem) {
-        DistributedFileSystem dfs = (DistributedFileSystem) fs;
-        if (!dfs.recoverLease(source)) {
-          log.info("Waiting for file to be closed " + source.toString());
-          return 1000;
-        }
-        log.info("Recovered lease on " + source.toString());
-        return 0;
-      } else if (fs instanceof LocalFileSystem) {
-        // ignore
-      } else {
-        throw new IllegalStateException("Don't know how to recover a lease for "  + fs.getClass().getName());

+    if (fs instanceof DistributedFileSystem) {
+      DistributedFileSystem dfs = (DistributedFileSystem) fs;
+      if (!dfs.recoverLease(source)) {
+        log.info("Waiting for file to be closed " + source.toString());
+        return 1000;
       }
-    } catch (IOException ex) {
-      log.error("error recovering lease ", ex);
-    }
-    try {
-      fs.append(source).close();
-      log.info("Recovered lease on " + source.toString() + " using append");
+      log.info("Recovered lease on " + source.toString());
       return 0;
-    } catch (IOException ex) {
-      log.error("error recovering lease using append", ex);
-      return 1000;
+    } else if (fs instanceof LocalFileSystem) {
+      // ignore
+    } else {
+      throw new IllegalStateException("Don't know how to recover a lease for "  + fs.getClass().getName());

     }
+    fs.append(source).close();
+    log.info("Recovered lease on " + source.toString() + " using append");
+    return 0;
   }
   
   @Override



Mime
View raw message