Class CreatingExecutionGraph
java.lang.Object
org.apache.flink.runtime.scheduler.adaptive.CreatingExecutionGraph
- All Implemented Interfaces:
LabeledGlobalFailureHandler
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 Summary
ConstructorsConstructorDescriptionCreatingExecutionGraph(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, ExecutionGraph previousExecutionGraph) -
Method Summary
Modifier and TypeMethodDescriptiondefault <T> Optional<T>Tries to cast this state into a type of the given clazz.voidcancel()getJob()org.apache.flink.api.common.JobIDgetJobId()org.apache.flink.api.common.JobStatusorg.slf4j.LoggervoidhandleGlobalFailure(Throwable cause, CompletableFuture<Map<String, String>> failureLabels) An adapted version ofGlobalFailureHandlerthat handles and associates global failures with enricher labels.default voidThis method is called whenever one transitions out of this state.voidtryCall(Class<? extends T> clazz, org.apache.flink.util.function.FunctionWithException<T, V, E> action, String debugMessage) Tries to run the action if this state is of type clazz.default <T,E extends Exception>
voidtryRun(Class<? extends T> clazz, org.apache.flink.util.function.ThrowingConsumer<T, E> action, String debugMessage) Tries to run the action if this state is of type clazz.default <T,E extends Exception>
voidtryRun(Class<? extends T> clazz, org.apache.flink.util.function.ThrowingConsumer<T, E> action, Consumer<org.slf4j.Logger> invalidStateCallback) Tries to run the action if this state is of type clazz.
-
Constructor Details
-
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 Details
-
getJobStatus
public org.apache.flink.api.common.JobStatus getJobStatus() -
cancel
public void cancel() -
suspend
-
getJobId
public org.apache.flink.api.common.JobID getJobId() -
getJob
-
handleGlobalFailure
public void handleGlobalFailure(Throwable cause, CompletableFuture<Map<String, String>> failureLabels) Description copied from interface:LabeledGlobalFailureHandlerAn adapted version ofGlobalFailureHandlerthat handles and associates global failures with enricher labels.- Specified by:
handleGlobalFailurein interfaceLabeledGlobalFailureHandler- Parameters:
cause- A cause that describes the global failure.failureLabels- Labels providing an additional context about the failure.
-
getLogger
public org.slf4j.Logger getLogger() -
onLeave
This method is called whenever one transitions out of this state.- Parameters:
newState- newState is the state into which the scheduler transitions
-
as
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; otherwiseOptional.empty()
-
tryRun
default <T,E extends Exception> void tryRun(Class<? extends T> clazz, org.apache.flink.util.function.ThrowingConsumer<T, E> action, String debugMessage) throws ETries to run the action if this state is of type clazz.- Type Parameters:
T- target typeE- error type- Parameters:
clazz- clazz describes the target typeaction- action to run if this state is of the target typedebugMessage- debugMessage which is printed if this state is not the target type- Throws:
E- an exception if the action fails
-
tryRun
default <T,E extends Exception> void tryRun(Class<? extends T> clazz, org.apache.flink.util.function.ThrowingConsumer<T, E> action, Consumer<org.slf4j.Logger> invalidStateCallback) throws ETries to run the action if this state is of type clazz.- Type Parameters:
T- target typeE- error type- Parameters:
clazz- clazz describes the target typeaction- action to run if this state is of the target typeinvalidStateCallback- that is called if the state isn't matching the expected one.- Throws:
E- an exception if the action fails
-
tryCall
default <T,V, Optional<V> tryCallE extends Exception> (Class<? extends T> clazz, org.apache.flink.util.function.FunctionWithException<T, V, throws EE> action, String debugMessage) Tries to run the action if this state is of type clazz.- Type Parameters:
T- target typeV- value typeE- error type- Parameters:
clazz- clazz describes the target typeaction- action to run if this state is of the target typedebugMessage- debugMessage which is printed if this state is not the target type- Returns:
Optional.of(T)the action result if it is successfully executed; otherwiseOptional.empty()- Throws:
E- an exception if the action fails
-