@Override public void restart(ServiceType service, String hostname, int port) throws IOException { exec(hostname, service, Operation.RESTART); }
@Override public void start(ServiceType service, String hostname, int port) throws IOException { exec(hostname, service, Operation.START); }
@Override public void stop(ServiceType service, String hostname, int port) throws IOException { exec(hostname, service, Operation.STOP); }
private Pair<Integer, String> execWithRetries(String hostname, ServiceType service, String... cmd) throws IOException { RetryCounter retryCounter = retryCounterFactory.create(); while (true) { try { return exec(hostname, service, cmd); } catch (IOException e) { retryOrThrow(retryCounter, e, hostname, cmd); } try { retryCounter.sleepUntilNextRetry(); } catch (InterruptedException ex) { // ignore LOG.warn("Sleep Interrupted:" + ex); } } }
@Override public void start(ServiceType service, String hostname, int port) throws IOException { exec(hostname, service, Operation.START); }
@Override public void stop(ServiceType service, String hostname, int port) throws IOException { exec(hostname, service, Operation.STOP); }
@Override public void restart(ServiceType service, String hostname, int port) throws IOException { exec(hostname, service, Operation.RESTART); }
private Pair<Integer, String> execWithRetries(String hostname, ServiceType service, String... cmd) throws IOException { RetryCounter retryCounter = retryCounterFactory.create(); while (true) { try { return exec(hostname, service, cmd); } catch (IOException e) { retryOrThrow(retryCounter, e, hostname, cmd); } try { retryCounter.sleepUntilNextRetry(); } catch (InterruptedException ex) { // ignore LOG.warn("Sleep Interrupted:" + ex); } } }