@Test(enabled=false, groups = { "disabledOnTravis" }, dependsOnMethods = "testSetupAndSubmitApplication") public void testGetReconnectableApplicationId() throws Exception { Assert.assertEquals(this.gobblinYarnAppLauncher.getReconnectableApplicationId().get(), this.applicationId); this.yarnClient.killApplication(this.applicationId); Assert.assertEquals(yarnClient.getApplicationReport(applicationId).getYarnApplicationState(), YarnApplicationState.KILLED, "Application not killed"); Thread.sleep(5000); }
@VisibleForTesting Optional<ApplicationId> getReconnectableApplicationId() throws YarnException, IOException { List<ApplicationReport> applicationReports = this.yarnClient.getApplications(APPLICATION_TYPES, RECONNECTABLE_APPLICATION_STATES); if (applicationReports == null || applicationReports.isEmpty()) { return Optional.absent(); } for (ApplicationReport applicationReport : applicationReports) { if (this.applicationName.equals(applicationReport.getName())) { String applicationId = sanitizeApplicationId(applicationReport.getApplicationId().toString()); LOGGER.info("Found reconnectable application with application ID: " + applicationId); LOGGER.info("Application Tracking URL: " + applicationReport.getTrackingUrl()); return Optional.of(applicationReport.getApplicationId()); } } return Optional.absent(); }
GobblinYarnAppLauncher { @VisibleForTesting Optional<ApplicationId> getReconnectableApplicationId() throws YarnException, IOException { List<ApplicationReport> applicationReports = this.yarnClient.getApplications(APPLICATION_TYPES, RECONNECTABLE_APPLICATION_STATES); if (applicationReports == null || applicationReports.isEmpty()) { return Optional.absent(); } for (ApplicationReport applicationReport : applicationReports) { if (this.applicationName.equals(applicationReport.getName())) { String applicationId = sanitizeApplicationId(applicationReport.getApplicationId().toString()); LOGGER.info("Found reconnectable application with application ID: " + applicationId); LOGGER.info("Application Tracking URL: " + applicationReport.getTrackingUrl()); return Optional.of(applicationReport.getApplicationId()); } } return Optional.absent(); } }
GobblinYarnAppLauncher { @VisibleForTesting Optional<ApplicationId> getReconnectableApplicationId() throws YarnException, IOException { List<ApplicationReport> applicationReports = this.yarnClient.getApplications(APPLICATION_TYPES, RECONNECTABLE_APPLICATION_STATES); if (applicationReports == null || applicationReports.isEmpty()) { return Optional.absent(); } for (ApplicationReport applicationReport : applicationReports) { if (this.applicationName.equals(applicationReport.getName())) { String applicationId = sanitizeApplicationId(applicationReport.getApplicationId().toString()); LOGGER.info("Found reconnectable application with application ID: " + applicationId); LOGGER.info("Application Tracking URL: " + applicationReport.getTrackingUrl()); return Optional.of(applicationReport.getApplicationId()); } } return Optional.absent(); } GobblinYarnAppLauncher(Config config, YarnConfiguration yarnConfiguration); }
GobblinYarnAppLauncher { @VisibleForTesting Optional<ApplicationId> getReconnectableApplicationId() throws YarnException, IOException { List<ApplicationReport> applicationReports = this.yarnClient.getApplications(APPLICATION_TYPES, RECONNECTABLE_APPLICATION_STATES); if (applicationReports == null || applicationReports.isEmpty()) { return Optional.absent(); } for (ApplicationReport applicationReport : applicationReports) { if (this.applicationName.equals(applicationReport.getName())) { String applicationId = sanitizeApplicationId(applicationReport.getApplicationId().toString()); LOGGER.info("Found reconnectable application with application ID: " + applicationId); LOGGER.info("Application Tracking URL: " + applicationReport.getTrackingUrl()); return Optional.of(applicationReport.getApplicationId()); } } return Optional.absent(); } GobblinYarnAppLauncher(Config config, YarnConfiguration yarnConfiguration); void launch(); synchronized void stop(); @Subscribe void handleApplicationReportArrivalEvent(ApplicationReportArrivalEvent applicationReportArrivalEvent); @Subscribe void handleGetApplicationReportFailureEvent(
      GetApplicationReportFailureEvent getApplicationReportFailureEvent); static void main(String[] args); }
GobblinYarnAppLauncher { @VisibleForTesting Optional<ApplicationId> getReconnectableApplicationId() throws YarnException, IOException { List<ApplicationReport> applicationReports = this.yarnClient.getApplications(APPLICATION_TYPES, RECONNECTABLE_APPLICATION_STATES); if (applicationReports == null || applicationReports.isEmpty()) { return Optional.absent(); } for (ApplicationReport applicationReport : applicationReports) { if (this.applicationName.equals(applicationReport.getName())) { String applicationId = sanitizeApplicationId(applicationReport.getApplicationId().toString()); LOGGER.info("Found reconnectable application with application ID: " + applicationId); LOGGER.info("Application Tracking URL: " + applicationReport.getTrackingUrl()); return Optional.of(applicationReport.getApplicationId()); } } return Optional.absent(); } GobblinYarnAppLauncher(Config config, YarnConfiguration yarnConfiguration); void launch(); synchronized void stop(); @Subscribe void handleApplicationReportArrivalEvent(ApplicationReportArrivalEvent applicationReportArrivalEvent); @Subscribe void handleGetApplicationReportFailureEvent(
      GetApplicationReportFailureEvent getApplicationReportFailureEvent); static void main(String[] args); static final String GOBBLIN_YARN_CONFIG_OUTPUT_PATH; static final String GOBBLIN_YARN_APP_LAUNCHER_MODE; static final String DEFAULT_GOBBLIN_YARN_APP_LAUNCHER_MODE; static final String AZKABAN_APP_LAUNCHER_MODE_KEY; }