public class DefaultExecutionGraph extends Object implements ExecutionGraph, InternalExecutionGraphAccessor
ExecutionGraph.| Constructor and Description |
|---|
DefaultExecutionGraph(JobInformation jobInformation,
ScheduledExecutorService futureExecutor,
Executor ioExecutor,
org.apache.flink.api.common.time.Time rpcTimeout,
int maxPriorAttemptsHistoryLength,
ClassLoader userClassLoader,
BlobWriter blobWriter,
PartitionGroupReleaseStrategy.Factory partitionGroupReleaseStrategyFactory,
ShuffleMaster<?> shuffleMaster,
JobMasterPartitionTracker partitionTracker,
TaskDeploymentDescriptorFactory.PartitionLocationConstraint partitionLocationConstraint,
ExecutionDeploymentListener executionDeploymentListener,
ExecutionStateUpdateListener executionStateUpdateListener,
long initializationTimestamp,
VertexAttemptNumberStore initialAttemptCounts,
VertexParallelismStore vertexParallelismStore,
boolean isDynamic) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,org.apache.flink.util.OptionalFailure<org.apache.flink.api.common.accumulators.Accumulator<?,?>>> |
aggregateUserAccumulators()
Merges all accumulator results from the tasks previously executed in the Executions.
|
void |
attachJobGraph(List<JobVertex> topologicallySorted) |
void |
cancel() |
protected org.apache.flink.util.concurrent.FutureUtils.ConjunctFuture<Void> |
cancelVerticesAsync() |
void |
deleteBlobs(List<PermanentBlobKey> blobKeys) |
void |
deregisterExecution(Execution exec) |
void |
enableCheckpointing(CheckpointCoordinatorConfiguration chkConfig,
List<MasterTriggerRestoreHook<?>> masterHooks,
CheckpointIDCounter checkpointIDCounter,
CompletedCheckpointStore checkpointStore,
StateBackend checkpointStateBackend,
CheckpointStorage checkpointStorage,
CheckpointStatsTracker statsTracker,
CheckpointsCleaner checkpointsCleaner) |
void |
failGlobal(Throwable t)
Fails the execution graph globally.
|
void |
failJob(Throwable cause,
long timestamp) |
Optional<AccessExecution> |
findExecution(ExecutionAttemptID attemptId) |
Optional<String> |
findVertexWithAttempt(ExecutionAttemptID attemptId) |
StringifiedAccumulatorResult[] |
getAccumulatorResultsStringified()
Returns the a stringified version of the user-defined accumulators.
|
Map<String,org.apache.flink.util.SerializedValue<org.apache.flink.util.OptionalFailure<Object>>> |
getAccumulatorsSerialized()
Gets a serialized accumulator map.
|
Iterable<ExecutionVertex> |
getAllExecutionVertices()
Returns an iterable containing all execution vertices for this execution graph.
|
Map<IntermediateDataSetID,IntermediateResult> |
getAllIntermediateResults() |
Map<JobVertexID,ExecutionJobVertex> |
getAllVertices()
Returns a map containing all job vertices for this execution graph.
|
org.apache.flink.api.common.ArchivedExecutionConfig |
getArchivedExecutionConfig()
Returns the serializable
ArchivedExecutionConfig. |
BlobWriter |
getBlobWriter() |
CheckpointCoordinator |
getCheckpointCoordinator() |
CheckpointCoordinatorConfiguration |
getCheckpointCoordinatorConfiguration()
Returns the
CheckpointCoordinatorConfiguration or null if checkpointing
is disabled. |
CheckpointStatsSnapshot |
getCheckpointStatsSnapshot()
Returns a snapshot of the checkpoint statistics or
null if checkpointing is
disabled. |
Optional<String> |
getCheckpointStorageName()
Returns the checkpoint storage name for this ExecutionGraph.
|
EdgeManager |
getEdgeManager() |
ExecutionDeploymentListener |
getExecutionDeploymentListener() |
ExecutionVertex |
getExecutionVertexOrThrow(ExecutionVertexID id) |
Throwable |
getFailureCause() |
ErrorInfo |
getFailureInfo()
Returns the exception that caused the job to fail.
|
Executor |
getFutureExecutor()
Returns the ExecutionContext associated with this ExecutionGraph.
|
org.apache.flink.configuration.Configuration |
getJobConfiguration() |
org.apache.flink.api.common.JobID |
getJobID()
Returns the
JobID for this execution graph. |
org.apache.flink.types.Either<org.apache.flink.util.SerializedValue<JobInformation>,PermanentBlobKey> |
getJobInformationOrBlobKey() |
org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor |
getJobMasterMainThreadExecutor() |
String |
getJobName()
Returns the job name for the execution graph.
|
ExecutionJobVertex |
getJobVertex(JobVertexID id)
Returns the job vertex for the given
JobVertexID. |
String |
getJsonPlan()
Returns the job plan as a JSON string.
|
KvStateLocationRegistry |
getKvStateLocationRegistry() |
long |
getNumberOfRestarts()
Gets the number of restarts, including full restarts and fine grained restarts.
|
int |
getNumFinishedVertices() |
PartitionGroupReleaseStrategy |
getPartitionGroupReleaseStrategy() |
TaskDeploymentDescriptorFactory.PartitionLocationConstraint |
getPartitionLocationConstraint() |
JobMasterPartitionTracker |
getPartitionTracker() |
Map<ExecutionAttemptID,Execution> |
getRegisteredExecutions() |
ResultPartitionAvailabilityChecker |
getResultPartitionAvailabilityChecker() |
IntermediateResultPartition |
getResultPartitionOrThrow(IntermediateResultPartitionID id) |
SchedulingTopology |
getSchedulingTopology() |
ShuffleMaster<?> |
getShuffleMaster() |
org.apache.flink.api.common.JobStatus |
getState()
Returns the current
JobStatus for this execution graph. |
Optional<String> |
getStateBackendName()
Returns the state backend name for this ExecutionGraph.
|
long |
getStatusTimestamp(org.apache.flink.api.common.JobStatus status)
Returns the timestamp for the given
JobStatus. |
CompletableFuture<org.apache.flink.api.common.JobStatus> |
getTerminationFuture()
Returns the termination future of this
ExecutionGraph. |
ClassLoader |
getUserClassLoader() |
Iterable<ExecutionJobVertex> |
getVerticesTopologically()
Returns an iterable containing all job vertices for this execution graph in the order they
were created.
|
void |
incrementRestarts() |
void |
initFailureCause(Throwable t,
long timestamp) |
void |
initializeJobVertex(ExecutionJobVertex ejv,
long createTimestamp)
Initialize the given execution job vertex, mainly includes creating execution vertices
according to the parallelism, and connecting to the predecessors.
|
boolean |
isDynamic() |
boolean |
isStoppable()
Returns whether the job for this execution graph is stoppable.
|
void |
jobVertexFinished()
Called whenever a job vertex reaches state FINISHED (completed successfully).
|
void |
jobVertexUnFinished() |
void |
notifyExecutionChange(Execution execution,
ExecutionState previousState,
ExecutionState newExecutionState) |
void |
notifyNewlyInitializedJobVertices(List<ExecutionJobVertex> vertices)
Notify that some job vertices have been newly initialized, execution graph will try to update
scheduling topology.
|
void |
notifyPartitionDataAvailable(ResultPartitionID partitionId)
Mark the data of a result partition to be available.
|
void |
notifySchedulerNgAboutInternalTaskFailure(ExecutionAttemptID attemptId,
Throwable t,
boolean cancelTask,
boolean releasePartitions) |
void |
registerExecution(Execution exec) |
void |
registerJobStatusListener(JobStatusListener listener) |
void |
setInternalTaskFailuresListener(InternalFailuresListener internalTaskFailuresListener) |
void |
setJsonPlan(String jsonPlan) |
void |
start(org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor jobMasterMainThreadExecutor) |
void |
suspend(Throwable suspensionCause)
Suspends the current ExecutionGraph.
|
boolean |
transitionState(org.apache.flink.api.common.JobStatus current,
org.apache.flink.api.common.JobStatus newState) |
void |
transitionToRunning() |
void |
updateAccumulators(AccumulatorSnapshot accumulatorSnapshot)
Updates the accumulators during the runtime of a job.
|
boolean |
updateState(TaskExecutionStateTransition state)
Updates the state of one of the ExecutionVertex's Execution attempts.
|
org.apache.flink.api.common.JobStatus |
waitUntilTerminal() |
public DefaultExecutionGraph(JobInformation jobInformation, ScheduledExecutorService futureExecutor, Executor ioExecutor, org.apache.flink.api.common.time.Time rpcTimeout, int maxPriorAttemptsHistoryLength, ClassLoader userClassLoader, BlobWriter blobWriter, PartitionGroupReleaseStrategy.Factory partitionGroupReleaseStrategyFactory, ShuffleMaster<?> shuffleMaster, JobMasterPartitionTracker partitionTracker, TaskDeploymentDescriptorFactory.PartitionLocationConstraint partitionLocationConstraint, ExecutionDeploymentListener executionDeploymentListener, ExecutionStateUpdateListener executionStateUpdateListener, long initializationTimestamp, VertexAttemptNumberStore initialAttemptCounts, VertexParallelismStore vertexParallelismStore, boolean isDynamic) throws IOException
IOExceptionpublic void start(@Nonnull org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor jobMasterMainThreadExecutor)
start in interface ExecutionGraphpublic SchedulingTopology getSchedulingTopology()
getSchedulingTopology in interface ExecutionGraphpublic TaskDeploymentDescriptorFactory.PartitionLocationConstraint getPartitionLocationConstraint()
getPartitionLocationConstraint in interface InternalExecutionGraphAccessor@Nonnull public org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor getJobMasterMainThreadExecutor()
getJobMasterMainThreadExecutor in interface ExecutionGraphgetJobMasterMainThreadExecutor in interface InternalExecutionGraphAccessorpublic Optional<String> getStateBackendName()
AccessExecutionGraphgetStateBackendName in interface AccessExecutionGraphpublic Optional<String> getCheckpointStorageName()
AccessExecutionGraphgetCheckpointStorageName in interface AccessExecutionGraphpublic void enableCheckpointing(CheckpointCoordinatorConfiguration chkConfig, List<MasterTriggerRestoreHook<?>> masterHooks, CheckpointIDCounter checkpointIDCounter, CompletedCheckpointStore checkpointStore, StateBackend checkpointStateBackend, CheckpointStorage checkpointStorage, CheckpointStatsTracker statsTracker, CheckpointsCleaner checkpointsCleaner)
enableCheckpointing in interface ExecutionGraph@Nullable public CheckpointCoordinator getCheckpointCoordinator()
getCheckpointCoordinator in interface ExecutionGraphpublic KvStateLocationRegistry getKvStateLocationRegistry()
getKvStateLocationRegistry in interface ExecutionGraphpublic CheckpointCoordinatorConfiguration getCheckpointCoordinatorConfiguration()
AccessExecutionGraphCheckpointCoordinatorConfiguration or null if checkpointing
is disabled.getCheckpointCoordinatorConfiguration in interface AccessExecutionGraphpublic CheckpointStatsSnapshot getCheckpointStatsSnapshot()
AccessExecutionGraphnull if checkpointing is
disabled.getCheckpointStatsSnapshot in interface AccessExecutionGraphpublic void setJsonPlan(String jsonPlan)
setJsonPlan in interface ExecutionGraphpublic String getJsonPlan()
AccessExecutionGraphgetJsonPlan in interface AccessExecutionGraphpublic org.apache.flink.types.Either<org.apache.flink.util.SerializedValue<JobInformation>,PermanentBlobKey> getJobInformationOrBlobKey()
getJobInformationOrBlobKey in interface InternalExecutionGraphAccessorpublic org.apache.flink.api.common.JobID getJobID()
AccessExecutionGraphJobID for this execution graph.getJobID in interface AccessExecutionGraphgetJobID in interface InternalExecutionGraphAccessorpublic String getJobName()
AccessExecutionGraphgetJobName in interface AccessExecutionGraphpublic boolean isStoppable()
AccessExecutionGraphisStoppable in interface AccessExecutionGraphpublic org.apache.flink.configuration.Configuration getJobConfiguration()
getJobConfiguration in interface ExecutionGraphpublic ClassLoader getUserClassLoader()
getUserClassLoader in interface InternalExecutionGraphAccessorpublic org.apache.flink.api.common.JobStatus getState()
AccessExecutionGraphJobStatus for this execution graph.getState in interface AccessExecutionGraphgetState in interface JobStatusProviderpublic Throwable getFailureCause()
getFailureCause in interface ExecutionGraphpublic ErrorInfo getFailureInfo()
AccessExecutionGraphgetFailureInfo in interface AccessExecutionGraphpublic long getNumberOfRestarts()
ExecutionGraphgetNumberOfRestarts in interface ExecutionGraphpublic int getNumFinishedVertices()
getNumFinishedVertices in interface ExecutionGraphpublic ExecutionJobVertex getJobVertex(JobVertexID id)
AccessExecutionGraphJobVertexID.getJobVertex in interface AccessExecutionGraphgetJobVertex in interface ExecutionGraphgetJobVertex in interface InternalExecutionGraphAccessorid - id of job vertex to be returnednullpublic Map<JobVertexID,ExecutionJobVertex> getAllVertices()
AccessExecutionGraphgetAllVertices in interface AccessExecutionGraphgetAllVertices in interface ExecutionGraphpublic Iterable<ExecutionJobVertex> getVerticesTopologically()
AccessExecutionGraphgetVerticesTopologically in interface AccessExecutionGraphgetVerticesTopologically in interface ExecutionGraphpublic Map<IntermediateDataSetID,IntermediateResult> getAllIntermediateResults()
getAllIntermediateResults in interface ExecutionGraphpublic Iterable<ExecutionVertex> getAllExecutionVertices()
AccessExecutionGraphgetAllExecutionVertices in interface AccessExecutionGraphgetAllExecutionVertices in interface ExecutionGraphpublic EdgeManager getEdgeManager()
getEdgeManager in interface InternalExecutionGraphAccessorpublic ExecutionVertex getExecutionVertexOrThrow(ExecutionVertexID id)
getExecutionVertexOrThrow in interface InternalExecutionGraphAccessorpublic IntermediateResultPartition getResultPartitionOrThrow(IntermediateResultPartitionID id)
getResultPartitionOrThrow in interface InternalExecutionGraphAccessorpublic long getStatusTimestamp(org.apache.flink.api.common.JobStatus status)
AccessExecutionGraphJobStatus.getStatusTimestamp in interface AccessExecutionGraphgetStatusTimestamp in interface JobStatusProviderstatus - status for which the timestamp should be returnedpublic final BlobWriter getBlobWriter()
getBlobWriter in interface InternalExecutionGraphAccessorpublic Executor getFutureExecutor()
InternalExecutionGraphAccessorgetFutureExecutor in interface InternalExecutionGraphAccessorpublic Map<String,org.apache.flink.util.OptionalFailure<org.apache.flink.api.common.accumulators.Accumulator<?,?>>> aggregateUserAccumulators()
ExecutionGraphaggregateUserAccumulators in interface ExecutionGraphpublic Map<String,org.apache.flink.util.SerializedValue<org.apache.flink.util.OptionalFailure<Object>>> getAccumulatorsSerialized()
getAccumulatorsSerialized in interface AccessExecutionGraphpublic StringifiedAccumulatorResult[] getAccumulatorResultsStringified()
getAccumulatorResultsStringified in interface AccessExecutionGraphpublic void setInternalTaskFailuresListener(InternalFailuresListener internalTaskFailuresListener)
setInternalTaskFailuresListener in interface ExecutionGraphpublic void notifyNewlyInitializedJobVertices(List<ExecutionJobVertex> vertices)
ExecutionGraphnotifyNewlyInitializedJobVertices in interface ExecutionGraphvertices - The execution job vertices that are newly initialized.public void attachJobGraph(List<JobVertex> topologicallySorted) throws JobException
attachJobGraph in interface ExecutionGraphJobExceptionpublic void initializeJobVertex(ExecutionJobVertex ejv, long createTimestamp) throws JobException
ExecutionGraphinitializeJobVertex in interface ExecutionGraphejv - The execution job vertex that needs to be initialized.createTimestamp - The timestamp for creating execution vertices, used to initialize the
first Execution with.JobExceptionpublic void transitionToRunning()
transitionToRunning in interface ExecutionGraphpublic void cancel()
cancel in interface ExecutionGraph@VisibleForTesting protected org.apache.flink.util.concurrent.FutureUtils.ConjunctFuture<Void> cancelVerticesAsync()
public void suspend(Throwable suspensionCause)
ExecutionGraphThe JobStatus will be directly set to JobStatus.SUSPENDED iff the current state is
not a terminal state. All ExecutionJobVertices will be canceled and the onTerminalState() is
executed.
The JobStatus.SUSPENDED state is a local terminal state which stops the execution
of the job but does not remove the job from the HA job store so that it can be recovered by
another JobManager.
suspend in interface ExecutionGraphsuspensionCause - Cause of the suspensionpublic void failGlobal(Throwable t)
InternalExecutionGraphAccessorThis global failure is meant to be triggered in cases where the consistency of the execution graph' state cannot be guaranteed any more (for example when catching unexpected exceptions that indicate a bug or an unexpected call race), and where a full restart is the safe way to get consistency back.
failGlobal in interface InternalExecutionGraphAccessort - The exception that caused the failure.public org.apache.flink.api.common.ArchivedExecutionConfig getArchivedExecutionConfig()
ArchivedExecutionConfig.getArchivedExecutionConfig in interface AccessExecutionGraphpublic CompletableFuture<org.apache.flink.api.common.JobStatus> getTerminationFuture()
ExecutionGraphExecutionGraph. The termination future is
completed with the terminal JobStatus once the ExecutionGraph reaches this terminal
state and all Execution have been terminated.getTerminationFuture in interface ExecutionGraphExecutionGraph.@VisibleForTesting
public org.apache.flink.api.common.JobStatus waitUntilTerminal()
throws InterruptedException
waitUntilTerminal in interface ExecutionGraphInterruptedExceptionpublic boolean transitionState(org.apache.flink.api.common.JobStatus current,
org.apache.flink.api.common.JobStatus newState)
transitionState in interface ExecutionGraphpublic void incrementRestarts()
incrementRestarts in interface ExecutionGraphpublic void initFailureCause(Throwable t, long timestamp)
initFailureCause in interface ExecutionGraphpublic void jobVertexFinished()
jobVertexFinished in interface InternalExecutionGraphAccessorpublic void jobVertexUnFinished()
jobVertexUnFinished in interface InternalExecutionGraphAccessorpublic void failJob(Throwable cause, long timestamp)
failJob in interface ExecutionGraphpublic boolean updateState(TaskExecutionStateTransition state)
ExecutionGraphupdateState in interface ExecutionGraphstate - The state update.public void notifyPartitionDataAvailable(ResultPartitionID partitionId)
ExecutionGraphnotifyPartitionDataAvailable in interface ExecutionGraphpartitionId - specifying the result partition whose data have become availablepublic Map<ExecutionAttemptID,Execution> getRegisteredExecutions()
getRegisteredExecutions in interface ExecutionGraphpublic void registerExecution(Execution exec)
registerExecution in interface InternalExecutionGraphAccessorpublic void deregisterExecution(Execution exec)
deregisterExecution in interface InternalExecutionGraphAccessorpublic void updateAccumulators(AccumulatorSnapshot accumulatorSnapshot)
ExecutionGraphupdateAccumulators in interface ExecutionGraphaccumulatorSnapshot - The serialized flink and user-defined accumulatorspublic void registerJobStatusListener(JobStatusListener listener)
registerJobStatusListener in interface ExecutionGraphpublic void notifyExecutionChange(Execution execution, ExecutionState previousState, ExecutionState newExecutionState)
notifyExecutionChange in interface InternalExecutionGraphAccessorpublic void notifySchedulerNgAboutInternalTaskFailure(ExecutionAttemptID attemptId, Throwable t, boolean cancelTask, boolean releasePartitions)
notifySchedulerNgAboutInternalTaskFailure in interface InternalExecutionGraphAccessorpublic void deleteBlobs(List<PermanentBlobKey> blobKeys)
deleteBlobs in interface InternalExecutionGraphAccessorpublic ShuffleMaster<?> getShuffleMaster()
getShuffleMaster in interface InternalExecutionGraphAccessorpublic JobMasterPartitionTracker getPartitionTracker()
getPartitionTracker in interface InternalExecutionGraphAccessorpublic ResultPartitionAvailabilityChecker getResultPartitionAvailabilityChecker()
getResultPartitionAvailabilityChecker in interface ExecutionGraphpublic PartitionGroupReleaseStrategy getPartitionGroupReleaseStrategy()
getPartitionGroupReleaseStrategy in interface InternalExecutionGraphAccessorpublic ExecutionDeploymentListener getExecutionDeploymentListener()
getExecutionDeploymentListener in interface InternalExecutionGraphAccessorpublic boolean isDynamic()
isDynamic in interface InternalExecutionGraphAccessorpublic Optional<String> findVertexWithAttempt(ExecutionAttemptID attemptId)
findVertexWithAttempt in interface ExecutionGraphpublic Optional<AccessExecution> findExecution(ExecutionAttemptID attemptId)
findExecution in interface ExecutionGraphCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.