use of org.apache.flink.runtime.scheduler.ExecutionGraphHandler in project flink by apache.
the class StopWithSavepointTest method createStopWithSavepoint.
private StopWithSavepoint createStopWithSavepoint(MockStopWithSavepointContext ctx, CheckpointScheduling checkpointScheduling, ExecutionGraph executionGraph, CompletableFuture<String> savepointFuture) {
final ExecutionGraphHandler executionGraphHandler = new ExecutionGraphHandler(executionGraph, log, ctx.getMainThreadExecutor(), ctx.getMainThreadExecutor());
OperatorCoordinatorHandler operatorCoordinatorHandler = new TestingOperatorCoordinatorHandler();
executionGraph.transitionToRunning();
return new StopWithSavepoint(ctx, executionGraph, executionGraphHandler, operatorCoordinatorHandler, checkpointScheduling, log, ClassLoader.getSystemClassLoader(), savepointFuture, new ArrayList<>());
}
use of org.apache.flink.runtime.scheduler.ExecutionGraphHandler in project flink by apache.
the class CreatingExecutionGraph method handleExecutionGraphCreation.
private void handleExecutionGraphCreation(@Nullable ExecutionGraphWithVertexParallelism executionGraphWithVertexParallelism, @Nullable Throwable throwable) {
if (throwable != null) {
logger.info("Failed to go from {} to {} because the ExecutionGraph creation failed.", CreatingExecutionGraph.class.getSimpleName(), Executing.class.getSimpleName(), throwable);
context.goToFinished(context.getArchivedExecutionGraph(JobStatus.FAILED, throwable));
} else {
for (ExecutionVertex vertex : executionGraphWithVertexParallelism.executionGraph.getAllExecutionVertices()) {
vertex.getCurrentExecutionAttempt().transitionState(ExecutionState.SCHEDULED);
}
final AssignmentResult result = context.tryToAssignSlots(executionGraphWithVertexParallelism);
if (result.isSuccess()) {
logger.debug("Successfully reserved and assigned the required slots for the ExecutionGraph.");
final ExecutionGraph executionGraph = result.getExecutionGraph();
final ExecutionGraphHandler executionGraphHandler = new ExecutionGraphHandler(executionGraph, getLogger(), context.getIOExecutor(), context.getMainThreadExecutor());
// Operator coordinator outlives the current state, so we need to use context as a
// global failure handler.
final OperatorCoordinatorHandler operatorCoordinatorHandler = operatorCoordinatorHandlerFactory.create(executionGraph, context);
operatorCoordinatorHandler.initializeOperatorCoordinators(context.getMainThreadExecutor());
operatorCoordinatorHandler.startAllOperatorCoordinators();
context.goToExecuting(result.getExecutionGraph(), executionGraphHandler, operatorCoordinatorHandler, Collections.emptyList());
} else {
logger.debug("Failed to reserve and assign the required slots. Waiting for new resources.");
context.goToWaitingForResources();
}
}
}
use of org.apache.flink.runtime.scheduler.ExecutionGraphHandler in project flink by apache.
the class CancelingTest method createCancelingState.
private Canceling createCancelingState(MockStateWithExecutionGraphContext ctx, ExecutionGraph executionGraph) {
final ExecutionGraphHandler executionGraphHandler = new ExecutionGraphHandler(executionGraph, log, ctx.getMainThreadExecutor(), ctx.getMainThreadExecutor());
final OperatorCoordinatorHandler operatorCoordinatorHandler = new TestingOperatorCoordinatorHandler();
executionGraph.transitionToRunning();
Canceling canceling = new Canceling(ctx, executionGraph, executionGraphHandler, operatorCoordinatorHandler, log, ClassLoader.getSystemClassLoader(), new ArrayList<>());
return canceling;
}
use of org.apache.flink.runtime.scheduler.ExecutionGraphHandler in project flink by apache.
the class FailingTest method createFailingState.
private Failing createFailingState(MockFailingContext ctx, ExecutionGraph executionGraph) {
final ExecutionGraphHandler executionGraphHandler = new ExecutionGraphHandler(executionGraph, log, ctx.getMainThreadExecutor(), ctx.getMainThreadExecutor());
final OperatorCoordinatorHandler operatorCoordinatorHandler = new TestingOperatorCoordinatorHandler();
executionGraph.transitionToRunning();
return new Failing(ctx, executionGraph, executionGraphHandler, operatorCoordinatorHandler, log, testFailureCause, ClassLoader.getSystemClassLoader(), new ArrayList<>());
}
use of org.apache.flink.runtime.scheduler.ExecutionGraphHandler in project flink by apache.
the class RestartingTest method createRestartingState.
public Restarting createRestartingState(MockRestartingContext ctx, ExecutionGraph executionGraph) {
final ExecutionGraphHandler executionGraphHandler = new ExecutionGraphHandler(executionGraph, log, ctx.getMainThreadExecutor(), ctx.getMainThreadExecutor());
final OperatorCoordinatorHandler operatorCoordinatorHandler = new TestingOperatorCoordinatorHandler();
executionGraph.transitionToRunning();
return new Restarting(ctx, executionGraph, executionGraphHandler, operatorCoordinatorHandler, log, Duration.ZERO, ClassLoader.getSystemClassLoader(), new ArrayList<>());
}
Aggregations