use of org.apache.flink.runtime.rest.messages.ResponseBody in project flink by apache.
the class JobVertexDetailsHandler 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 = createJobVertexDetailsInfo(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.rest.messages.ResponseBody in project flink by apache.
the class SubtaskExecutionAttemptDetailsHandler 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 = SubtaskExecutionAttemptDetailsInfo.create(subtask.getCurrentExecutionAttempt(), null, graph.getJobID(), task.getJobVertexId());
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 = SubtaskExecutionAttemptDetailsInfo.create(attempt, null, graph.getJobID(), task.getJobVertexId());
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.rest.messages.ResponseBody in project flink by apache.
the class SubtasksTimesHandler method archiveJsonWithPath.
@Override
public Collection<ArchivedJson> archiveJsonWithPath(AccessExecutionGraph graph) throws IOException {
Collection<? extends AccessExecutionJobVertex> allVertices = graph.getAllVertices().values();
List<ArchivedJson> archive = new ArrayList<>(allVertices.size());
for (AccessExecutionJobVertex task : allVertices) {
ResponseBody json = createSubtaskTimesInfo(task);
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.rest.messages.ResponseBody in project flink by apache.
the class CheckpointStatisticDetailsHandler 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()) {
ResponseBody json = CheckpointStatistics.generateCheckpointStatistics(checkpoint, true);
String path = getMessageHeaders().getTargetRestEndpointURL().replace(':' + JobIDPathParameter.KEY, graph.getJobID().toString()).replace(':' + CheckpointIdPathParameter.KEY, String.valueOf(checkpoint.getCheckpointId()));
archive.add(new ArchivedJson(path, json));
}
return archive;
}
use of org.apache.flink.runtime.rest.messages.ResponseBody in project flink by apache.
the class CheckpointingStatisticsHandler method archiveJsonWithPath.
@Override
public Collection<ArchivedJson> archiveJsonWithPath(AccessExecutionGraph graph) throws IOException {
ResponseBody json;
try {
json = createCheckpointingStatistics(graph);
} catch (RestHandlerException rhe) {
json = new ErrorResponseBody(rhe.getMessage());
}
String path = getMessageHeaders().getTargetRestEndpointURL().replace(':' + JobIDPathParameter.KEY, graph.getJobID().toString());
return Collections.singletonList(new ArchivedJson(path, json));
}
Aggregations