accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [1/2] git commit: ACCUMULO-1689 Add in option to run GC to the config. Set the GC delay to 30s to account for the fact that we're running in MiniAccumuloCluster and not a real instance.
Date Sat, 07 Sep 2013 04:54:39 GMT
Updated Branches:
  refs/heads/1.5.1-SNAPSHOT f75be7d5a -> f1af6f91d


ACCUMULO-1689 Add in option to run GC to the config. Set the GC delay to 30s to
account for the fact that we're running in MiniAccumuloCluster and not a real
instance.


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

Branch: refs/heads/1.5.1-SNAPSHOT
Commit: f868c3762cf39628e32bda051f98862a56628220
Parents: ba507fc
Author: Josh Elser <elserj@apache.org>
Authored: Sat Sep 7 00:36:36 2013 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Sat Sep 7 00:39:54 2013 -0400

----------------------------------------------------------------------
 .../accumulo/minicluster/MiniAccumuloCluster.java  | 10 ++++++++++
 .../accumulo/minicluster/MiniAccumuloConfig.java   | 17 +++++++++++++++++
 2 files changed, 27 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/f868c376/src/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
----------------------------------------------------------------------
diff --git a/src/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
b/src/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
index 3a4a1fd..338a16d 100644
--- a/src/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
+++ b/src/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
@@ -34,6 +34,7 @@ import java.util.TimerTask;
 
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.util.UtilWaitThread;
+import org.apache.accumulo.server.gc.SimpleGarbageCollector;
 import org.apache.accumulo.server.logger.LogService;
 import org.apache.accumulo.server.master.Master;
 import org.apache.accumulo.server.tabletserver.TabletServer;
@@ -115,6 +116,7 @@ public class MiniAccumuloCluster {
   private Process zooKeeperProcess;
   private Process masterProcess;
   private Process loggerProcess;
+  private Process gcProcess;
   
   private int zooKeeperPort;
   
@@ -242,6 +244,7 @@ public class MiniAccumuloCluster {
     appendProp(fileWriter, Property.TRACE_PORT, "" + PortUtils.getRandomFreePort(), siteConfig);
     appendProp(fileWriter, Property.LOGGER_SORT_BUFFER_SIZE, "50M", siteConfig);
     appendProp(fileWriter, Property.LOGGER_PORTSEARCH, "true", siteConfig);
+    appendProp(fileWriter, Property.GC_CYCLE_DELAY, "30s", siteConfig);
     
     // since there is a small amount of memory, check more frequently for majc... setting
may not be needed in 1.5
     appendProp(fileWriter, Property.TSERV_MAJC_DELAY, "3", siteConfig);
@@ -320,6 +323,10 @@ public class MiniAccumuloCluster {
     
     loggerProcess = exec(LogService.class);
     masterProcess = exec(Master.class);
+    
+    if (config.shouldRunGC()) {
+      gcProcess = exec(SimpleGarbageCollector.class);
+    }
   }
   
   /**
@@ -361,5 +368,8 @@ public class MiniAccumuloCluster {
     
     for (LogWriter lw : logWriters)
       lw.flush();
+
+    if (gcProcess != null)
+      gcProcess.destroy();
   }
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f868c376/src/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloConfig.java
----------------------------------------------------------------------
diff --git a/src/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloConfig.java
b/src/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloConfig.java
index e0a9e94..3480be9 100644
--- a/src/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloConfig.java
+++ b/src/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloConfig.java
@@ -32,6 +32,7 @@ public class MiniAccumuloConfig {
   private String rootPassword = null;
   private Map<String,String> siteConfig = Collections.emptyMap();
   private int numTservers = 2;
+  private boolean runGC = false;
   
   /**
    * @param dir
@@ -86,4 +87,20 @@ public class MiniAccumuloConfig {
     this.siteConfig = siteConfig;
     return this;
   }
+  
+  /**
+   * Whether or not the Accumulo garbage collector proces will run
+   * @return
+   */
+  public boolean shouldRunGC() {
+    return runGC;
+  }
+  
+  /**
+   * Sets if the Accumulo garbage collector process should run
+   * @param shouldRunGC
+   */
+  public void runGC(boolean shouldRunGC) {
+    runGC = shouldRunGC;
+  }
 }


Mime
View raw message