use of org.apache.flink.runtime.executiongraph.AccessExecutionJobVertex in project flink by apache.
the class SubtaskExecutionAttemptDetailsHandlerTest method testArchiver.
@Test
public void testArchiver() throws Exception {
JsonArchivist archivist = new SubtaskExecutionAttemptDetailsHandler.SubtaskExecutionAttemptDetailsJsonArchivist();
AccessExecutionGraph originalJob = ArchivedJobGenerationUtils.getTestJob();
AccessExecutionJobVertex originalTask = ArchivedJobGenerationUtils.getTestTask();
AccessExecution originalAttempt = ArchivedJobGenerationUtils.getTestAttempt();
Collection<ArchivedJson> archives = archivist.archiveJsonWithPath(originalJob);
Assert.assertEquals(2, archives.size());
Iterator<ArchivedJson> iterator = archives.iterator();
ArchivedJson archive1 = iterator.next();
Assert.assertEquals("/jobs/" + originalJob.getJobID() + "/vertices/" + originalTask.getJobVertexId() + "/subtasks/" + originalAttempt.getParallelSubtaskIndex(), archive1.getPath());
compareAttemptDetails(originalAttempt, archive1.getJson());
ArchivedJson archive2 = iterator.next();
Assert.assertEquals("/jobs/" + originalJob.getJobID() + "/vertices/" + originalTask.getJobVertexId() + "/subtasks/" + originalAttempt.getParallelSubtaskIndex() + "/attempts/" + originalAttempt.getAttemptNumber(), archive2.getPath());
compareAttemptDetails(originalAttempt, archive2.getJson());
}
use of org.apache.flink.runtime.executiongraph.AccessExecutionJobVertex in project flink by apache.
the class SubtasksAllAccumulatorsHandlerTest method testArchiver.
@Test
public void testArchiver() throws Exception {
JsonArchivist archivist = new SubtasksAllAccumulatorsHandler.SubtasksAllAccumulatorsJsonArchivist();
AccessExecutionGraph originalJob = ArchivedJobGenerationUtils.getTestJob();
AccessExecutionJobVertex originalTask = ArchivedJobGenerationUtils.getTestTask();
Collection<ArchivedJson> archives = archivist.archiveJsonWithPath(originalJob);
Assert.assertEquals(1, archives.size());
ArchivedJson archive = archives.iterator().next();
Assert.assertEquals("/jobs/" + originalJob.getJobID() + "/vertices/" + originalTask.getJobVertexId() + "/subtasks/accumulators", archive.getPath());
compareSubtaskAccumulators(originalTask, archive.getJson());
}
use of org.apache.flink.runtime.executiongraph.AccessExecutionJobVertex in project flink by apache.
the class WebMonitorUtils method createDetailsForJob.
public static JobDetails createDetailsForJob(AccessExecutionGraph job) {
JobStatus status = job.getState();
long started = job.getStatusTimestamp(JobStatus.CREATED);
long finished = status.isGloballyTerminalState() ? job.getStatusTimestamp(status) : -1L;
int[] countsPerStatus = new int[ExecutionState.values().length];
long lastChanged = 0;
int numTotalTasks = 0;
for (AccessExecutionJobVertex ejv : job.getVerticesTopologically()) {
AccessExecutionVertex[] vertices = ejv.getTaskVertices();
numTotalTasks += vertices.length;
for (AccessExecutionVertex vertex : vertices) {
ExecutionState state = vertex.getExecutionState();
countsPerStatus[state.ordinal()]++;
lastChanged = Math.max(lastChanged, vertex.getStateTimestamp(state));
}
}
lastChanged = Math.max(lastChanged, finished);
return new JobDetails(job.getJobID(), job.getJobName(), started, finished, status, lastChanged, countsPerStatus, numTotalTasks);
}
Aggregations