Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4B24C10EA8 for ; Mon, 9 Sep 2013 02:40:37 +0000 (UTC) Received: (qmail 88048 invoked by uid 500); 9 Sep 2013 02:40:36 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 87928 invoked by uid 500); 9 Sep 2013 02:40:36 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 87903 invoked by uid 99); 9 Sep 2013 02:40:33 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Sep 2013 02:40:33 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 7A589903722; Mon, 9 Sep 2013 02:40:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: elserj@apache.org To: commits@accumulo.apache.org Date: Mon, 09 Sep 2013 02:40:33 -0000 Message-Id: <1a2ac9ee58fe423f8fab03def9347689@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/3] 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. Updated Branches: refs/heads/master f0fcd6d11 -> a028e763b 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/master Commit: f868c3762cf39628e32bda051f98862a56628220 Parents: ba507fc Author: Josh Elser Authored: Sat Sep 7 00:36:36 2013 -0400 Committer: Josh Elser 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 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; + } }