本文整理汇总了Java中org.apache.flink.runtime.executiongraph.ExecutionVertex.getCurrentExecutionAttempt方法的典型用法代码示例。如果您正苦于以下问题:Java ExecutionVertex.getCurrentExecutionAttempt方法的具体用法?Java ExecutionVertex.getCurrentExecutionAttempt怎么用?Java ExecutionVertex.getCurrentExecutionAttempt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.flink.runtime.executiongraph.ExecutionVertex
的用法示例。
在下文中一共展示了ExecutionVertex.getCurrentExecutionAttempt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeJsonForArchivedJobGroupvertex
import org.apache.flink.runtime.executiongraph.ExecutionVertex; //导入方法依赖的package包/类
/**
* Writes info about one particular archived JobVertex in a job, including all member execution vertices, their times and statuses.
*/
private void writeJsonForArchivedJobGroupvertex(PrintWriter wrt, RecentJobEvent jobEvent, JobVertexID vertexId) {
try {
ExecutionGraph graph = jobmanager.getRecentExecutionGraph(jobEvent.getJobID());
ExecutionJobVertex jobVertex = graph.getJobVertex(vertexId);
// Serialize ManagementGraph to json
wrt.write("{\"groupvertex\": " + JsonFactory.toJson(jobVertex) + ",");
wrt.write("\"verticetimes\": {");
boolean first = true;
for (ExecutionJobVertex groupVertex : graph.getAllVertices().values()) {
for (ExecutionVertex vertex : groupVertex.getTaskVertices()) {
Execution exec = vertex.getCurrentExecutionAttempt();
if(first) {
first = false;
} else {
wrt.write(","); }
wrt.write("\""+exec.getAttemptId() +"\": {");
wrt.write("\"vertexid\": \"" + exec.getAttemptId() + "\",");
wrt.write("\"vertexname\": \"" + vertex + "\",");
wrt.write("\"CREATED\": "+ vertex.getStateTimestamp(ExecutionState.CREATED) + ",");
wrt.write("\"SCHEDULED\": "+ vertex.getStateTimestamp(ExecutionState.SCHEDULED) + ",");
wrt.write("\"DEPLOYING\": "+ vertex.getStateTimestamp(ExecutionState.DEPLOYING) + ",");
wrt.write("\"RUNNING\": "+ vertex.getStateTimestamp(ExecutionState.RUNNING) + ",");
wrt.write("\"FINISHED\": "+ vertex.getStateTimestamp(ExecutionState.FINISHED) + ",");
wrt.write("\"CANCELING\": "+ vertex.getStateTimestamp(ExecutionState.CANCELING) + ",");
wrt.write("\"CANCELED\": "+ vertex.getStateTimestamp(ExecutionState.CANCELED) + ",");
wrt.write("\"FAILED\": "+ vertex.getStateTimestamp(ExecutionState.FAILED) + "");
wrt.write("}");
}
}
wrt.write("}}");
}
catch (IOException ioe) { // Connection closed by client
String message = "Info server for jobmanager: Connection closed by client - " + ioe.getClass().getSimpleName();
if (LOG.isDebugEnabled()) {
LOG.debug(message, ioe);
}
else if (LOG.isInfoEnabled()) {
LOG.info(message);
}
}
}