You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ec...@apache.org on 2015/09/22 21:32:28 UTC
[3/5] accumulo git commit: Merge branch '1.7'
Merge branch '1.7'
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/035b540d
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/035b540d
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/035b540d
Branch: refs/heads/master
Commit: 035b540d812aa53a445078c876c4e195c126dc0c
Parents: 4dee3c1 1fa8ab9
Author: Eric C. Newton <er...@gmail.com>
Authored: Tue Sep 22 13:45:27 2015 -0400
Committer: Eric C. Newton <er...@gmail.com>
Committed: Tue Sep 22 13:45:27 2015 -0400
----------------------------------------------------------------------
.../org/apache/accumulo/tserver/tablet/Compactor.java | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/035b540d/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Compactor.java
----------------------------------------------------------------------
diff --cc server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Compactor.java
index 4c55db9,bd5ff62..d705a39
--- 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
@@@ -217,13 -217,30 +217,22 @@@ public class Compactor implements Calla
FileSKVWriter mfwTmp = mfw;
mfw = null; // set this to null so we do not try to close it again in finally if the close fails
- mfwTmp.close(); // if the close fails it will cause the compaction to fail
+ try {
+ 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;
+ }
- // Verify the file, since hadoop 0.20.2 sometimes lies about the success of close()
- try {
- FileSKVIterator openReader = fileFactory.openReader(outputFile.path().toString(), false, ns, ns.getConf(), acuTableConf);
- openReader.close();
- } catch (IOException ex) {
- log.error("Verification of successful compaction fails!!! " + extent + " " + outputFile, ex);
- throw ex;
- }
-
- log.debug(String.format("Compaction %s %,d read | %,d written | %,6d entries/sec | %6.3f secs", extent, majCStats.getEntriesRead(),
- majCStats.getEntriesWritten(), (int) (majCStats.getEntriesRead() / ((t2 - t1) / 1000.0)), (t2 - t1) / 1000.0));
+ log.debug(String.format("Compaction %s %,d read | %,d written | %,6d entries/sec | %,6.3f secs | %,12d bytes | %9.3f byte/sec", extent,
+ majCStats.getEntriesRead(), majCStats.getEntriesWritten(), (int) (majCStats.getEntriesRead() / ((t2 - t1) / 1000.0)), (t2 - t1) / 1000.0,
+ mfwTmp.getLength(), mfwTmp.getLength() / ((t2 - t1) / 1000.0)));
- majCStats.setFileSize(fileFactory.getFileSize(outputFile.path().toString(), ns, ns.getConf(), acuTableConf));
+ majCStats.setFileSize(mfwTmp.getLength());
return majCStats;
} catch (IOException e) {
log.error("{}", e.getMessage(), e);