public void killProcess(ServerType type, ProcessReference proc) throws ProcessNotFoundException, InterruptedException { getClusterControl().killProcess(type, proc); }
@Override public synchronized void startAllServers(ServerType server) throws IOException { start(server, null); }
@Override public void kill(ServerType server, String hostname) throws IOException { stop(server, hostname); }
@Test(timeout = 2 * 60 * 1000) public void test() throws Exception { // not yet, please String tableName = getUniqueNames(1)[0]; cluster.getClusterControl().stop(ServerType.GARBAGE_COLLECTOR); Connector c = getConnector(); c.tableOperations().create(tableName); // count the number of WALs in the filesystem assertEquals(2, countWALsInFS(cluster)); cluster.getClusterControl().stop(ServerType.TABLET_SERVER); cluster.getClusterControl().start(ServerType.GARBAGE_COLLECTOR); cluster.getClusterControl().start(ServerType.TABLET_SERVER); Iterators.size(c.createScanner(MetadataTable.NAME, Authorizations.EMPTY).iterator()); // let GC run UtilWaitThread.sleep(3 * 5 * 1000); assertEquals(2, countWALsInFS(cluster)); }
@Test public void test() throws Exception { final Connector c = getConnector(); getCluster().getClusterControl().kill(ServerType.GARBAGE_COLLECTOR, "localhost"); final String tableName = getUniqueNames(1)[0]; c.tableOperations().create(tableName);
@Override public Entry<Integer,String> execWithStdout(Class<?> clz, String[] args) throws IOException { Process p = cluster.exec(clz, args); int exitCode; try { exitCode = p.waitFor(); } catch (InterruptedException e) { log.warn("Interrupted waiting for process to exit", e); Thread.currentThread().interrupt(); throw new IOException(e); } for (LogWriter writer : cluster.getLogWriters()) { writer.flush(); } return Maps.immutableEntry(exitCode, readAll(new FileInputStream(cluster.getConfig().getLogDir() + "/" + clz.getSimpleName() + "_" + p.hashCode() + ".out"))); }
@Test public void test() throws Exception { log.debug("Starting Monitor"); cluster.getClusterControl().startAllServers(ServerType.MONITOR); String monitorLocation = null; while (null == monitorLocation) { try { monitorLocation = MonitorUtil.getLocation(getConnector().getInstance()); } catch (Exception e) { // ignored } if (null == monitorLocation) { log.debug("Could not fetch monitor HTTP address from zookeeper"); Thread.sleep(2000); } } URL url = new URL("https://" + monitorLocation); log.debug("Fetching web page " + url); String result = FunctionalTestUtils.readAll(url.openStream()); assertTrue(result.length() > 100); assertTrue(result.indexOf("Accumulo Overview") >= 0); }
clusterControl = new MiniAccumuloClusterControl(this);
c.instanceOperations().waitForBalance(); log.info("Restarting"); getCluster().getClusterControl().kill(ServerType.TABLET_SERVER, "localhost"); getCluster().start(); log.info("Verifying");
MiniAccumuloClusterImpl mac = getCluster(); MiniAccumuloClusterControl control = mac.getClusterControl(); control.stop(GARBAGE_COLLECTOR); Connector c = getConnector(); String tableName = getUniqueNames(1)[0]; control.start(GARBAGE_COLLECTOR); sleepUninterruptibly(5, TimeUnit.SECONDS); control.stop(GARBAGE_COLLECTOR); control.stop(TABLET_SERVER); control.start(TABLET_SERVER); control.start(GARBAGE_COLLECTOR); sleepUninterruptibly(5, TimeUnit.SECONDS); Map<String,Boolean> walsAfterRestartAndGC = getWALsAndAssertCount(c, 2);
@Override public synchronized void stopAllServers(ServerType server) throws IOException { stop(server); }
public void start(ServerType server) throws IOException { start(server, null); }
getCluster().getClusterControl().killProcess(ServerType.TABLET_SERVER, pr); --count;
@Test public void replicatedStatusEntriesAreDeleted() throws Exception { getCluster().getClusterControl().stop(ServerType.GARBAGE_COLLECTOR); cluster.getClusterControl().stop(ServerType.TABLET_SERVER); cluster.getClusterControl().start(ServerType.TABLET_SERVER); cluster.getClusterControl().start(ServerType.GARBAGE_COLLECTOR);
public void stop(ServerType server) throws IOException { stop(server, null); }
@Override public synchronized void start(ServerType server, String hostname) throws IOException { start(server, hostname, Collections.<String,String> emptyMap(), Integer.MAX_VALUE); }
@Test public void test() throws Exception { getCluster().getClusterControl().start(ServerType.MONITOR); final Connector c = getConnector(); final String tableName = getUniqueNames(1)[0];