containerEnv.put(XLearningConstants.Environment.APP_ATTEMPTID.toString(), applicationAttemptID.toString()); containerEnv.put(XLearningConstants.Environment.APP_ID.toString(), applicationAttemptID.getApplicationId().toString());
publishApplicationAttemptEvent(timelineClient, jstormMasterContext.appAttemptID.toString(), DSEvent.DS_APP_ATTEMPT_END, jstormMasterContext.domainId, appSubmitterUgi);
publishApplicationAttemptEvent(timelineClient, jstormMasterContext.appAttemptID.toString(), DSEvent.DS_APP_ATTEMPT_START, jstormMasterContext.domainId, appSubmitterUgi);
@Override public String toString() { return appAttId.toString(); } }
/** * Print all the information about this AM. */ public void printAll() { System.out.println("APPLICATION_ATTEMPT_ID:" + appAttemptId.toString()); System.out.println("START_TIME: " + startTime); System.out.println("CONTAINER_ID: " + containerId.toString()); System.out.println("NODE_MANAGER_HOST: " + nodeManagerHost); System.out.println("NODE_MANAGER_PORT: " + nodeManagerPort); System.out.println("NODE_MANAGER_HTTP_PORT: " + nodeManagerHttpPort); }
@Override public String toString() { return appAttId.toString(); } }
private void writeDomain(ApplicationAttemptId appAttemptId, TimelineDomain domain) throws IOException { Path domainLogPath = new Path(attemptDirCache.getAppAttemptDir(appAttemptId), DOMAIN_LOG_PREFIX + appAttemptId.toString()); if (LOG.isDebugEnabled()) { LOG.debug("Writing domains for " + appAttemptId.toString() + " to " + domainLogPath); } this.logFDsCache.writeDomainLog( fs, domainLogPath, objMapper, domain, isAppendSupported); }
startTimelineClient(conf); if(timelineClient != null) { YarnUtils.INSTANCE.publishApplicationAttemptEvent(timelineClient, appAttemptID.toString(), ContainerEvents.APP_ATTEMPT_START, domainId, appSubmitterUgi);
@Override public void preemptContainer(ApplicationAttemptId aid, RMContainer cont) { if(LOG.isDebugEnabled()){ LOG.debug("PREEMPT_CONTAINER: application:" + aid.toString() + " container: " + cont.toString()); } FiCaSchedulerApp app = getApplicationAttempt(aid); if (app != null) { app.addPreemptContainer(cont.getContainerId()); } }
protected void authorizeUser(UserGroupInformation remoteUgi, NMTokenIdentifier nmTokenIdentifier) throws YarnException { if (nmTokenIdentifier == null) { throw RPCUtil.getRemoteException(INVALID_NMTOKEN_MSG); } if (!remoteUgi.getUserName().equals( nmTokenIdentifier.getApplicationAttemptId().toString())) { throw RPCUtil.getRemoteException("Expected applicationAttemptId: " + remoteUgi.getUserName() + "Found: " + nmTokenIdentifier.getApplicationAttemptId()); } }
@VisibleForTesting protected Path getAppAttemptDir(ApplicationAttemptId appAttId) { return getNodePath(getAppDir(appAttId.getApplicationId()), appAttId .toString()); } // FileSystem related code
@VisibleForTesting protected Path getAppAttemptDir(ApplicationAttemptId appAttId) { return getNodePath(getAppDir(appAttId.getApplicationId()), appAttId .toString()); } // FileSystem related code
@Override public synchronized void removeApplicationAttemptInternal( ApplicationAttemptId appAttemptId) throws Exception { Path appDirPath = getAppDir(rmAppRoot, appAttemptId.getApplicationId()); Path nodeRemovePath = getNodePath(appDirPath, appAttemptId.toString()); LOG.info("Removing info for attempt: " + appAttemptId + " at: " + nodeRemovePath); deleteFileWithRetries(nodeRemovePath); }
public ApplicationAttemptId validateRunningAttemptId(ApplicationId appId) throws Exception { ApplicationAttemptId attemptId = this.client.getApplicationReport(appId).getCurrentApplicationAttemptId(); ApplicationAttemptReport attemptReport = this.client.getApplicationAttemptReport(attemptId); if (attemptReport.getYarnApplicationAttemptState() == YarnApplicationAttemptState.RUNNING) { log.info("Job is running. AttempId " + attemptId.toString()); return attemptId; } else { throw new SamzaException("Job not running " + this.jobName); } }
@Before public void setUp() throws Exception { when(APPID.toString()).thenReturn("app_1"); when(ATTEMPTID.toString()).thenReturn("app_attempt_1"); when(CONTAINERID.toString()).thenReturn("container_1"); }
private static TimelineEntity createAppAttemptEntity( ApplicationAttemptId appAttemptId) { TimelineEntity entity = new TimelineEntity(); entity.setEntityType(AppAttemptMetricsConstants.ENTITY_TYPE); entity.setEntityId(appAttemptId.toString()); entity.addPrimaryFilter(AppAttemptMetricsConstants.PARENT_PRIMARY_FILTER, appAttemptId.getApplicationId().toString()); return entity; }
private static TimelineEntity createContainerEntity(ContainerId containerId) { TimelineEntity entity = new TimelineEntity(); entity.setEntityType(ContainerMetricsConstants.ENTITY_TYPE); entity.setEntityId(containerId.toString()); entity.addPrimaryFilter(ContainerMetricsConstants.PARENT_PRIMARIY_FILTER, containerId.getApplicationAttemptId().toString()); return entity; }
private static TimelineEntity createContainerEntity( ContainerId containerId) { TimelineEntity entity = new TimelineEntity(); entity.setEntityType( ContainerMetricsConstants.ENTITY_TYPE); entity.setEntityId(containerId.toString()); entity.addPrimaryFilter(ContainerMetricsConstants.PARENT_PRIMARIY_FILTER, containerId.getApplicationAttemptId().toString()); return entity; }
private void verifyAMCrashAtAllocatedDiagnosticInfo(String diagnostics, int exitCode, boolean shouldCheckURL) { assertTrue("Diagnostic information does not point the logs to the users", diagnostics.contains("logs")); assertTrue("Diagnostic information does not contain application attempt id", diagnostics.contains(applicationAttempt.getAppAttemptId().toString())); assertTrue("Diagnostic information does not contain application exit code", diagnostics.contains("exitCode: " + exitCode)); if (shouldCheckURL) { assertTrue("Diagnostic information does not contain application proxy URL", diagnostics.contains(applicationAttempt.getTrackingUrl())); } }
private static ContainerEntity createContainerEntity( ContainerId containerId) { ContainerEntity entity = new ContainerEntity(); entity.setId(containerId.toString()); Identifier parentIdentifier = new Identifier(); parentIdentifier .setType(TimelineEntityType.YARN_APPLICATION_ATTEMPT.name()); parentIdentifier.setId(containerId.getApplicationAttemptId().toString()); entity.setParent(parentIdentifier); return entity; }