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 57D081013B for ; Tue, 2 Dec 2014 20:36:51 +0000 (UTC) Received: (qmail 95368 invoked by uid 500); 2 Dec 2014 20:36:50 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 95220 invoked by uid 500); 2 Dec 2014 20:36:50 -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 94261 invoked by uid 99); 2 Dec 2014 20:36:50 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Dec 2014 20:36:50 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 154929BBF9C; Tue, 2 Dec 2014 20:36:50 +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: Tue, 02 Dec 2014 20:37:03 -0000 Message-Id: <6e6393f20a224c4d943b46aa5b08eee0@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [15/50] [abbrv] accumulo git commit: ACCUMULO-3167 Stub out more control for MAC. Fix RestartIT ACCUMULO-3167 Stub out more control for MAC. Fix RestartIT Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/b0e3008f Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/b0e3008f Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/b0e3008f Branch: refs/heads/metrics2 Commit: b0e3008f9f2dddfa518bc79dd63273154b25a91b Parents: 0c54425 Author: Josh Elser Authored: Sun Nov 23 14:00:03 2014 -0500 Committer: Josh Elser Committed: Mon Nov 24 18:08:51 2014 -0500 ---------------------------------------------------------------------- minicluster/pom.xml | 4 ++++ .../impl/MiniAccumuloClusterControl.java | 24 +++++++++++++++++++- .../accumulo/test/functional/RestartIT.java | 16 +++++++++---- 3 files changed, 39 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/b0e3008f/minicluster/pom.xml ---------------------------------------------------------------------- diff --git a/minicluster/pom.xml b/minicluster/pom.xml index b7bc889..65d5007 100644 --- a/minicluster/pom.xml +++ b/minicluster/pom.xml @@ -72,6 +72,10 @@ org.apache.accumulo + accumulo-tracer + + + org.apache.accumulo accumulo-tserver http://git-wip-us.apache.org/repos/asf/accumulo/blob/b0e3008f/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterControl.java ---------------------------------------------------------------------- diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterControl.java b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterControl.java index 6e7d073..ed90cbf 100644 --- a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterControl.java +++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterControl.java @@ -30,6 +30,7 @@ import org.apache.accumulo.master.Master; import org.apache.accumulo.minicluster.ServerType; import org.apache.accumulo.monitor.Monitor; import org.apache.accumulo.server.util.Admin; +import org.apache.accumulo.tracer.TraceServer; import org.apache.accumulo.tserver.TabletServer; import org.apache.log4j.Logger; import org.apache.zookeeper.server.ZooKeeperServerMain; @@ -48,6 +49,7 @@ public class MiniAccumuloClusterControl implements ClusterControl { Process masterProcess = null; Process gcProcess = null; Process monitor = null; + Process tracer = null; List tabletServerProcesses = Collections.synchronizedList(new ArrayList()); public MiniAccumuloClusterControl(MiniAccumuloClusterImpl cluster) { @@ -121,7 +123,12 @@ public class MiniAccumuloClusterControl implements ClusterControl { if (null == monitor) { monitor = cluster._exec(Monitor.class, server); } - // TODO Enabled Monitor and Tracer for proper mini-ness + break; + case TRACER: + if (null == tracer) { + tracer = cluster._exec(TraceServer.class, server); + } + break; default: throw new UnsupportedOperationException("Cannot start process for " + server); } @@ -220,6 +227,21 @@ public class MiniAccumuloClusterControl implements ClusterControl { } } break; + case TRACER: + if (tracer != null) { + try { + cluster.stopProcessWithTimeout(tracer, 30, TimeUnit.SECONDS); + } catch (ExecutionException e) { + log.warn("Tracer did not fully stop after 30 seconds", e); + } catch (TimeoutException e) { + log.warn("Tracer did not fully stop after 30 seconds", e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } finally { + tracer = null; + } + } + break; default: throw new UnsupportedOperationException("ServerType is not yet supported " + server); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/b0e3008f/test/src/test/java/org/apache/accumulo/test/functional/RestartIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/RestartIT.java b/test/src/test/java/org/apache/accumulo/test/functional/RestartIT.java index 27d8119..8d5a1dd 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/RestartIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/RestartIT.java @@ -143,8 +143,14 @@ public class RestartIT extends AccumuloClusterIT { VOPTS.tableName = tableName; TestIngest.ingest(c, OPTS, BWOPTS); ClusterControl control = getCluster().getClusterControl(); + // TODO implement a kill all too? - cluster.stop(); + // cluster.stop() would also stop ZooKeeper + control.stopAllServers(ServerType.MASTER); + control.stopAllServers(ServerType.TRACER); + control.stopAllServers(ServerType.TABLET_SERVER); + control.stopAllServers(ServerType.GARBAGE_COLLECTOR); + control.stopAllServers(ServerType.MONITOR); ZooReader zreader = new ZooReader(c.getInstance().getZooKeepers(), c.getInstance().getZooKeepersSessionTimeOut()); ZooCache zcache = new ZooCache(zreader, null); @@ -280,10 +286,12 @@ public class RestartIT extends AccumuloClusterIT { TestIngest.ingest(c, opts, BWOPTS); c.tableOperations().flush(tableName, null, null, false); VerifyIngest.verifyIngest(c, VOPTS, SOPTS); - getCluster().getClusterControl().adminStopAll(); + getCluster().stop(); } finally { - getCluster().start(); - c.tableOperations().setProperty(MetadataTable.NAME, Property.TABLE_SPLIT_THRESHOLD.getKey(), splitThreshold); + if (getClusterType() == ClusterType.STANDALONE) { + getCluster().start(); + c.tableOperations().setProperty(MetadataTable.NAME, Property.TABLE_SPLIT_THRESHOLD.getKey(), splitThreshold); + } } } }