当前位置: 首页>>代码示例>>Java>>正文


Java ExecutionVertex.getCurrentExecutionAttempt方法代码示例

本文整理汇总了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);
		}
	} 
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:55,代码来源:JobmanagerInfoServlet.java


注:本文中的org.apache.flink.runtime.executiongraph.ExecutionVertex.getCurrentExecutionAttempt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。