use of org.apache.flink.runtime.io.network.partition.JobMasterPartitionTracker in project flink by apache.
the class Execution method handlePartitionCleanup.
void handlePartitionCleanup(boolean releasePipelinedPartitions, boolean releaseBlockingPartitions) {
if (releasePipelinedPartitions) {
sendReleaseIntermediateResultPartitionsRpcCall();
}
final Collection<ResultPartitionID> partitionIds = getPartitionIds();
final JobMasterPartitionTracker partitionTracker = getVertex().getExecutionGraphAccessor().getPartitionTracker();
if (!partitionIds.isEmpty()) {
if (releaseBlockingPartitions) {
LOG.info("Discarding the results produced by task execution {}.", attemptId);
partitionTracker.stopTrackingAndReleasePartitions(partitionIds);
} else {
partitionTracker.stopTrackingPartitions(partitionIds);
}
}
}
use of org.apache.flink.runtime.io.network.partition.JobMasterPartitionTracker in project flink by apache.
the class DefaultExecutionGraphFactory method createAndRestoreExecutionGraph.
@Override
public ExecutionGraph createAndRestoreExecutionGraph(JobGraph jobGraph, CompletedCheckpointStore completedCheckpointStore, CheckpointsCleaner checkpointsCleaner, CheckpointIDCounter checkpointIdCounter, TaskDeploymentDescriptorFactory.PartitionLocationConstraint partitionLocationConstraint, long initializationTimestamp, VertexAttemptNumberStore vertexAttemptNumberStore, VertexParallelismStore vertexParallelismStore, ExecutionStateUpdateListener executionStateUpdateListener, Logger log) throws Exception {
ExecutionDeploymentListener executionDeploymentListener = new ExecutionDeploymentTrackerDeploymentListenerAdapter(executionDeploymentTracker);
ExecutionStateUpdateListener combinedExecutionStateUpdateListener = (execution, previousState, newState) -> {
executionStateUpdateListener.onStateUpdate(execution, previousState, newState);
if (newState.isTerminal()) {
executionDeploymentTracker.stopTrackingDeploymentOf(execution);
}
};
final ExecutionGraph newExecutionGraph = DefaultExecutionGraphBuilder.buildGraph(jobGraph, configuration, futureExecutor, ioExecutor, userCodeClassLoader, completedCheckpointStore, checkpointsCleaner, checkpointIdCounter, rpcTimeout, blobWriter, log, shuffleMaster, jobMasterPartitionTracker, partitionLocationConstraint, executionDeploymentListener, combinedExecutionStateUpdateListener, initializationTimestamp, vertexAttemptNumberStore, vertexParallelismStore, checkpointStatsTrackerFactory, isDynamicGraph);
final CheckpointCoordinator checkpointCoordinator = newExecutionGraph.getCheckpointCoordinator();
if (checkpointCoordinator != null) {
// check whether we find a valid checkpoint
if (!checkpointCoordinator.restoreInitialCheckpointIfPresent(new HashSet<>(newExecutionGraph.getAllVertices().values()))) {
// check whether we can restore from a savepoint
tryRestoreExecutionGraphFromSavepoint(newExecutionGraph, jobGraph.getSavepointRestoreSettings());
}
}
return newExecutionGraph;
}
Aggregations