accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject [1/3] accumulo git commit: ACCUMULO-3462 ACCUMULO-3541 fixed compaction logging and state bug
Date Thu, 29 Jan 2015 22:15:16 GMT
Repository: accumulo
Updated Branches:
  refs/heads/1.6 abf0b9987 -> 837a0bdf9


ACCUMULO-3462 ACCUMULO-3541 fixed compaction logging and state bug


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

Branch: refs/heads/1.6
Commit: 8b54f13fd716fe167ceb4b1953188d406d0eaa5b
Parents: 145f83a
Author: Keith Turner <kturner@apache.org>
Authored: Thu Jan 29 10:49:31 2015 -0500
Committer: Keith Turner <kturner@apache.org>
Committed: Thu Jan 29 16:36:52 2015 -0500

----------------------------------------------------------------------
 .../accumulo/server/tabletserver/Tablet.java    | 33 +++++++++-----------
 1 file changed, 15 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/8b54f13f/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java b/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
index 96856ae..3e397dc 100644
--- a/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
+++ b/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
@@ -2916,8 +2916,14 @@ public class Tablet {
           if (reason == MajorCompactionReason.NORMAL && needsMajorCompaction(reason))
             initiateMajorCompaction(reason);
         }
-
-      } catch (RuntimeException E) {
+      } catch (CompactionCanceledException cce) {
+        log.debug("Major compaction canceled, extent = " + getExtent());
+        failed = true;
+      } catch (IOException ioe) {
+        log.error("MajC Failed, extent = " + getExtent(), ioe);
+        failed = true;
+      } catch (RuntimeException e) {
+        log.error("MajC Unexpected exception, extent = " + getExtent(), e);
         failed = true;
       } finally {
         long count = 0;
@@ -3419,8 +3425,7 @@ public class Tablet {
    * Performs a major compaction on the tablet. If needsSplit() returns true, the tablet
is split and a reference to the new tablet is returned.
    */
 
-  private CompactionStats majorCompact(MajorCompactionReason reason) {
-
+  private CompactionStats majorCompact(MajorCompactionReason reason) throws IOException,
CompactionCanceledException {
     CompactionStats majCStats = null;
 
     synchronized (this) {
@@ -3438,20 +3443,13 @@ public class Tablet {
 
     try {
       // Always trace majC
-      Trace.on("majorCompaction");
+      span = Trace.on("majorCompaction");
 
       majCStats = _majorCompact(reason);
       if (reason == MajorCompactionReason.CHOP) {
         MetadataTable.chopped(getExtent(), this.tabletServer.getLock());
         tabletServer.enqueueMasterMessage(new TabletStatusMessage(TabletLoadState.CHOPPED,
extent));
       }
-    } catch (CompactionCanceledException mcce) {
-      log.debug("Major compaction canceled, extent = " + getExtent());
-      throw new RuntimeException(mcce);
-    } catch (Throwable t) {
-      log.error("MajC Failed, extent = " + getExtent());
-      log.error("MajC Failed, message = " + (t.getMessage() == null ? t.getClass().getName()
: t.getMessage()), t);
-      throw new RuntimeException(t);
     } finally {
       // ensure we always reset boolean, even
       // when an exception is thrown
@@ -3460,13 +3458,12 @@ public class Tablet {
         this.notifyAll();
       }
 
-      Span curr = Trace.currentTrace();
-      curr.data("extent", "" + getExtent());
-      if (majCStats != null) {
-        curr.data("read", "" + majCStats.getEntriesRead());
-        curr.data("written", "" + majCStats.getEntriesWritten());
-      }
       if (span != null) {
+        span.data("extent", "" + getExtent());
+        if (majCStats != null) {
+          span.data("read", "" + majCStats.getEntriesRead());
+          span.data("written", "" + majCStats.getEntriesWritten());
+        }
         span.stop();
       }
     }


Mime
View raw message