@Override public Future<String> restartAllInstances(String runnable) { return delegate.restartAllInstances(runnable); }
@Override public Future<String> restartAllInstances(String runnable) { return delegate.restartAllInstances(runnable); }
@Override public void restartAllInstances() { Iterable<TwillController> twillControllers = twillRunnerService.lookup(Constants.Service.MASTER_SERVICES); for (TwillController twillController : twillControllers) { // Call restart instances Futures.getUnchecked(twillController.restartAllInstances(serviceName)); } }
@Override public void restartAllInstances() { Iterable<TwillController> twillControllers = twillRunnerService.lookup(Constants.Service.MASTER_SERVICES); for (TwillController twillController : twillControllers) { // Call restart instances Futures.getUnchecked(twillController.restartAllInstances(serviceName)); } }
@Test public void testRestartSingleRunnable() throws Exception { YarnTwillRunnerService runner = getTwillRunner(); runner.start(); LOG.info("Starting application {}", SingleRunnableApp.class.getSimpleName()); TwillController controller = runner.prepare(new SingleRunnableApp()) .addLogHandler(new PrinterLogHandler(new PrintWriter(System.out))) .start(); // Lets wait until all runnables have started waitForInstance(controller, HANGING_RUNNABLE, "002", 120, TimeUnit.SECONDS); waitForContainers(controller, 2, 60, TimeUnit.SECONDS); // Now restart runnable LOG.info("Restarting runnable {}", HANGING_RUNNABLE); controller.restartAllInstances(HANGING_RUNNABLE); waitForInstance(controller, HANGING_RUNNABLE, "003", 120, TimeUnit.SECONDS); waitForContainers(controller, 2, 60, TimeUnit.SECONDS); // Send command to HANGING_RUNNABLE to hang when stopped controller.sendCommand(HANGING_RUNNABLE, new SleepCommand(1000)).get(); LOG.info("Restarting runnable {}", HANGING_RUNNABLE); controller.restartAllInstances(HANGING_RUNNABLE); waitForInstance(controller, HANGING_RUNNABLE, "004", 120, TimeUnit.SECONDS); waitForContainers(controller, 2, 60, TimeUnit.SECONDS); }
controller.restartAllInstances(HANGING_RUNNABLE), controller.restartAllInstances(STOPPING_RUNNABLE) ).get(120, TimeUnit.SECONDS); waitForInstance(controller, HANGING_RUNNABLE, "009", 120, TimeUnit.SECONDS);
controller.restartAllInstances("EchoServer").get(60, TimeUnit.SECONDS); Assert.assertTrue(waitForSize(echoServices, 2, 120));