accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject [4/5] accumulo git commit: ACCUMULO-4008 remove the file if it fails to close cleanly
Date Tue, 22 Sep 2015 19:32:29 GMT
ACCUMULO-4008 remove the file if it fails to close cleanly


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/758abd65
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/758abd65
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/758abd65

Branch: refs/heads/master
Commit: 758abd6518958c6c7ef22f06e23e41113007200b
Parents: 035b540
Author: Eric C. Newton <eric.newton@gmail.com>
Authored: Tue Sep 22 14:59:07 2015 -0400
Committer: Eric C. Newton <eric.newton@gmail.com>
Committed: Tue Sep 22 14:59:07 2015 -0400

----------------------------------------------------------------------
 .../org/apache/accumulo/tserver/tablet/Compactor.java | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/758abd65/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Compactor.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Compactor.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Compactor.java
index d705a39..88b73fe 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Compactor.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Compactor.java
@@ -218,14 +218,14 @@ public class Compactor implements Callable<CompactionStats> {
       FileSKVWriter mfwTmp = mfw;
       mfw = null; // set this to null so we do not try to close it again in finally if the
close fails
       try {
-    	  mfwTmp.close(); // if the close fails it will cause the compaction to fail
+        mfwTmp.close(); // if the close fails it will cause the compaction to fail
       } catch (IOException ex) {
-    	  if (!fs.deleteRecursively(outputFile.path())) {
-              if (fs.exists(outputFile.path())) {
-                log.error("Unable to delete " + outputFile);
-              }
-    	  }
-    	  throw ex;
+        if (!fs.deleteRecursively(outputFile.path())) {
+          if (fs.exists(outputFile.path())) {
+            log.error("Unable to delete " + outputFile);
+          }
+        }
+        throw ex;
       }
 
       log.debug(String.format("Compaction %s %,d read | %,d written | %,6d entries/sec |
%,6.3f secs | %,12d bytes | %9.3f byte/sec", extent,


Mime
View raw message