public class CreatingExecutionGraph extends Object
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 and Description |
---|
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) |
Modifier and Type | Method and Description |
---|---|
default <T> Optional<T> |
as(Class<? extends T> clazz)
Tries to cast this state into a type of the given clazz.
|
void |
cancel()
Cancels the job execution.
|
ArchivedExecutionGraph |
getJob()
Gets the current
ArchivedExecutionGraph . |
JobStatus |
getJobStatus()
Gets the current
JobStatus . |
org.slf4j.Logger |
getLogger()
Gets the logger.
|
void |
handleGlobalFailure(Throwable cause)
Handles a global failure.
|
default void |
onLeave(Class<? extends org.apache.flink.runtime.scheduler.adaptive.State> newState)
This method is called whenever one transitions out of this state.
|
void |
suspend(Throwable cause)
Suspends the job execution.
|
default <T,V,E extends Exception> |
tryCall(Class<? extends T> clazz,
FunctionWithException<T,V,E> action,
String debugMessage)
Tries to run the action if this state is of type clazz.
|
default <T,E extends Exception> |
tryRun(Class<? extends T> clazz,
ThrowingConsumer<T,E> action,
String debugMessage)
Tries to run the action if this state is of type clazz.
|
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)
public void cancel()
public void suspend(Throwable cause)
cause
- cause for the suspensionpublic JobStatus getJobStatus()
JobStatus
. The returned job status will remain unchanged at least
until the scheduler transitions to a different state.JobStatus
public ArchivedExecutionGraph getJob()
ArchivedExecutionGraph
.ArchivedExecutionGraph
public void handleGlobalFailure(Throwable cause)
GlobalFailureHandler
cause
- A cause that describes the global failure.public org.slf4j.Logger getLogger()
public void onLeave(Class<? extends org.apache.flink.runtime.scheduler.adaptive.State> newState)
newState
- newState is the state into which the scheduler transitionspublic <T> Optional<T> as(Class<? extends T> clazz)
T
- target typeclazz
- clazz describes the target typeOptional.of(T)
target type if the underlying type can be cast into clazz;
otherwise Optional.empty()
public <T,E extends Exception> void tryRun(Class<? extends T> clazz, ThrowingConsumer<T,E> action, String debugMessage) throws E extends Exception
T
- target typeE
- error typeclazz
- 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 typeE
- an exception if the action failsE extends Exception
public <T,V,E extends Exception> Optional<V> tryCall(Class<? extends T> clazz, FunctionWithException<T,V,E> action, String debugMessage) throws E extends Exception
T
- target typeV
- value typeE
- error typeclazz
- 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 typeOptional.of(T)
the action result if it is successfully executed; otherwise
Optional.empty()
E
- an exception if the action failsE extends Exception
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.