/** Waits until all the {@code servers} on given {@code host} are running. */ public void waitUntilServersRunning(String host, List<String> servers) throws InterruptedException, TimeoutException, IOException { domainOps.waitUntilServersAreRunning(host, servers, true); }
/** * Waits until the the host controller of given {@code host} is running. * This is a variant of {@link Administration#waitUntilRunning()}. */ public void waitUntilRunning(String host) throws InterruptedException, TimeoutException, IOException { domainOps.waitUntilServersAreRunning(host, null, true); }
/** @see #waitUntilServersRunning(String, java.util.List) */ public void waitUntilServersRunning(List<String> servers) throws InterruptedException, TimeoutException, IOException { domainOps.waitUntilServersAreRunning(client.options().defaultHost, servers, true); }
@Override public void waitUntilRunning() throws InterruptedException, TimeoutException, IOException { waitUntilServersAreRunning(client.options().defaultHost, null, true); }
void performRestartOperation(String host, RestartOperation restartOperation) throws IOException, TimeoutException, InterruptedException { List<String> allServers = allRunningServers(host); boolean needsToReconnect = false; try { restartOperation.perform(ops, Address.host(host)); } catch (Throwable e) { // server went down before we received the response, this can happen needsToReconnect = true; } waitUntilServersAreRunning(host, allServers, needsToReconnect); }
void restartServers(String host, List<String> servers) throws IOException, InterruptedException, TimeoutException { Batch batch = new Batch(); for (String server : servers) { batch.invoke(Constants.RESTART, Address.host(host).and(Constants.SERVER_CONFIG, server)); } boolean needsToReconnect = false; try { ops.batch(batch); } catch (Throwable e) { // server went down before we received the response, this can happen needsToReconnect = true; } domainOps.waitUntilServersAreRunning(host, servers, needsToReconnect); }