You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by el...@apache.org on 2014/12/02 21:37:05 UTC
[17/50] [abbrv] accumulo git commit: ACCUMULO-3167 Wire up monitor to
Mini cluster control for ReadWriteIT
ACCUMULO-3167 Wire up monitor to Mini cluster control for ReadWriteIT
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/5187012e
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/5187012e
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/5187012e
Branch: refs/heads/metrics2
Commit: 5187012e24512f9b4d2bc8c2ba75ee33386e92d8
Parents: 9bf41fd
Author: Josh Elser <el...@apache.org>
Authored: Sat Nov 22 12:49:46 2014 -0500
Committer: Josh Elser <el...@apache.org>
Committed: Mon Nov 24 18:08:51 2014 -0500
----------------------------------------------------------------------
minicluster/pom.xml | 4 ++++
.../impl/MiniAccumuloClusterControl.java | 22 +++++++++++++++++++-
2 files changed, 25 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5187012e/minicluster/pom.xml
----------------------------------------------------------------------
diff --git a/minicluster/pom.xml b/minicluster/pom.xml
index 5ad531f..b7bc889 100644
--- a/minicluster/pom.xml
+++ b/minicluster/pom.xml
@@ -60,6 +60,10 @@
</dependency>
<dependency>
<groupId>org.apache.accumulo</groupId>
+ <artifactId>accumulo-monitor</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.accumulo</groupId>
<artifactId>accumulo-server-base</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5187012e/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 cd1a923..6e7d073 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
@@ -28,6 +28,7 @@ import org.apache.accumulo.cluster.ClusterControl;
import org.apache.accumulo.gc.SimpleGarbageCollector;
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.tserver.TabletServer;
import org.apache.log4j.Logger;
@@ -46,6 +47,7 @@ public class MiniAccumuloClusterControl implements ClusterControl {
Process zooKeeperProcess = null;
Process masterProcess = null;
Process gcProcess = null;
+ Process monitor = null;
List<Process> tabletServerProcesses = Collections.synchronizedList(new ArrayList<Process>());
public MiniAccumuloClusterControl(MiniAccumuloClusterImpl cluster) {
@@ -115,6 +117,10 @@ public class MiniAccumuloClusterControl implements ClusterControl {
gcProcess = cluster._exec(SimpleGarbageCollector.class, server);
}
break;
+ case MONITOR:
+ if (null == monitor) {
+ monitor = cluster._exec(Monitor.class, server);
+ }
// TODO Enabled Monitor and Tracer for proper mini-ness
default:
throw new UnsupportedOperationException("Cannot start process for " + server);
@@ -197,7 +203,21 @@ public class MiniAccumuloClusterControl implements ClusterControl {
tabletServerProcesses.clear();
}
}
-
+ }
+ break;
+ case MONITOR:
+ if (monitor != null) {
+ try {
+ cluster.stopProcessWithTimeout(monitor, 30, TimeUnit.SECONDS);
+ } catch (ExecutionException e) {
+ log.warn("Monitor did not fully stop after 30 seconds", e);
+ } catch (TimeoutException e) {
+ log.warn("Monitor did not fully stop after 30 seconds", e);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ } finally {
+ monitor = null;
+ }
}
break;
default: