Class CreatingExecutionGraph

  • All Implemented Interfaces:
    LabeledGlobalFailureHandler

    public class CreatingExecutionGraph
    extends Object
    State which waits for the creation of the ExecutionGraph. If the creation fails, then the state transitions to Finished. If the creation succeeds, then the system tries to assign the required slots. If the set of available slots has changed so that the created ExecutionGraph cannot be executed, the state transitions back into WaitingForResources. If there are enough slots for the ExecutionGraph to run, the state transitions to Executing.
    • Constructor Detail

      • CreatingExecutionGraph

        public CreatingExecutionGraph​(org.apache.flink.runtime.scheduler.adaptive.CreatingExecutionGraph.Context context,
                                      CompletableFuture<org.apache.flink.runtime.scheduler.adaptive.CreatingExecutionGraph.ExecutionGraphWithVertexParallelism> executionGraphWithParallelismFuture,
                                      org.slf4j.Logger logger,
                                      org.apache.flink.runtime.scheduler.adaptive.CreatingExecutionGraph.OperatorCoordinatorHandlerFactory operatorCoordinatorFactory,
                                      @Nullable
                                      ExecutionGraph previousExecutionGraph)
    • Method Detail

      • getJobStatus

        public JobStatus getJobStatus()
      • cancel

        public void cancel()
      • suspend

        public void suspend​(Throwable cause)
      • getJobId

        public JobID getJobId()
      • getLogger

        public org.slf4j.Logger getLogger()
      • onLeave

        public default void onLeave​(Class<? extends org.apache.flink.runtime.scheduler.adaptive.State> newState)
        This method is called whenever one transitions out of this state.
        Parameters:
        newState - newState is the state into which the scheduler transitions
      • as

        public default <T> Optional<T> as​(Class<? extends T> clazz)
        Tries to cast this state into a type of the given clazz.
        Type Parameters:
        T - target type
        Parameters:
        clazz - clazz describes the target type
        Returns:
        Optional.of(T) target type if the underlying type can be cast into clazz; otherwise Optional.empty()
      • tryRun

        public default <T,​E extends Exception> void tryRun​(Class<? extends T> clazz,
                                                                 ThrowingConsumer<T,​E> action,
                                                                 String debugMessage)
                                                          throws E extends Exception
        Tries to run the action if this state is of type clazz.
        Type Parameters:
        T - target type
        E - error type
        Parameters:
        clazz - clazz describes the target type
        action - action to run if this state is of the target type
        debugMessage - debugMessage which is printed if this state is not the target type
        Throws:
        E - an exception if the action fails
        E extends Exception
      • tryRun

        public default <T,​E extends Exception> void tryRun​(Class<? extends T> clazz,
                                                                 ThrowingConsumer<T,​E> action,
                                                                 Consumer<org.slf4j.Logger> invalidStateCallback)
                                                          throws E extends Exception
        Tries to run the action if this state is of type clazz.
        Type Parameters:
        T - target type
        E - error type
        Parameters:
        clazz - clazz describes the target type
        action - action to run if this state is of the target type
        invalidStateCallback - that is called if the state isn't matching the expected one.
        Throws:
        E - an exception if the action fails
        E extends Exception
      • tryCall

        public default <T,​V,​E extends ExceptionOptional<V> tryCall​(Class<? extends T> clazz,
                                                                                 FunctionWithException<T,​V,​E> action,
                                                                                 String debugMessage)
                                                                          throws E extends Exception
        Tries to run the action if this state is of type clazz.
        Type Parameters:
        T - target type
        V - value type
        E - error type
        Parameters:
        clazz - clazz describes the target type
        action - action to run if this state is of the target type
        debugMessage - debugMessage which is printed if this state is not the target type
        Returns:
        Optional.of(T) the action result if it is successfully executed; otherwise Optional.empty()
        Throws:
        E - an exception if the action fails
        E extends Exception