public class ExecutionGraph extends Object implements Serializable
ExecutionJobVertex
represents one vertex from the JobGraph (usually one operation like
"map" or "join") during execution. It holds the aggregated state of all parallel subtasks.
The ExecutionJobVertex is identified inside the graph by the JobVertexID
, which it takes
from the JobGraph's corresponding JobVertex.ExecutionVertex
represents one parallel subtask. For each ExecutionJobVertex, there are
as many ExecutionVertices as the parallelism. The ExecutionVertex is identified by
the ExecutionJobVertex and the number of the parallel subtaskExecution
is one attempt to execute a ExecutionVertex. There may be multiple Executions
for the ExecutionVertex, in case of a failure, or in the case where some data needs to be recomputed
because it is no longer available when requested by later operations. An Execution is always
identified by an ExecutionAttemptID
. All messages between the JobManager and the TaskManager
about deployment of tasks and updates in the task status always use the ExecutionAttemptID to
address the message receiver.The ExecutionGraph implements Serializable
, because it can be archived by
sending it to an archive actor via an actor message. The execution graph does contain some
non-serializable fields. These fields are not required in the archived form and are cleared
in the prepareForArchiving()
method.
Constructor and Description |
---|
ExecutionGraph(scala.concurrent.ExecutionContext executionContext,
JobID jobId,
String jobName,
Configuration jobConfig,
scala.concurrent.duration.FiniteDuration timeout,
RestartStrategy restartStrategy,
List<BlobKey> requiredJarFiles,
List<URL> requiredClasspaths,
ClassLoader userClassLoader) |
Modifier and Type | Method and Description |
---|---|
Map<String,Accumulator<?,?>> |
aggregateUserAccumulators()
Merges all accumulator results from the tasks previously executed in the Executions.
|
void |
attachJobGraph(List<JobVertex> topologiallySorted) |
void |
cancel() |
void |
disableSnaphotCheckpointing()
Disables checkpointing.
|
void |
enableSnapshotCheckpointing(long interval,
long checkpointTimeout,
long minPauseBetweenCheckpoints,
int maxConcurrentCheckpoints,
List<ExecutionJobVertex> verticesToTrigger,
List<ExecutionJobVertex> verticesToWaitFor,
List<ExecutionJobVertex> verticesToCommitTo,
akka.actor.ActorSystem actorSystem,
UUID leaderSessionID,
CheckpointIDCounter checkpointIDCounter,
CompletedCheckpointStore completedCheckpointStore,
RecoveryMode recoveryMode,
StateStore<CompletedCheckpoint> savepointStore,
CheckpointStatsTracker statsTracker) |
void |
fail(Throwable t) |
StringifiedAccumulatorResult[] |
getAccumulatorResultsStringified()
Returns the a stringified version of the user-defined accumulators.
|
Map<String,SerializedValue<Object>> |
getAccumulatorsSerialized()
Gets a serialized accumulator map.
|
Iterable<ExecutionVertex> |
getAllExecutionVertices() |
Map<IntermediateDataSetID,IntermediateResult> |
getAllIntermediateResults() |
Map<JobVertexID,ExecutionJobVertex> |
getAllVertices() |
CheckpointCoordinator |
getCheckpointCoordinator() |
CheckpointStatsTracker |
getCheckpointStatsTracker() |
ExecutionConfig |
getExecutionConfig() |
scala.concurrent.ExecutionContext |
getExecutionContext()
Returns the ExecutionContext associated with this ExecutionGraph.
|
Throwable |
getFailureCause() |
Map<ExecutionAttemptID,Map<AccumulatorRegistry.Metric,Accumulator<?,?>>> |
getFlinkAccumulators()
Gets the internal flink accumulator map of maps which contains some metrics.
|
Configuration |
getJobConfiguration() |
JobID |
getJobID() |
String |
getJobName() |
ExecutionJobVertex |
getJobVertex(JobVertexID id) |
String |
getJsonPlan() |
int |
getNumberOfExecutionJobVertices()
Gets the number of job vertices currently held by this execution graph.
|
Map<ExecutionAttemptID,Execution> |
getRegisteredExecutions() |
List<URL> |
getRequiredClasspaths()
Returns a list of classpaths referring to the directories/JAR files required to run this job
|
List<BlobKey> |
getRequiredJarFiles()
Returns a list of BLOB keys referring to the JAR files required to run this job
|
RestartStrategy |
getRestartStrategy() |
SavepointCoordinator |
getSavepointCoordinator() |
ScheduleMode |
getScheduleMode() |
Scheduler |
getScheduler() |
JobStatus |
getState() |
long |
getStatusTimestamp(JobStatus status) |
ClassLoader |
getUserClassLoader() |
Iterable<ExecutionJobVertex> |
getVerticesTopologically() |
boolean |
isArchived() |
boolean |
isQueuedSchedulingAllowed() |
boolean |
isStoppable() |
void |
prepareForArchiving()
This method cleans fields that are irrelevant for the archived execution attempt.
|
void |
registerExecutionListener(ActorGateway listener) |
void |
registerJobStatusListener(ActorGateway listener) |
void |
restart() |
void |
restoreLatestCheckpointedState()
Restores the latest checkpointed state.
|
void |
restoreSavepoint(String savepointPath)
Restores the execution state back to a savepoint.
|
void |
scheduleForExecution(Scheduler scheduler) |
void |
scheduleOrUpdateConsumers(ResultPartitionID partitionId) |
void |
setJsonPlan(String jsonPlan) |
void |
setQueuedSchedulingAllowed(boolean allowed) |
void |
setScheduleMode(ScheduleMode scheduleMode) |
void |
stop() |
void |
updateAccumulators(AccumulatorSnapshot accumulatorSnapshot)
Updates the accumulators during the runtime of a job.
|
boolean |
updateState(TaskExecutionState state)
Updates the state of one of the ExecutionVertex's Execution attempts.
|
void |
waitUntilFinished()
For testing: This waits until the job execution has finished.
|
public ExecutionGraph(scala.concurrent.ExecutionContext executionContext, JobID jobId, String jobName, Configuration jobConfig, scala.concurrent.duration.FiniteDuration timeout, RestartStrategy restartStrategy, List<BlobKey> requiredJarFiles, List<URL> requiredClasspaths, ClassLoader userClassLoader)
public int getNumberOfExecutionJobVertices()
public boolean isQueuedSchedulingAllowed()
public void setQueuedSchedulingAllowed(boolean allowed)
public void setScheduleMode(ScheduleMode scheduleMode)
public ScheduleMode getScheduleMode()
public boolean isArchived()
public void enableSnapshotCheckpointing(long interval, long checkpointTimeout, long minPauseBetweenCheckpoints, int maxConcurrentCheckpoints, List<ExecutionJobVertex> verticesToTrigger, List<ExecutionJobVertex> verticesToWaitFor, List<ExecutionJobVertex> verticesToCommitTo, akka.actor.ActorSystem actorSystem, UUID leaderSessionID, CheckpointIDCounter checkpointIDCounter, CompletedCheckpointStore completedCheckpointStore, RecoveryMode recoveryMode, StateStore<CompletedCheckpoint> savepointStore, CheckpointStatsTracker statsTracker) throws Exception
Exception
public void disableSnaphotCheckpointing() throws Exception
The shutdown of the checkpoint coordinator might block. Make sure that calls to this method don't block the job manager actor and run asynchronously.
Exception
public CheckpointCoordinator getCheckpointCoordinator()
public SavepointCoordinator getSavepointCoordinator()
public RestartStrategy getRestartStrategy()
public CheckpointStatsTracker getCheckpointStatsTracker()
public List<BlobKey> getRequiredJarFiles()
public List<URL> getRequiredClasspaths()
public void setJsonPlan(String jsonPlan)
public String getJsonPlan()
public Scheduler getScheduler()
public JobID getJobID()
public String getJobName()
public boolean isStoppable()
public Configuration getJobConfiguration()
public ClassLoader getUserClassLoader()
public JobStatus getState()
public Throwable getFailureCause()
public ExecutionJobVertex getJobVertex(JobVertexID id)
public Map<JobVertexID,ExecutionJobVertex> getAllVertices()
public Iterable<ExecutionJobVertex> getVerticesTopologically()
public Map<IntermediateDataSetID,IntermediateResult> getAllIntermediateResults()
public Iterable<ExecutionVertex> getAllExecutionVertices()
public long getStatusTimestamp(JobStatus status)
public scala.concurrent.ExecutionContext getExecutionContext()
public Map<ExecutionAttemptID,Map<AccumulatorRegistry.Metric,Accumulator<?,?>>> getFlinkAccumulators()
public Map<String,Accumulator<?,?>> aggregateUserAccumulators()
public Map<String,SerializedValue<Object>> getAccumulatorsSerialized() throws IOException
IOException
public StringifiedAccumulatorResult[] getAccumulatorResultsStringified()
public void attachJobGraph(List<JobVertex> topologiallySorted) throws JobException
JobException
public void scheduleForExecution(Scheduler scheduler) throws JobException
JobException
public void cancel()
public void stop() throws StoppingException
StoppingException
public void fail(Throwable t)
public void restart()
public void restoreLatestCheckpointedState() throws Exception
The recovery of checkpoints might block. Make sure that calls to this method don't block the job manager actor and run asynchronously.
Exception
public void restoreSavepoint(String savepointPath) throws Exception
The execution vertices need to be in state ExecutionState.CREATED
when calling
this method. The operation might block. Make sure that calls don't block the job manager
actor.
savepointPath
- The path of the savepoint to rollback to.IllegalStateException
- If checkpointing is disabledIllegalStateException
- If checkpoint coordinator is shut downException
- If failure during rollbackpublic void prepareForArchiving()
public ExecutionConfig getExecutionConfig()
public void waitUntilFinished() throws InterruptedException
InterruptedException
public boolean updateState(TaskExecutionState state)
state
- The state update.public void scheduleOrUpdateConsumers(ResultPartitionID partitionId)
public Map<ExecutionAttemptID,Execution> getRegisteredExecutions()
public void updateAccumulators(AccumulatorSnapshot accumulatorSnapshot)
accumulatorSnapshot
- The serialized flink and user-defined accumulatorspublic void registerJobStatusListener(ActorGateway listener)
public void registerExecutionListener(ActorGateway listener)
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.