use of org.apache.flink.runtime.webmonitor.history.ArchivedJson in project flink by apache.
the class JobsOverviewHandler method archiveJsonWithPath.
@Override
public Collection<ArchivedJson> archiveJsonWithPath(AccessExecutionGraph graph) throws IOException {
ResponseBody json = new MultipleJobsDetails(Collections.singleton(JobDetails.createDetailsForJob(graph)));
String path = getMessageHeaders().getTargetRestEndpointURL().replace(':' + JobIDPathParameter.KEY, graph.getJobID().toString());
return Collections.singletonList(new ArchivedJson(path, json));
}
use of org.apache.flink.runtime.webmonitor.history.ArchivedJson in project flink by apache.
the class SubtaskExecutionAttemptAccumulatorsHandler method archiveJsonWithPath.
@Override
public Collection<ArchivedJson> archiveJsonWithPath(AccessExecutionGraph graph) throws IOException {
List<ArchivedJson> archive = new ArrayList<>(16);
for (AccessExecutionJobVertex task : graph.getAllVertices().values()) {
for (AccessExecutionVertex subtask : task.getTaskVertices()) {
ResponseBody curAttemptJson = createAccumulatorInfo(subtask.getCurrentExecutionAttempt());
String curAttemptPath = getMessageHeaders().getTargetRestEndpointURL().replace(':' + JobIDPathParameter.KEY, graph.getJobID().toString()).replace(':' + JobVertexIdPathParameter.KEY, task.getJobVertexId().toString()).replace(':' + SubtaskIndexPathParameter.KEY, String.valueOf(subtask.getParallelSubtaskIndex())).replace(':' + SubtaskAttemptPathParameter.KEY, String.valueOf(subtask.getCurrentExecutionAttempt().getAttemptNumber()));
archive.add(new ArchivedJson(curAttemptPath, curAttemptJson));
for (int x = 0; x < subtask.getCurrentExecutionAttempt().getAttemptNumber(); x++) {
AccessExecution attempt = subtask.getPriorExecutionAttempt(x);
if (attempt != null) {
ResponseBody json = createAccumulatorInfo(attempt);
String path = getMessageHeaders().getTargetRestEndpointURL().replace(':' + JobIDPathParameter.KEY, graph.getJobID().toString()).replace(':' + JobVertexIdPathParameter.KEY, task.getJobVertexId().toString()).replace(':' + SubtaskIndexPathParameter.KEY, String.valueOf(subtask.getParallelSubtaskIndex())).replace(':' + SubtaskAttemptPathParameter.KEY, String.valueOf(attempt.getAttemptNumber()));
archive.add(new ArchivedJson(path, json));
}
}
}
}
return archive;
}
use of org.apache.flink.runtime.webmonitor.history.ArchivedJson in project flink by apache.
the class TaskCheckpointStatisticDetailsHandler method archiveJsonWithPath.
@Override
public Collection<ArchivedJson> archiveJsonWithPath(AccessExecutionGraph graph) throws IOException {
CheckpointStatsSnapshot stats = graph.getCheckpointStatsSnapshot();
if (stats == null) {
return Collections.emptyList();
}
CheckpointStatsHistory history = stats.getHistory();
List<ArchivedJson> archive = new ArrayList<>(history.getCheckpoints().size());
for (AbstractCheckpointStats checkpoint : history.getCheckpoints()) {
for (TaskStateStats subtaskStats : checkpoint.getAllTaskStateStats()) {
ResponseBody json = createCheckpointDetails(checkpoint, subtaskStats);
String path = getMessageHeaders().getTargetRestEndpointURL().replace(':' + JobIDPathParameter.KEY, graph.getJobID().toString()).replace(':' + CheckpointIdPathParameter.KEY, String.valueOf(checkpoint.getCheckpointId())).replace(':' + JobVertexIdPathParameter.KEY, subtaskStats.getJobVertexId().toString());
archive.add(new ArchivedJson(path, json));
}
}
return archive;
}
use of org.apache.flink.runtime.webmonitor.history.ArchivedJson in project flink by apache.
the class JobVertexTaskManagersHandler method archiveJsonWithPath.
@Override
public Collection<ArchivedJson> archiveJsonWithPath(AccessExecutionGraph graph) throws IOException {
Collection<? extends AccessExecutionJobVertex> vertices = graph.getAllVertices().values();
List<ArchivedJson> archive = new ArrayList<>(vertices.size());
for (AccessExecutionJobVertex task : vertices) {
ResponseBody json = createJobVertexTaskManagersInfo(task, graph.getJobID(), null);
String path = getMessageHeaders().getTargetRestEndpointURL().replace(':' + JobIDPathParameter.KEY, graph.getJobID().toString()).replace(':' + JobVertexIdPathParameter.KEY, task.getJobVertexId().toString());
archive.add(new ArchivedJson(path, json));
}
return archive;
}
use of org.apache.flink.runtime.webmonitor.history.ArchivedJson in project flink by apache.
the class WebMonitorEndpoint method archiveJsonWithPath.
@Override
public Collection<ArchivedJson> archiveJsonWithPath(ExecutionGraphInfo executionGraphInfo) throws IOException {
Collection<ArchivedJson> archivedJson = new ArrayList<>(archivingHandlers.size());
for (JsonArchivist archivist : archivingHandlers) {
Collection<ArchivedJson> subArchive = archivist.archiveJsonWithPath(executionGraphInfo);
archivedJson.addAll(subArchive);
}
return archivedJson;
}
Aggregations