public static String getAmUrl(ApplicationReport report) { return DoYUtil.unwrapAmUrl(report.getOriginalTrackingUrl()); }
@Override public String getOriginalTrackingUrl() { return report.getOriginalTrackingUrl(); }
@Override public String getOriginalTrackingUrl() { return "http://" + report.getOriginalTrackingUrl(); }
@Override public String getOriginalTrackingUrl() { return report.getOriginalTrackingUrl(); }
@Override public String getJobUrl() { try { String originalUrl = yarnClient.getApplicationReport(yarnAppId).getOriginalTrackingUrl(); return originalUrl; } catch (YarnException | IOException e) { throw throwsException(e); } }
private YarnContainerClusterOperations buildClusterOperations(RestTemplate restTemplate, YarnClient client, ApplicationId applicationId) { ApplicationReport report = client.getApplicationReport(applicationId); String trackingUrl = report.getOriginalTrackingUrl(); return new YarnContainerClusterTemplate(trackingUrl + "/" + YarnContainerClusterEndpoint.ENDPOINT_ID, restTemplate); }
private synchronized YarnContainerClusterOperations buildClusterOperations(RestTemplate restTemplate, YarnClient client, ApplicationId applicationId) { String key = applicationId.toString(); YarnContainerClusterOperations operations = operationsCache.get(key); if (operations == null) { ApplicationReport report = client.getApplicationReport(applicationId); String trackingUrl = report.getOriginalTrackingUrl(); operations = new YarnContainerClusterTemplate(trackingUrl + "/" + YarnContainerClusterEndpoint.ENDPOINT_ID, restTemplate); operationsCache.put(key, operations); } return operations; }
@Override public String runWithSpringApplication(ApplicationContext context) throws Exception { OperationProperties operationProperties = context.getBean(OperationProperties.class); ApplicationId applicationId = ConverterUtils.toApplicationId(operationProperties.getApplicationId()); YarnClient client = context.getBean(YarnClient.class); ApplicationReport report = client.getApplicationReport(applicationId); String trackingUrl = report.getOriginalTrackingUrl(); RestTemplate restTemplate = context.getBean(YarnSystemConstants.DEFAULT_ID_RESTTEMPLATE, RestTemplate.class); restTemplate.postForObject(trackingUrl + "/shutdown", null, Void.class); return "shutdown requested"; }
public Collection<CloudAppInstanceInfo> getSubmittedApplications() { List<CloudAppInstanceInfo> appIds = new ArrayList<CloudAppInstanceInfo>(); for (ApplicationReport report : yarnClient.listApplications("DATAFLOW")) { appIds.add(new CloudAppInstanceInfo(report.getApplicationId().toString(), report.getName(), report.getYarnApplicationState().toString(), report.getOriginalTrackingUrl())); } return appIds; }
public Collection<CloudAppInstanceInfo> getSubmittedApplications(String yarnApplicationId) { List<CloudAppInstanceInfo> appIds = new ArrayList<CloudAppInstanceInfo>(); for (ApplicationReport report : yarnClient.listApplications("DATAFLOW")) { if (report.getApplicationId().toString().equals(yarnApplicationId)) { appIds.add(new CloudAppInstanceInfo(report.getApplicationId().toString(), report.getName(), report.getYarnApplicationState().toString(), report.getOriginalTrackingUrl())); } } return appIds; }
/** * convert an AM report to a string for diagnostics * @param report the report * @return the string value */ public static String reportToString(ApplicationReport report) { if (report == null) { return "Null application report"; } return "App " + report.getName() + "/" + report.getApplicationType() + "# " + report.getApplicationId() + " user " + report.getUser() + " is in state " + report.getYarnApplicationState() + " RPC: " + report.getHost() + ":" + report.getRpcPort() + " URL: " + report.getOriginalTrackingUrl(); }
/** * convert an AM report to a string for diagnostics * @param report the report * @return the string value */ public static String reportToString(ApplicationReport report) { if (report == null) { return "Null application report"; } return "App " + report.getName() + "/" + report.getApplicationType() + "# " + report.getApplicationId() + " user " + report.getUser() + " is in state " + report.getYarnApplicationState() + " RPC: " + report.getHost() + ":" + report.getRpcPort() + " URL: " + report.getOriginalTrackingUrl(); }
public AppInfo(ApplicationReport app) { appId = app.getApplicationId().toString(); if (app.getCurrentApplicationAttemptId() != null) { currentAppAttemptId = app.getCurrentApplicationAttemptId().toString(); } user = app.getUser(); queue = app.getQueue(); name = app.getName(); type = app.getApplicationType(); host = app.getHost(); rpcPort = app.getRpcPort(); appState = app.getYarnApplicationState(); diagnosticsInfo = app.getDiagnostics(); trackingUrl = app.getTrackingUrl(); originalTrackingUrl = app.getOriginalTrackingUrl(); submittedTime = app.getStartTime(); startedTime = app.getStartTime(); finishedTime = app.getFinishTime(); elapsedTime = Times.elapsed(startedTime, finishedTime); finalAppStatus = app.getFinalApplicationStatus(); progress = app.getProgress() * 100; // in percent if (app.getApplicationTags() != null && !app.getApplicationTags().isEmpty()) { this.applicationTags = CSV_JOINER.join(app.getApplicationTags()); } }
public AppInfo(ApplicationReport app) { appId = app.getApplicationId().toString(); if (app.getCurrentApplicationAttemptId() != null) { currentAppAttemptId = app.getCurrentApplicationAttemptId().toString(); } user = app.getUser(); queue = app.getQueue(); name = app.getName(); type = app.getApplicationType(); host = app.getHost(); rpcPort = app.getRpcPort(); appState = app.getYarnApplicationState(); diagnosticsInfo = app.getDiagnostics(); trackingUrl = app.getTrackingUrl(); originalTrackingUrl = app.getOriginalTrackingUrl(); submittedTime = app.getStartTime(); startedTime = app.getStartTime(); finishedTime = app.getFinishTime(); elapsedTime = Times.elapsed(startedTime, finishedTime); finalAppStatus = app.getFinalApplicationStatus(); progress = app.getProgress() * 100; // in percent if (app.getApplicationTags() != null && !app.getApplicationTags().isEmpty()) { this.applicationTags = CSV_JOINER.join(app.getApplicationTags()); } }
public SerializedApplicationReport(ApplicationReport report) { this.applicationId = report.getApplicationId().toString(); ApplicationAttemptId attemptId = report.getCurrentApplicationAttemptId(); this.applicationAttemptId = attemptId != null ? attemptId.toString() : "N/A"; this.name = report.getName(); this.applicationType = report.getApplicationType(); this.user = report.getUser(); this.queue = report.getQueue(); this.host = report.getHost(); this.rpcPort = report.getRpcPort(); this.state = report.getYarnApplicationState().toString(); this.diagnostics = report.getDiagnostics(); this.startTime = report.getStartTime(); this.finishTime = report.getFinishTime(); FinalApplicationStatus appStatus = report.getFinalApplicationStatus(); this.finalStatus = appStatus == null ? "" : appStatus.toString(); this.progress = report.getProgress(); this.url = report.getTrackingUrl(); this.origTrackingUrl= report.getOriginalTrackingUrl(); }
public SerializedApplicationReport(ApplicationReport report) { this.applicationId = report.getApplicationId().toString(); ApplicationAttemptId attemptId = report.getCurrentApplicationAttemptId(); this.applicationAttemptId = attemptId != null ? attemptId.toString() : "N/A"; this.name = report.getName(); this.applicationType = report.getApplicationType(); this.user = report.getUser(); this.queue = report.getQueue(); this.host = report.getHost(); this.rpcPort = report.getRpcPort(); this.state = report.getYarnApplicationState().toString(); this.diagnostics = report.getDiagnostics(); this.startTime = report.getStartTime(); this.finishTime = report.getFinishTime(); FinalApplicationStatus appStatus = report.getFinalApplicationStatus(); this.finalStatus = appStatus == null ? "" : appStatus.toString(); this.progress = report.getProgress(); this.url = report.getTrackingUrl(); this.origTrackingUrl= report.getOriginalTrackingUrl(); }
private void verifyEnemyAppReport(ApplicationReport appReport) { Assert.assertEquals("Enemy should not see app host!", UNAVAILABLE, appReport.getHost()); Assert.assertEquals("Enemy should not see app rpc port!", -1, appReport.getRpcPort()); Assert.assertEquals("Enemy should not see app client token!", null, appReport.getClientToAMToken()); Assert.assertEquals("Enemy should not see app diagnostics!", UNAVAILABLE, appReport.getDiagnostics()); Assert.assertEquals("Enemy should not see app tracking url!", UNAVAILABLE, appReport.getTrackingUrl()); Assert.assertEquals("Enemy should not see app original tracking url!", UNAVAILABLE, appReport.getOriginalTrackingUrl()); ApplicationResourceUsageReport usageReport = appReport.getApplicationResourceUsageReport(); Assert.assertEquals("Enemy should not see app used containers", -1, usageReport.getNumUsedContainers()); Assert.assertEquals("Enemy should not see app reserved containers", -1, usageReport.getNumReservedContainers()); Assert.assertEquals("Enemy should not see app used resources", -1, usageReport.getUsedResources().getMemory()); Assert.assertEquals("Enemy should not see app reserved resources", -1, usageReport.getReservedResources().getMemory()); Assert.assertEquals("Enemy should not see app needed resources", -1, usageReport.getNeededResources().getMemory()); }
Assert.assertEquals(FinalApplicationStatus.SUCCEEDED, appReport.getFinalApplicationStatus()); Assert.assertEquals("trackingUrl", appReport.getOriginalTrackingUrl());
private void verifyEnemyAppReport(ApplicationReport appReport) { Assert.assertEquals("Enemy should not see app host!", UNAVAILABLE, appReport.getHost()); Assert.assertEquals("Enemy should not see app rpc port!", -1, appReport.getRpcPort()); Assert.assertEquals("Enemy should not see app client token!", null, appReport.getClientToAMToken()); Assert.assertEquals("Enemy should not see app diagnostics!", UNAVAILABLE, appReport.getDiagnostics()); Assert.assertEquals("Enemy should not see app tracking url!", UNAVAILABLE, appReport.getTrackingUrl()); Assert.assertEquals("Enemy should not see app original tracking url!", UNAVAILABLE, appReport.getOriginalTrackingUrl()); ApplicationResourceUsageReport usageReport = appReport.getApplicationResourceUsageReport(); Assert.assertEquals("Enemy should not see app used containers", -1, usageReport.getNumUsedContainers()); Assert.assertEquals("Enemy should not see app reserved containers", -1, usageReport.getNumReservedContainers()); Assert.assertEquals("Enemy should not see app used resources", -1, usageReport.getUsedResources().getMemorySize()); Assert.assertEquals("Enemy should not see app reserved resources", -1, usageReport.getReservedResources().getMemorySize()); Assert.assertEquals("Enemy should not see app needed resources", -1, usageReport.getNeededResources().getMemorySize()); }
Assert.assertEquals(FinalApplicationStatus.SUCCEEDED, appReport.getFinalApplicationStatus()); Assert.assertEquals("trackingUrl", appReport.getOriginalTrackingUrl());