public class TaskExecutor extends RpcEndpoint implements TaskExecutorGateway
Task
.RpcEndpoint.MainThreadExecutor
Modifier and Type | Field and Description |
---|---|
static int |
MAX_BLOB_PORT
Max blob port which is accepted
|
static String |
TASK_MANAGER_NAME |
log, rpcServer
Constructor and Description |
---|
TaskExecutor(RpcService rpcService,
TaskManagerConfiguration taskManagerConfiguration,
TaskManagerLocation taskManagerLocation,
MemoryManager memoryManager,
IOManager ioManager,
NetworkEnvironment networkEnvironment,
HighAvailabilityServices haServices,
HeartbeatServices heartbeatServices,
TaskManagerMetricGroup taskManagerMetricGroup,
BroadcastVariableManager broadcastVariableManager,
FileCache fileCache,
TaskSlotTable taskSlotTable,
JobManagerTable jobManagerTable,
JobLeaderService jobLeaderService,
FatalErrorHandler fatalErrorHandler) |
Modifier and Type | Method and Description |
---|---|
CompletableFuture<Acknowledge> |
cancelTask(ExecutionAttemptID executionAttemptID,
Time timeout)
Cancel the given task.
|
CompletableFuture<Acknowledge> |
confirmCheckpoint(ExecutionAttemptID executionAttemptID,
long checkpointId,
long checkpointTimestamp)
Confirm a checkpoint for the given task.
|
void |
disconnectJobManager(JobID jobId,
Exception cause)
Disconnects the given JobManager from the TaskManager.
|
void |
disconnectResourceManager(Exception cause)
Disconnects the ResourceManager from the TaskManager.
|
void |
failPartition(ExecutionAttemptID executionAttemptID)
Fail all intermediate result partitions of the given task.
|
ResourceID |
getResourceID() |
void |
heartbeatFromJobManager(ResourceID resourceID)
Heartbeat request from the job manager
|
void |
heartbeatFromResourceManager(ResourceID resourceID)
Heartbeat request from the resource manager
|
void |
postStop()
Called to shut down the TaskManager.
|
CompletableFuture<Acknowledge> |
requestSlot(SlotID slotId,
JobID jobId,
AllocationID allocationId,
String targetAddress,
ResourceManagerId resourceManagerId,
Time timeout)
Requests a slot from the TaskManager
|
void |
start()
Starts the rpc endpoint.
|
CompletableFuture<Acknowledge> |
stopTask(ExecutionAttemptID executionAttemptID,
Time timeout)
Stop the given task.
|
CompletableFuture<Acknowledge> |
submitTask(TaskDeploymentDescriptor tdd,
JobMasterId jobMasterId,
Time timeout)
Submit a
Task to the TaskExecutor . |
CompletableFuture<Acknowledge> |
triggerCheckpoint(ExecutionAttemptID executionAttemptID,
long checkpointId,
long checkpointTimestamp,
CheckpointOptions checkpointOptions)
Trigger the checkpoint for the given task.
|
CompletableFuture<Acknowledge> |
updatePartitions(ExecutionAttemptID executionAttemptID,
Iterable<PartitionInfo> partitionInfos,
Time timeout)
Update the task where the given partitions can be found.
|
callAsync, getAddress, getEndpointId, getHostname, getMainThreadExecutor, getRpcService, getSelfGateway, getTerminationFuture, runAsync, scheduleRunAsync, scheduleRunAsync, shutDown, stop, validateRunsInMainThread
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAddress, getHostname
public static final String TASK_MANAGER_NAME
public static final int MAX_BLOB_PORT
public TaskExecutor(RpcService rpcService, TaskManagerConfiguration taskManagerConfiguration, TaskManagerLocation taskManagerLocation, MemoryManager memoryManager, IOManager ioManager, NetworkEnvironment networkEnvironment, HighAvailabilityServices haServices, HeartbeatServices heartbeatServices, TaskManagerMetricGroup taskManagerMetricGroup, BroadcastVariableManager broadcastVariableManager, FileCache fileCache, TaskSlotTable taskSlotTable, JobManagerTable jobManagerTable, JobLeaderService jobLeaderService, FatalErrorHandler fatalErrorHandler)
public void start() throws Exception
RpcEndpoint
start
in class RpcEndpoint
Exception
- indicating that something went wrong while starting the RPC endpointpublic void postStop() throws Exception
postStop
in class RpcEndpoint
Exception
- if an error occurs. The exception is returned as result of the termination future.public CompletableFuture<Acknowledge> submitTask(TaskDeploymentDescriptor tdd, JobMasterId jobMasterId, Time timeout)
TaskExecutorGateway
Task
to the TaskExecutor
.submitTask
in interface TaskExecutorGateway
tdd
- describing the task to submitjobMasterId
- identifying the submitting JobMastertimeout
- of the submit operationpublic CompletableFuture<Acknowledge> cancelTask(ExecutionAttemptID executionAttemptID, Time timeout)
TaskExecutorGateway
cancelTask
in interface TaskExecutorGateway
executionAttemptID
- identifying the tasktimeout
- for the cancel operationpublic CompletableFuture<Acknowledge> stopTask(ExecutionAttemptID executionAttemptID, Time timeout)
TaskExecutorGateway
stopTask
in interface TaskExecutorGateway
executionAttemptID
- identifying the tasktimeout
- for the stop operationpublic CompletableFuture<Acknowledge> updatePartitions(ExecutionAttemptID executionAttemptID, Iterable<PartitionInfo> partitionInfos, Time timeout)
TaskExecutorGateway
updatePartitions
in interface TaskExecutorGateway
executionAttemptID
- identifying the taskpartitionInfos
- telling where the partition can be retrieved fromtimeout
- for the update partitions operationpublic void failPartition(ExecutionAttemptID executionAttemptID)
TaskExecutorGateway
failPartition
in interface TaskExecutorGateway
executionAttemptID
- identifying the taskpublic void heartbeatFromJobManager(ResourceID resourceID)
TaskExecutorGateway
heartbeatFromJobManager
in interface TaskExecutorGateway
resourceID
- unique id of the job managerpublic void heartbeatFromResourceManager(ResourceID resourceID)
TaskExecutorGateway
heartbeatFromResourceManager
in interface TaskExecutorGateway
resourceID
- unique id of the resource managerpublic CompletableFuture<Acknowledge> triggerCheckpoint(ExecutionAttemptID executionAttemptID, long checkpointId, long checkpointTimestamp, CheckpointOptions checkpointOptions)
TaskExecutorGateway
triggerCheckpoint
in interface TaskExecutorGateway
executionAttemptID
- identifying the taskcheckpointId
- unique id for the checkpointcheckpointTimestamp
- is the timestamp when the checkpoint has been initiatedcheckpointOptions
- for performing the checkpointpublic CompletableFuture<Acknowledge> confirmCheckpoint(ExecutionAttemptID executionAttemptID, long checkpointId, long checkpointTimestamp)
TaskExecutorGateway
confirmCheckpoint
in interface TaskExecutorGateway
executionAttemptID
- identifying the taskcheckpointId
- unique id for the checkpointcheckpointTimestamp
- is the timestamp when the checkpoint has been initiatedpublic CompletableFuture<Acknowledge> requestSlot(SlotID slotId, JobID jobId, AllocationID allocationId, String targetAddress, ResourceManagerId resourceManagerId, Time timeout)
TaskExecutorGateway
requestSlot
in interface TaskExecutorGateway
slotId
- slot id for the requestjobId
- for which to request a slotallocationId
- id for the requesttargetAddress
- to which to offer the requested slotsresourceManagerId
- current leader id of the ResourceManagertimeout
- for the operationpublic void disconnectJobManager(JobID jobId, Exception cause)
TaskExecutorGateway
disconnectJobManager
in interface TaskExecutorGateway
jobId
- JobID for which the JobManager was the leadercause
- for the disconnection from the JobManagerpublic void disconnectResourceManager(Exception cause)
TaskExecutorGateway
disconnectResourceManager
in interface TaskExecutorGateway
cause
- for the disconnection from the ResourceManagerpublic ResourceID getResourceID()
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.