accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject svn commit: r1342689 - in /accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver: Tablet.java TabletServer.java
Date Fri, 25 May 2012 15:41:27 GMT
Author: kturner
Date: Fri May 25 15:41:26 2012
New Revision: 1342689

URL: http://svn.apache.org/viewvc?rev=1342689&view=rev
Log:
ACCUMULO-514 added immediate check for major compaction or split any time a file is introduced
into a tablet

Modified:
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java?rev=1342689&r1=1342688&r2=1342689&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
(original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
Fri May 25 15:41:26 2012
@@ -2219,6 +2219,12 @@ public class Tablet {
         this.stats = minorCompact(conf, fs, tabletMemory.getMinCMemTable(), newMapfileLocation
+ "_tmp", newMapfileLocation, mergeFile, true, queued,
             commitSession, flushId);
         span.stop();
+        
+        if (needsSplit()) {
+          tabletServer.executeSplit(Tablet.this);
+        } else {
+          initiateMajorCompaction(MajorCompactionReason.NORMAL);
+        }
       } catch (Throwable t) {
         log.error("Unknown error during minor compaction for extent: " + getExtent(), t);
         throw new RuntimeException(t);
@@ -3626,6 +3632,12 @@ public class Tablet {
     try {
       datafileManager.importMapFiles(tid, entries, setTime);
       lastMapFileImportTime = System.currentTimeMillis();
+      
+      if (needsSplit()) {
+        tabletServer.executeSplit(this);
+      } else {
+        initiateMajorCompaction(MajorCompactionReason.NORMAL);
+      }
     } finally {
       synchronized (this) {
         if (writesInProgress < 1)

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java?rev=1342689&r1=1342688&r2=1342689&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
(original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
Fri May 25 15:41:26 2012
@@ -2066,6 +2066,10 @@ public class TabletServer extends Abstra
     return majorCompactorDisabled;
   }
   
+  void executeSplit(Tablet tablet) {
+    resourceManager.executeSplit(tablet.getExtent(), new LoggingRunnable(log, new SplitRunner(tablet)));
+  }
+
   private class MajorCompactor implements Runnable {
     
     public void run() {
@@ -2099,7 +2103,7 @@ public class TabletServer extends Abstra
             // if we need to split AND compact, we need a good way
             // to decide what to do
             if (tablet.needsSplit()) {
-              resourceManager.executeSplit(tablet.getExtent(), new LoggingRunnable(log, new
SplitRunner(tablet)));
+              executeSplit(tablet);
               continue;
             }
             
@@ -3339,5 +3343,4 @@ public class TabletServer extends Abstra
   public TableConfiguration getTableConfiguration(KeyExtent extent) {
     return ServerConfiguration.getTableConfiguration(instance, extent.getTableId().toString());
   }
-
 }



Mime
View raw message