use of org.apache.flink.runtime.scheduler.strategy.SchedulingResultPartition in project flink by apache.
the class DefaultExecutionGraph method createResultPartitionId.
ResultPartitionID createResultPartitionId(final IntermediateResultPartitionID resultPartitionId) {
final SchedulingResultPartition schedulingResultPartition = getSchedulingTopology().getResultPartition(resultPartitionId);
final SchedulingExecutionVertex producer = schedulingResultPartition.getProducer();
final ExecutionVertexID producerId = producer.getId();
final JobVertexID jobVertexId = producerId.getJobVertexId();
final ExecutionJobVertex jobVertex = getJobVertex(jobVertexId);
checkNotNull(jobVertex, "Unknown job vertex %s", jobVertexId);
final ExecutionVertex[] taskVertices = jobVertex.getTaskVertices();
final int subtaskIndex = producerId.getSubtaskIndex();
checkState(subtaskIndex < taskVertices.length, "Invalid subtask index %d for job vertex %s", subtaskIndex, jobVertexId);
final ExecutionVertex taskVertex = taskVertices[subtaskIndex];
final Execution execution = taskVertex.getCurrentExecutionAttempt();
return new ResultPartitionID(resultPartitionId, execution.getAttemptId());
}
use of org.apache.flink.runtime.scheduler.strategy.SchedulingResultPartition in project flink by apache.
the class SchedulingPipelinedRegionComputeUtil method getNonReconnectableConsumedResults.
private static Iterable<SchedulingResultPartition> getNonReconnectableConsumedResults(SchedulingExecutionVertex vertex, Function<IntermediateResultPartitionID, ? extends SchedulingResultPartition> resultPartitionRetriever) {
List<SchedulingResultPartition> nonReconnectableConsumedResults = new ArrayList<>();
for (ConsumedPartitionGroup consumedPartitionGroup : vertex.getConsumedPartitionGroups()) {
for (IntermediateResultPartitionID partitionId : consumedPartitionGroup) {
SchedulingResultPartition consumedResult = resultPartitionRetriever.apply(partitionId);
if (consumedResult.getResultType().isReconnectable()) {
// The result types of partitions in one ConsumedPartitionGroup are all the same
break;
}
nonReconnectableConsumedResults.add(consumedResult);
}
}
return nonReconnectableConsumedResults;
}
Aggregations