本文整理汇总了Java中org.apache.flink.runtime.executiongraph.ExecutionVertex.getCurrentAssignedResource方法的典型用法代码示例。如果您正苦于以下问题:Java ExecutionVertex.getCurrentAssignedResource方法的具体用法?Java ExecutionVertex.getCurrentAssignedResource怎么用?Java ExecutionVertex.getCurrentAssignedResource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.flink.runtime.executiongraph.ExecutionVertex
的用法示例。
在下文中一共展示了ExecutionVertex.getCurrentAssignedResource方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getInstanceSummaryProfilingData
import org.apache.flink.runtime.executiongraph.ExecutionVertex; //导入方法依赖的package包/类
public InstanceSummaryProfilingEvent getInstanceSummaryProfilingData(long timestamp) {
final Set<Instance> tempSet = new HashSet<Instance>();
for (ExecutionVertex executionVertex : this.executionGraph.getAllExecutionVertices()) {
AllocatedSlot slot = executionVertex.getCurrentAssignedResource();
if (slot != null) {
tempSet.add(slot.getInstance());
}
}
// Now compare the size of the collected data set and the allocated instance set.
// If their sizes are equal we can issue an instance summary.
if (tempSet.size() != this.collectedInstanceProfilingData.size()) {
return null;
}
return constructInstanceSummary(timestamp);
}
示例2: addIfInstanceIsAllocatedByJob
import org.apache.flink.runtime.executiongraph.ExecutionVertex; //导入方法依赖的package包/类
public boolean addIfInstanceIsAllocatedByJob(InternalInstanceProfilingData instanceProfilingData) {
for (ExecutionVertex executionVertex : this.executionGraph.getAllExecutionVertices()) {
AllocatedSlot slot = executionVertex.getCurrentAssignedResource();
if (slot != null && slot.getInstance().getInstanceConnectionInfo().equals(
instanceProfilingData.getInstanceConnectionInfo()))
{
this.collectedInstanceProfilingData.put(instanceProfilingData.getInstanceConnectionInfo(), instanceProfilingData);
return true;
}
}
return false;
}
示例3: toJson
import org.apache.flink.runtime.executiongraph.ExecutionVertex; //导入方法依赖的package包/类
public static String toJson(ExecutionVertex vertex) {
StringBuilder json = new StringBuilder("");
json.append("{");
json.append("\"vertexid\": \"" + vertex.getCurrentExecutionAttempt().getAttemptId() + "\",");
json.append("\"vertexname\": \"" + StringUtils.escapeHtml(vertex.getSimpleName()) + "\",");
json.append("\"vertexstatus\": \"" + vertex.getExecutionState() + "\",");
AllocatedSlot slot = vertex.getCurrentAssignedResource();
String instanceName = slot == null ? "(null)" : slot.getInstance().getInstanceConnectionInfo().getFQDNHostname();
json.append("\"vertexinstancename\": \"" + instanceName + "\"");
json.append("}");
return json.toString();
}