Java Code Examples for org.apache.flink.runtime.executiongraph.ExecutionGraph#getTotalNumberOfVertices()
The following examples show how to use
org.apache.flink.runtime.executiongraph.ExecutionGraph#getTotalNumberOfVertices() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExecutionGraphToSchedulingTopologyAdapter.java From flink with Apache License 2.0 | 6 votes |
public ExecutionGraphToSchedulingTopologyAdapter(ExecutionGraph graph) { checkNotNull(graph, "execution graph can not be null"); this.executionVerticesById = new HashMap<>(); this.executionVerticesList = new ArrayList<>(graph.getTotalNumberOfVertices()); Map<IntermediateResultPartitionID, DefaultSchedulingResultPartition> tmpResultPartitionsById = new HashMap<>(); Map<ExecutionVertex, DefaultSchedulingExecutionVertex> executionVertexMap = new HashMap<>(); for (ExecutionVertex vertex : graph.getAllExecutionVertices()) { List<DefaultSchedulingResultPartition> producedPartitions = generateProducedSchedulingResultPartition(vertex.getProducedPartitions()); producedPartitions.forEach(partition -> tmpResultPartitionsById.put(partition.getId(), partition)); DefaultSchedulingExecutionVertex schedulingVertex = generateSchedulingExecutionVertex(vertex, producedPartitions); this.executionVerticesById.put(schedulingVertex.getId(), schedulingVertex); this.executionVerticesList.add(schedulingVertex); executionVertexMap.put(vertex, schedulingVertex); } this.resultPartitionsById = tmpResultPartitionsById; connectVerticesToConsumedPartitions(executionVertexMap, tmpResultPartitionsById); }
Example 2
Source File: DefaultExecutionTopology.java From flink with Apache License 2.0 | 5 votes |
public DefaultExecutionTopology(ExecutionGraph graph) { checkNotNull(graph, "execution graph can not be null"); this.containsCoLocationConstraints = graph.getAllVertices().values().stream() .map(ExecutionJobVertex::getCoLocationGroup) .anyMatch(Objects::nonNull); this.executionVerticesById = new HashMap<>(); this.executionVerticesList = new ArrayList<>(graph.getTotalNumberOfVertices()); Map<IntermediateResultPartitionID, DefaultResultPartition> tmpResultPartitionsById = new HashMap<>(); Map<ExecutionVertex, DefaultExecutionVertex> executionVertexMap = new HashMap<>(); for (ExecutionVertex vertex : graph.getAllExecutionVertices()) { List<DefaultResultPartition> producedPartitions = generateProducedSchedulingResultPartition(vertex.getProducedPartitions()); producedPartitions.forEach(partition -> tmpResultPartitionsById.put(partition.getId(), partition)); DefaultExecutionVertex schedulingVertex = generateSchedulingExecutionVertex(vertex, producedPartitions); this.executionVerticesById.put(schedulingVertex.getId(), schedulingVertex); this.executionVerticesList.add(schedulingVertex); executionVertexMap.put(vertex, schedulingVertex); } this.resultPartitionsById = tmpResultPartitionsById; connectVerticesToConsumedPartitions(executionVertexMap, tmpResultPartitionsById); this.pipelinedRegionsByVertex = new HashMap<>(); this.pipelinedRegions = new ArrayList<>(); initializePipelinedRegions(); }