Search in sources :

Example 1 with OperatorCoordinatorHandler

use of org.apache.flink.runtime.scheduler.OperatorCoordinatorHandler 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<>());
}
Also used : ExecutionGraphHandler(org.apache.flink.runtime.scheduler.ExecutionGraphHandler) OperatorCoordinatorHandler(org.apache.flink.runtime.scheduler.OperatorCoordinatorHandler)

Example 2 with OperatorCoordinatorHandler

use of org.apache.flink.runtime.scheduler.OperatorCoordinatorHandler 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();
        }
    }
}
Also used : ArchivedExecutionGraph(org.apache.flink.runtime.executiongraph.ArchivedExecutionGraph) ExecutionGraph(org.apache.flink.runtime.executiongraph.ExecutionGraph) ExecutionGraphHandler(org.apache.flink.runtime.scheduler.ExecutionGraphHandler) ExecutionVertex(org.apache.flink.runtime.executiongraph.ExecutionVertex) DefaultOperatorCoordinatorHandler(org.apache.flink.runtime.scheduler.DefaultOperatorCoordinatorHandler) OperatorCoordinatorHandler(org.apache.flink.runtime.scheduler.OperatorCoordinatorHandler)

Example 3 with OperatorCoordinatorHandler

use of org.apache.flink.runtime.scheduler.OperatorCoordinatorHandler 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;
}
Also used : ExecutionGraphHandler(org.apache.flink.runtime.scheduler.ExecutionGraphHandler) OperatorCoordinatorHandler(org.apache.flink.runtime.scheduler.OperatorCoordinatorHandler)

Example 4 with OperatorCoordinatorHandler

use of org.apache.flink.runtime.scheduler.OperatorCoordinatorHandler 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<>());
}
Also used : ExecutionGraphHandler(org.apache.flink.runtime.scheduler.ExecutionGraphHandler) OperatorCoordinatorHandler(org.apache.flink.runtime.scheduler.OperatorCoordinatorHandler)

Example 5 with OperatorCoordinatorHandler

use of org.apache.flink.runtime.scheduler.OperatorCoordinatorHandler 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<>());
}
Also used : ExecutionGraphHandler(org.apache.flink.runtime.scheduler.ExecutionGraphHandler) OperatorCoordinatorHandler(org.apache.flink.runtime.scheduler.OperatorCoordinatorHandler)

Aggregations

ExecutionGraphHandler (org.apache.flink.runtime.scheduler.ExecutionGraphHandler)5 OperatorCoordinatorHandler (org.apache.flink.runtime.scheduler.OperatorCoordinatorHandler)5 ArchivedExecutionGraph (org.apache.flink.runtime.executiongraph.ArchivedExecutionGraph)1 ExecutionGraph (org.apache.flink.runtime.executiongraph.ExecutionGraph)1 ExecutionVertex (org.apache.flink.runtime.executiongraph.ExecutionVertex)1 DefaultOperatorCoordinatorHandler (org.apache.flink.runtime.scheduler.DefaultOperatorCoordinatorHandler)1