public class JobMaster extends RpcEndpoint<JobMasterGateway>
JobGraph.
It offers the following methods as part of its rpc interface to interact with the JobMaster remotely:
updateTaskExecutionState(java.util.UUID, org.apache.flink.runtime.taskmanager.TaskExecutionState) updates the task execution state for
given task| Modifier and Type | Field and Description |
|---|---|
static String |
ARCHIVE_NAME |
static String |
JOB_MANAGER_NAME
Default names for Flink's distributed components
|
log| Constructor and Description |
|---|
JobMaster(RpcService rpcService,
ResourceID resourceId,
JobGraph jobGraph,
Configuration configuration,
HighAvailabilityServices highAvailabilityService,
HeartbeatServices heartbeatServices,
ScheduledExecutorService executor,
BlobLibraryCacheManager libraryCacheManager,
RestartStrategyFactory restartStrategyFactory,
Time rpcAskTimeout,
JobManagerMetricGroup jobManagerMetricGroup,
OnCompletionActions jobCompletionActions,
FatalErrorHandler errorHandler,
ClassLoader userCodeLoader) |
| Modifier and Type | Method and Description |
|---|---|
void |
acknowledgeCheckpoint(JobID jobID,
ExecutionAttemptID executionAttemptID,
long checkpointId,
CheckpointMetrics checkpointMetrics,
SubtaskState checkpointState) |
void |
declineCheckpoint(JobID jobID,
ExecutionAttemptID executionAttemptID,
long checkpointID,
Throwable reason) |
void |
disconnectResourceManager(UUID jobManagerLeaderId,
UUID resourceManagerLeaderId,
Exception cause) |
void |
disconnectTaskManager(ResourceID resourceID,
Exception cause) |
void |
failSlot(ResourceID taskManagerId,
AllocationID allocationId,
UUID leaderId,
Exception cause) |
void |
heartbeatFromResourceManager(ResourceID resourceID) |
void |
heartbeatFromTaskManager(ResourceID resourceID) |
KvStateLocation |
lookupKvStateLocation(String registrationName) |
void |
notifyKvStateRegistered(JobVertexID jobVertexId,
KeyGroupRange keyGroupRange,
String registrationName,
KvStateID kvStateId,
KvStateServerAddress kvStateServerAddress) |
void |
notifyKvStateUnregistered(JobVertexID jobVertexId,
KeyGroupRange keyGroupRange,
String registrationName) |
Future<Iterable<SlotOffer>> |
offerSlots(ResourceID taskManagerId,
Iterable<SlotOffer> slots,
UUID leaderId) |
Future<RegistrationResponse> |
registerTaskManager(String taskManagerRpcAddress,
TaskManagerLocation taskManagerLocation,
UUID leaderId) |
ClassloadingProps |
requestClassloadingProps() |
SerializedInputSplit |
requestNextInputSplit(UUID leaderSessionID,
JobVertexID vertexID,
ExecutionAttemptID executionAttempt) |
ExecutionState |
requestPartitionState(UUID leaderSessionID,
IntermediateDataSetID intermediateResultId,
ResultPartitionID resultPartitionId) |
Acknowledge |
scheduleOrUpdateConsumers(UUID leaderSessionID,
ResultPartitionID partitionID) |
void |
shutDown()
Suspend the job and shutdown all other services including rpc.
|
void |
start()
Starts the rpc endpoint.
|
void |
start(UUID leaderSessionID)
Start the rpc service and begin to run the job.
|
void |
startJobExecution() |
void |
suspendExecution(Throwable cause)
Suspending job, all the running tasks will be cancelled, and communication with other components
will be disposed.
|
Acknowledge |
updateTaskExecutionState(UUID leaderSessionID,
TaskExecutionState taskExecutionState)
Updates the task execution state for a given task.
|
callAsync, getAddress, getEndpointId, getMainThreadExecutor, getRpcService, getSelf, getSelfGatewayType, getTerminationFuture, runAsync, scheduleRunAsync, scheduleRunAsync, validateRunsInMainThreadpublic static final String JOB_MANAGER_NAME
public static final String ARCHIVE_NAME
public JobMaster(RpcService rpcService, ResourceID resourceId, JobGraph jobGraph, Configuration configuration, HighAvailabilityServices highAvailabilityService, HeartbeatServices heartbeatServices, ScheduledExecutorService executor, BlobLibraryCacheManager libraryCacheManager, RestartStrategyFactory restartStrategyFactory, Time rpcAskTimeout, @Nullable JobManagerMetricGroup jobManagerMetricGroup, OnCompletionActions jobCompletionActions, FatalErrorHandler errorHandler, ClassLoader userCodeLoader) throws Exception
Exceptionpublic void start()
RpcEndpointstart in class RpcEndpoint<JobMasterGateway>public void start(UUID leaderSessionID) throws Exception
leaderSessionID - The necessary leader id for running the job.Exceptionpublic void shutDown()
throws Exception
shutDown in class RpcEndpoint<JobMasterGateway>Exception - indicating that the something went wrong while shutting the RPC endpoint downpublic void startJobExecution()
public void suspendExecution(Throwable cause)
Mostly job is suspended because of the leadership has been revoked, one can be restart this job by
calling the start(UUID) method once we take the leadership back again.
cause - The reason of why this job been suspended.public Acknowledge updateTaskExecutionState(UUID leaderSessionID, TaskExecutionState taskExecutionState) throws Exception
taskExecutionState - New task execution state for a given taskExceptionpublic SerializedInputSplit requestNextInputSplit(UUID leaderSessionID, JobVertexID vertexID, ExecutionAttemptID executionAttempt) throws Exception
Exceptionpublic ExecutionState requestPartitionState(UUID leaderSessionID, IntermediateDataSetID intermediateResultId, ResultPartitionID resultPartitionId) throws Exception
Exceptionpublic Acknowledge scheduleOrUpdateConsumers(UUID leaderSessionID, ResultPartitionID partitionID) throws Exception
Exceptionpublic void disconnectTaskManager(ResourceID resourceID, Exception cause)
public void acknowledgeCheckpoint(JobID jobID, ExecutionAttemptID executionAttemptID, long checkpointId, CheckpointMetrics checkpointMetrics, SubtaskState checkpointState) throws CheckpointException
CheckpointExceptionpublic void declineCheckpoint(JobID jobID, ExecutionAttemptID executionAttemptID, long checkpointID, Throwable reason)
public KvStateLocation lookupKvStateLocation(String registrationName) throws Exception
Exceptionpublic void notifyKvStateRegistered(JobVertexID jobVertexId, KeyGroupRange keyGroupRange, String registrationName, KvStateID kvStateId, KvStateServerAddress kvStateServerAddress)
public void notifyKvStateUnregistered(JobVertexID jobVertexId, KeyGroupRange keyGroupRange, String registrationName)
public ClassloadingProps requestClassloadingProps() throws Exception
Exceptionpublic Future<Iterable<SlotOffer>> offerSlots(ResourceID taskManagerId, Iterable<SlotOffer> slots, UUID leaderId) throws Exception
Exceptionpublic void failSlot(ResourceID taskManagerId, AllocationID allocationId, UUID leaderId, Exception cause) throws Exception
Exceptionpublic Future<RegistrationResponse> registerTaskManager(String taskManagerRpcAddress, TaskManagerLocation taskManagerLocation, UUID leaderId) throws Exception
Exceptionpublic void disconnectResourceManager(UUID jobManagerLeaderId, UUID resourceManagerLeaderId, Exception cause) throws Exception
Exceptionpublic void heartbeatFromTaskManager(ResourceID resourceID)
public void heartbeatFromResourceManager(ResourceID resourceID)
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.