@Override public Void call() throws Exception { delegate.kill(); return null; } });
@Override public Void call() throws Exception { delegate.kill(); return null; } });
public void kill(FluoConfiguration config) throws Exception { checkIfInitialized(config); String twillId = verifyTwillId(config); TwillController controller = getTwillRunner(config) .lookup(getYarnApplicationName(config.getApplicationName()), RunIds.fromString(twillId)); if (controller != null) { System.out.print("Killing Fluo '" + config.getApplicationName() + "' application " + getAppInfo(config) + "..."); controller.kill(); System.out.println("DONE"); } else { System.out.println("Fluo '" + config.getApplicationName() + "' application " + getAppInfo(config) + " is already stopped."); } }
public void kill(FluoConfiguration config) throws Exception { checkIfInitialized(config); String twillId = verifyTwillId(config); TwillController controller = getTwillRunner(config) .lookup(getYarnApplicationName(config.getApplicationName()), RunIds.fromString(twillId)); if (controller != null) { System.out.print("Killing Fluo '" + config.getApplicationName() + "' application " + getAppInfo(config) + "..."); controller.kill(); System.out.println("DONE"); } else { System.out.println("Fluo '" + config.getApplicationName() + "' application " + getAppInfo(config) + " is already stopped."); } }
public void kill(FluoConfiguration config) throws Exception { checkIfInitialized(config); String twillId = verifyTwillId(config); TwillController controller = getTwillRunner(config).lookup(getYarnApplicationName(config.getApplicationName()), RunIds.fromString(twillId)); if (controller != null) { System.out.print("Killing Fluo '" + config.getApplicationName() + "' application " + getAppInfo(config) + "..."); controller.kill(); System.out.println("DONE"); } else { System.out.println("Fluo '" + config.getApplicationName() + "' application " + getAppInfo(config) + " is already stopped."); } }
@Test public void testProvisionTimeout() throws InterruptedException, ExecutionException, TimeoutException, IOException { TwillRunner runner = getTwillRunner(); // Create a parent folder to be written by EventHandler#aborted() File parentFolder = TMP_FOLDER.newFolder(); parentFolder.setWritable(true, false); TwillController controller = runner.prepare(new TimeoutApplication(parentFolder.getAbsolutePath())) .addLogHandler(new PrinterLogHandler(new PrintWriter(System.out, true))) .start(); // The provision should failed in 30 seconds after AM started, which AM could took a while to start. // Hence we give 90 seconds max time here. try { controller.awaitTerminated(90, TimeUnit.SECONDS); // EventHandler#aborted() method should be called to create a file Assert.assertTrue(new File(parentFolder.getAbsolutePath(), ABORTED_FILE).exists()); String[] abortedFiles = parentFolder.list(); Assert.assertNotNull(abortedFiles); Assert.assertEquals(1, abortedFiles.length); } finally { // If it timeout, kill the app as cleanup. controller.kill(); } }