public class TaskExecutor extends RpcEndpoint implements TaskExecutorGateway
Task.RpcEndpoint.MainThreadExecutor| Modifier and Type | Field and Description |
|---|---|
static String |
TASK_MANAGER_NAME |
log, rpcServer| Constructor and Description |
|---|
TaskExecutor(RpcService rpcService,
TaskManagerConfiguration taskManagerConfiguration,
HighAvailabilityServices haServices,
TaskManagerServices taskExecutorServices,
HeartbeatServices heartbeatServices,
TaskManagerMetricGroup taskManagerMetricGroup,
String metricQueryServiceAddress,
BlobCacheService blobCacheService,
FatalErrorHandler fatalErrorHandler,
TaskExecutorPartitionTracker partitionTracker,
BackPressureSampleService backPressureSampleService) |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Boolean> |
canBeReleased()
Checks whether the task executor can be released.
|
CompletableFuture<Acknowledge> |
cancelTask(ExecutionAttemptID executionAttemptID,
org.apache.flink.api.common.time.Time timeout)
Cancel the given task.
|
CompletableFuture<Acknowledge> |
confirmCheckpoint(ExecutionAttemptID executionAttemptID,
long checkpointId,
long checkpointTimestamp)
Confirm a checkpoint for the given task.
|
void |
disconnectJobManager(org.apache.flink.api.common.JobID jobId,
Exception cause)
Disconnects the given JobManager from the TaskManager.
|
void |
disconnectResourceManager(Exception cause)
Disconnects the ResourceManager from the TaskManager.
|
CompletableFuture<Acknowledge> |
freeSlot(AllocationID allocationId,
Throwable cause,
org.apache.flink.api.common.time.Time timeout)
Frees the slot with the given allocation ID.
|
ResourceID |
getResourceID() |
void |
heartbeatFromJobManager(ResourceID resourceID,
AllocatedSlotReport allocatedSlotReport)
Heartbeat request from the job manager.
|
void |
heartbeatFromResourceManager(ResourceID resourceID)
Heartbeat request from the resource manager.
|
void |
onStart()
User overridable callback which is called from
RpcEndpoint.internalCallOnStart(). |
CompletableFuture<Void> |
onStop()
Called to shut down the TaskManager.
|
void |
releaseOrPromotePartitions(org.apache.flink.api.common.JobID jobId,
Set<ResultPartitionID> partitionToRelease,
Set<ResultPartitionID> partitionsToPromote)
Batch release/promote intermediate result partitions.
|
CompletableFuture<TransientBlobKey> |
requestFileUpload(FileType fileType,
org.apache.flink.api.common.time.Time timeout)
Requests the file upload of the specified type to the cluster's
BlobServer. |
CompletableFuture<org.apache.flink.types.SerializableOptional<String>> |
requestMetricQueryServiceAddress(org.apache.flink.api.common.time.Time timeout)
Returns the gateway of Metric Query Service on the TaskManager.
|
CompletableFuture<Acknowledge> |
requestSlot(SlotID slotId,
org.apache.flink.api.common.JobID jobId,
AllocationID allocationId,
ResourceProfile resourceProfile,
String targetAddress,
ResourceManagerId resourceManagerId,
org.apache.flink.api.common.time.Time timeout)
Requests a slot from the TaskManager.
|
CompletableFuture<TaskBackPressureResponse> |
requestTaskBackPressure(ExecutionAttemptID executionAttemptId,
int requestId,
org.apache.flink.api.common.time.Time timeout) |
CompletableFuture<Acknowledge> |
submitTask(TaskDeploymentDescriptor tdd,
JobMasterId jobMasterId,
org.apache.flink.api.common.time.Time timeout)
Submit a
Task to the TaskExecutor. |
CompletableFuture<Acknowledge> |
triggerCheckpoint(ExecutionAttemptID executionAttemptID,
long checkpointId,
long checkpointTimestamp,
CheckpointOptions checkpointOptions,
boolean advanceToEndOfEventTime)
Trigger the checkpoint for the given task.
|
CompletableFuture<Acknowledge> |
updatePartitions(ExecutionAttemptID executionAttemptID,
Iterable<PartitionInfo> partitionInfos,
org.apache.flink.api.common.time.Time timeout)
Update the task where the given partitions can be found.
|
callAsync, closeAsync, getAddress, getEndpointId, getHostname, getMainThreadExecutor, getRpcService, getSelfGateway, getTerminationFuture, internalCallOnStart, internalCallOnStop, isRunning, runAsync, scheduleRunAsync, scheduleRunAsync, start, stop, validateRunsInMainThreadclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAddress, getHostnamepublic static final String TASK_MANAGER_NAME
public TaskExecutor(RpcService rpcService, TaskManagerConfiguration taskManagerConfiguration, HighAvailabilityServices haServices, TaskManagerServices taskExecutorServices, HeartbeatServices heartbeatServices, TaskManagerMetricGroup taskManagerMetricGroup, String metricQueryServiceAddress, BlobCacheService blobCacheService, FatalErrorHandler fatalErrorHandler, TaskExecutorPartitionTracker partitionTracker, BackPressureSampleService backPressureSampleService)
public CompletableFuture<Boolean> canBeReleased()
TaskExecutorGatewaycanBeReleased in interface TaskExecutorGatewaypublic void onStart()
throws Exception
RpcEndpointRpcEndpoint.internalCallOnStart().
This method is called when the RpcEndpoint is being started. The method is guaranteed to be executed in the main thread context and can be used to start the rpc endpoint in the context of the rpc endpoint's main thread.
IMPORTANT: This method should never be called directly by the user.
onStart in class RpcEndpointException - indicating that the rpc endpoint could not be started. If an exception occurs,
then the rpc endpoint will automatically terminate.public CompletableFuture<Void> onStop()
onStop in class RpcEndpointpublic CompletableFuture<TaskBackPressureResponse> requestTaskBackPressure(ExecutionAttemptID executionAttemptId, int requestId, org.apache.flink.api.common.time.Time timeout)
requestTaskBackPressure in interface TaskExecutorGatewaypublic CompletableFuture<Acknowledge> submitTask(TaskDeploymentDescriptor tdd, JobMasterId jobMasterId, org.apache.flink.api.common.time.Time timeout)
TaskExecutorGatewayTask to the TaskExecutor.submitTask in interface TaskExecutorGatewaytdd - describing the task to submitjobMasterId - identifying the submitting JobMastertimeout - of the submit operationpublic CompletableFuture<Acknowledge> cancelTask(ExecutionAttemptID executionAttemptID, org.apache.flink.api.common.time.Time timeout)
TaskExecutorGatewaycancelTask in interface TaskExecutorGatewayexecutionAttemptID - identifying the tasktimeout - for the cancel operationpublic CompletableFuture<Acknowledge> updatePartitions(ExecutionAttemptID executionAttemptID, Iterable<PartitionInfo> partitionInfos, org.apache.flink.api.common.time.Time timeout)
TaskExecutorGatewayupdatePartitions in interface TaskExecutorGatewayexecutionAttemptID - identifying the taskpartitionInfos - telling where the partition can be retrieved fromtimeout - for the update partitions operationpublic void releaseOrPromotePartitions(org.apache.flink.api.common.JobID jobId,
Set<ResultPartitionID> partitionToRelease,
Set<ResultPartitionID> partitionsToPromote)
TaskExecutorGatewayreleaseOrPromotePartitions in interface TaskExecutorGatewayjobId - id of the job that the partitions belong topartitionToRelease - partition ids to releasepartitionsToPromote - partitions ids to promotepublic void heartbeatFromJobManager(ResourceID resourceID, AllocatedSlotReport allocatedSlotReport)
TaskExecutorGatewayheartbeatFromJobManager in interface TaskExecutorGatewayresourceID - unique id of the job managerpublic void heartbeatFromResourceManager(ResourceID resourceID)
TaskExecutorGatewayheartbeatFromResourceManager in interface TaskExecutorGatewayresourceID - unique id of the resource managerpublic CompletableFuture<Acknowledge> triggerCheckpoint(ExecutionAttemptID executionAttemptID, long checkpointId, long checkpointTimestamp, CheckpointOptions checkpointOptions, boolean advanceToEndOfEventTime)
TaskExecutorGatewaytriggerCheckpoint in interface TaskExecutorGatewayexecutionAttemptID - identifying the taskcheckpointId - unique id for the checkpointcheckpointTimestamp - is the timestamp when the checkpoint has been initiatedcheckpointOptions - for performing the checkpointadvanceToEndOfEventTime - Flag indicating if the source should inject a MAX_WATERMARK in the pipeline
to fire any registered event-time timerspublic CompletableFuture<Acknowledge> confirmCheckpoint(ExecutionAttemptID executionAttemptID, long checkpointId, long checkpointTimestamp)
TaskExecutorGatewayconfirmCheckpoint in interface TaskExecutorGatewayexecutionAttemptID - identifying the taskcheckpointId - unique id for the checkpointcheckpointTimestamp - is the timestamp when the checkpoint has been initiatedpublic CompletableFuture<Acknowledge> requestSlot(SlotID slotId, org.apache.flink.api.common.JobID jobId, AllocationID allocationId, ResourceProfile resourceProfile, String targetAddress, ResourceManagerId resourceManagerId, org.apache.flink.api.common.time.Time timeout)
TaskExecutorGatewayrequestSlot in interface TaskExecutorGatewayslotId - slot id for the requestjobId - for which to request a slotallocationId - id for the requestresourceProfile - of requested slot, used only for dynamic slot allocation and will be ignored otherwisetargetAddress - to which to offer the requested slotsresourceManagerId - current leader id of the ResourceManagertimeout - for the operationpublic CompletableFuture<Acknowledge> freeSlot(AllocationID allocationId, Throwable cause, org.apache.flink.api.common.time.Time timeout)
TaskExecutorGatewayfreeSlot in interface TaskExecutorGatewayallocationId - identifying the slot to freecause - of the freeing operationtimeout - for the operationpublic CompletableFuture<TransientBlobKey> requestFileUpload(FileType fileType, org.apache.flink.api.common.time.Time timeout)
TaskExecutorGatewayBlobServer.requestFileUpload in interface TaskExecutorGatewayfileType - to uploadtimeout - for the asynchronous operationTransientBlobKey of the uploaded file.public CompletableFuture<org.apache.flink.types.SerializableOptional<String>> requestMetricQueryServiceAddress(org.apache.flink.api.common.time.Time timeout)
TaskExecutorGatewayrequestMetricQueryServiceAddress in interface TaskExecutorGatewaypublic void disconnectJobManager(org.apache.flink.api.common.JobID jobId,
Exception cause)
TaskExecutorGatewaydisconnectJobManager in interface TaskExecutorGatewayjobId - JobID for which the JobManager was the leadercause - for the disconnection from the JobManagerpublic void disconnectResourceManager(Exception cause)
TaskExecutorGatewaydisconnectResourceManager in interface TaskExecutorGatewaycause - for the disconnection from the ResourceManagerpublic ResourceID getResourceID()
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.