@Override public TaskAttemptReport getReport() { TaskAttemptReport result = recordFactory.newRecordInstance(TaskAttemptReport.class); readLock.lock(); try { result.setTaskAttemptId(attemptId); //take the LOCAL state of attempt //DO NOT take from reportedStatus result.setTaskAttemptState(getState()); result.setProgress(reportedStatus.progress); result.setStartTime(launchTime); result.setFinishTime(finishTime); result.setShuffleFinishTime(this.reportedStatus.shuffleFinishTime); result.setDiagnosticInfo(StringUtils.join(LINE_SEPARATOR, getDiagnostics())); result.setPhase(reportedStatus.phase); result.setStateString(reportedStatus.stateString); result.setCounters(TypeConverter.toYarn(getCounters())); result.setContainerId(this.getAssignedContainerID()); result.setNodeManagerHost(trackerName); result.setNodeManagerHttpPort(httpPort); if (this.container != null) { result.setNodeManagerPort(this.container.getNodeId().getPort()); } return result; } finally { readLock.unlock(); } }
public TaskAttemptInfo(TaskAttempt ta, TaskType type, Boolean isRunning) { final TaskAttemptReport report = ta.getReport(); this.type = type.toString(); this.id = MRApps.toString(ta.getID()); this.nodeHttpAddress = ta.getNodeHttpAddress(); this.startTime = report.getStartTime(); this.finishTime = report.getFinishTime(); this.assignedContainerId = ConverterUtils.toString(report.getContainerId()); this.assignedContainer = report.getContainerId(); this.progress = report.getProgress() * 100; this.status = report.getStateString(); this.state = report.getTaskAttemptState(); this.elapsedTime = Times .elapsed(this.startTime, this.finishTime, isRunning); if (this.elapsedTime == -1) { this.elapsedTime = 0; } this.diagnostics = report.getDiagnosticInfo(); this.rack = ta.getNodeRackName(); }
public static TaskAttemptReport newTaskAttemptReport(TaskAttemptId id) { ApplicationAttemptId appAttemptId = ApplicationAttemptId.newInstance( id.getTaskId().getJobId().getAppId(), 0); ContainerId containerId = ContainerId.newContainerId(appAttemptId, 0); TaskAttemptReport report = Records.newRecord(TaskAttemptReport.class); report.setTaskAttemptId(id); report .setStartTime(System.currentTimeMillis() - (int) (Math.random() * DT)); report.setFinishTime(System.currentTimeMillis() + (int) (Math.random() * DT) + 1); if (id.getTaskId().getTaskType() == TaskType.REDUCE) { report.setShuffleFinishTime( (report.getFinishTime() + report.getStartTime()) / 2); report.setSortFinishTime( (report.getFinishTime() + report.getShuffleFinishTime()) / 2); } report.setPhase(PHASES.next()); report.setTaskAttemptState(TASK_ATTEMPT_STATES.next()); report.setProgress((float) Math.random()); report.setCounters(TypeConverter.toYarn(newCounters())); report.setContainerId(containerId); report.setDiagnosticInfo(DIAGS.next()); report.setStateString("Moving average " + Math.random()); return report; }
private void verifyTaskAttemptReport(TaskAttemptReport tar) { Assert.assertEquals(TaskAttemptState.RUNNING, tar.getTaskAttemptState()); Assert.assertNotNull("TaskAttemptReport is null", tar); Assert.assertEquals(MRApp.NM_HOST, tar.getNodeManagerHost()); Assert.assertEquals(MRApp.NM_PORT, tar.getNodeManagerPort()); Assert.assertEquals(MRApp.NM_HTTP_PORT, tar.getNodeManagerHttpPort()); Assert.assertEquals(1, tar.getContainerId().getApplicationAttemptId() .getAttemptId()); }
GetTaskAttemptReportRequest.class, taRequest)) .getTaskAttemptReport(); if (taReport.getContainerId() == null || taReport.getNodeManagerHost() == null) { throw new IOException("Unable to get log information for task: " + oldTaskAttemptID); taReport.getContainerId().toString(), taReport.getContainerId().getApplicationAttemptId() .getApplicationId().toString(), NodeId.newInstance(taReport.getNodeManagerHost(), taReport.getNodeManagerPort()).toString(), report.getUser()); } else { if (report.getAMInfos() == null || report.getAMInfos().size() == 0) {
GetTaskAttemptReportRequest.class, taRequest)) .getTaskAttemptReport(); if (taReport.getContainerId() == null || taReport.getNodeManagerHost() == null) { throw new IOException("Unable to get log information for task: " + oldTaskAttemptID); taReport.getContainerId().toString(), taReport.getContainerId().getApplicationAttemptId() .getApplicationId().toString(), NodeId.newInstance(taReport.getNodeManagerHost(), taReport.getNodeManagerPort()).toString(), report.getUser()); } else { if (report.getAMInfos() == null || report.getAMInfos().size() == 0) {
@Override public TaskAttemptReport getReport() { TaskAttemptReport result = recordFactory.newRecordInstance(TaskAttemptReport.class); readLock.lock(); try { result.setTaskAttemptId(attemptId); //take the LOCAL state of attempt //DO NOT take from reportedStatus result.setTaskAttemptState(getState()); result.setProgress(reportedStatus.progress); result.setStartTime(launchTime); result.setFinishTime(finishTime); result.setShuffleFinishTime(this.reportedStatus.shuffleFinishTime); result.setDiagnosticInfo(StringUtils.join(LINE_SEPARATOR, getDiagnostics())); result.setPhase(reportedStatus.phase); result.setStateString(reportedStatus.stateString); result.setCounters(TypeConverter.toYarn(getCounters())); result.setContainerId(this.getAssignedContainerID()); result.setNodeManagerHost(trackerName); result.setNodeManagerHttpPort(httpPort); if (this.container != null) { result.setNodeManagerPort(this.container.getNodeId().getPort()); } return result; } finally { readLock.unlock(); } }
public TaskAttemptInfo(TaskAttempt ta, TaskType type, Boolean isRunning) { final TaskAttemptReport report = ta.getReport(); this.type = type.toString(); this.id = MRApps.toString(ta.getID()); this.nodeHttpAddress = ta.getNodeHttpAddress(); this.startTime = report.getStartTime(); this.finishTime = report.getFinishTime(); this.assignedContainer = report.getContainerId(); if (assignedContainer != null) { this.assignedContainerId = assignedContainer.toString(); } this.progress = report.getProgress() * 100; this.status = report.getStateString(); this.state = report.getTaskAttemptState(); this.elapsedTime = Times .elapsed(this.startTime, this.finishTime, isRunning); if (this.elapsedTime == -1) { this.elapsedTime = 0; } this.diagnostics = report.getDiagnosticInfo(); this.rack = ta.getNodeRackName(); }
@Override public TaskAttemptReport getReport() { TaskAttemptReport result = recordFactory.newRecordInstance(TaskAttemptReport.class); readLock.lock(); try { result.setTaskAttemptId(attemptId); //take the LOCAL state of attempt //DO NOT take from reportedStatus result.setTaskAttemptState(getState()); result.setProgress(reportedStatus.progress); result.setStartTime(launchTime); result.setFinishTime(finishTime); result.setShuffleFinishTime(this.reportedStatus.shuffleFinishTime); result.setDiagnosticInfo(StringUtils.join(LINE_SEPARATOR, getDiagnostics())); result.setPhase(reportedStatus.phase); result.setStateString(reportedStatus.stateString); result.setCounters(TypeConverter.toYarn(getCounters())); result.setContainerId(this.getAssignedContainerID()); result.setNodeManagerHost(trackerName); result.setNodeManagerHttpPort(httpPort); if (this.container != null) { result.setNodeManagerPort(this.container.getNodeId().getPort()); } return result; } finally { readLock.unlock(); } }
public TaskAttemptInfo(TaskAttempt ta, TaskType type, Boolean isRunning) { final TaskAttemptReport report = ta.getReport(); this.type = type.toString(); this.id = MRApps.toString(ta.getID()); this.nodeHttpAddress = ta.getNodeHttpAddress(); this.startTime = report.getStartTime(); this.finishTime = report.getFinishTime(); this.assignedContainer = report.getContainerId(); if (assignedContainer != null) { this.assignedContainerId = assignedContainer.toString(); } this.progress = report.getProgress() * 100; this.status = report.getStateString(); this.state = report.getTaskAttemptState(); this.elapsedTime = Times .elapsed(this.startTime, this.finishTime, isRunning); if (this.elapsedTime == -1) { this.elapsedTime = 0; } this.diagnostics = report.getDiagnosticInfo(); this.rack = ta.getNodeRackName(); }
private void constructTaskAttemptReport() { report = Records.newRecord(TaskAttemptReport.class); report.setTaskAttemptId(attemptId); report.setTaskAttemptState(state); report.setProgress(getProgress()); report.setStartTime(attemptInfo.getStartTime()); report.setFinishTime(attemptInfo.getFinishTime()); report.setShuffleFinishTime(attemptInfo.getShuffleFinishTime()); report.setSortFinishTime(attemptInfo.getSortFinishTime()); if (localDiagMessage != null) { report .setDiagnosticInfo(attemptInfo.getError() + ", " + localDiagMessage); } else { report.setDiagnosticInfo(attemptInfo.getError()); } // report.setPhase(attemptInfo.get); //TODO report.setStateString(attemptInfo.getState()); report.setRawCounters(getCounters()); report.setContainerId(attemptInfo.getContainerId()); if (attemptInfo.getHostname() == null) { report.setNodeManagerHost("UNKNOWN"); } else { report.setNodeManagerHost(attemptInfo.getHostname()); report.setNodeManagerPort(attemptInfo.getPort()); } report.setNodeManagerHttpPort(attemptInfo.getHttpPort()); } }
private void constructTaskAttemptReport() { report = Records.newRecord(TaskAttemptReport.class); report.setTaskAttemptId(attemptId); report.setTaskAttemptState(state); report.setProgress(getProgress()); report.setStartTime(attemptInfo.getStartTime()); report.setFinishTime(attemptInfo.getFinishTime()); report.setShuffleFinishTime(attemptInfo.getShuffleFinishTime()); report.setSortFinishTime(attemptInfo.getSortFinishTime()); if (localDiagMessage != null) { report .setDiagnosticInfo(attemptInfo.getError() + ", " + localDiagMessage); } else { report.setDiagnosticInfo(attemptInfo.getError()); } // report.setPhase(attemptInfo.get); //TODO report.setStateString(attemptInfo.getState()); report.setCounters(TypeConverter.toYarn(getCounters())); report.setContainerId(attemptInfo.getContainerId()); if (attemptInfo.getHostname() == null) { report.setNodeManagerHost("UNKNOWN"); } else { report.setNodeManagerHost(attemptInfo.getHostname()); report.setNodeManagerPort(attemptInfo.getPort()); } report.setNodeManagerHttpPort(attemptInfo.getHttpPort()); } }
private void constructTaskAttemptReport() { report = Records.newRecord(TaskAttemptReport.class); report.setTaskAttemptId(attemptId); report.setTaskAttemptState(state); report.setProgress(getProgress()); report.setStartTime(attemptInfo.getStartTime()); report.setFinishTime(attemptInfo.getFinishTime()); report.setShuffleFinishTime(attemptInfo.getShuffleFinishTime()); report.setSortFinishTime(attemptInfo.getSortFinishTime()); if (localDiagMessage != null) { report .setDiagnosticInfo(attemptInfo.getError() + ", " + localDiagMessage); } else { report.setDiagnosticInfo(attemptInfo.getError()); } // report.setPhase(attemptInfo.get); //TODO report.setStateString(attemptInfo.getState()); report.setCounters(TypeConverter.toYarn(getCounters())); report.setContainerId(attemptInfo.getContainerId()); if (attemptInfo.getHostname() == null) { report.setNodeManagerHost("UNKNOWN"); } else { report.setNodeManagerHost(attemptInfo.getHostname()); report.setNodeManagerPort(attemptInfo.getPort()); } report.setNodeManagerHttpPort(attemptInfo.getHttpPort()); } }