Class RpcTaskManagerGateway
- java.lang.Object
-
- org.apache.flink.runtime.jobmaster.RpcTaskManagerGateway
-
- All Implemented Interfaces:
TaskManagerGateway
,TaskExecutorOperatorEventGateway
public class RpcTaskManagerGateway extends Object implements TaskManagerGateway
Implementation of theTaskManagerGateway
for Flink's RPC system.
-
-
Constructor Summary
Constructors Constructor Description RpcTaskManagerGateway(TaskExecutorGateway taskExecutorGateway, JobMasterId jobMasterId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletableFuture<Acknowledge>
cancelTask(ExecutionAttemptID executionAttemptID, Duration timeout)
Cancel the given task.CompletableFuture<Acknowledge>
freeSlot(AllocationID allocationId, Throwable cause, Duration timeout)
Frees the slot with the given allocation ID.String
getAddress()
Return the address of the task manager with which the gateway is associated.void
notifyCheckpointAborted(ExecutionAttemptID executionAttemptID, JobID jobId, long checkpointId, long latestCompletedCheckpointId, long timestamp)
Notify the given task about a aborted checkpoint.void
notifyCheckpointOnComplete(ExecutionAttemptID executionAttemptID, JobID jobId, long completedCheckpointId, long completedTimestamp, long lastSubsumedCheckpointId)
Notify the given task about a completed checkpoint and the last subsumed checkpoint id if possible.void
releasePartitions(JobID jobId, Set<ResultPartitionID> partitionIds)
Batch release intermediate result partitions.CompletableFuture<Acknowledge>
sendOperatorEventToTask(ExecutionAttemptID task, OperatorID operator, SerializedValue<OperatorEvent> evt)
Sends an operator event to an operator in a task executed by the Task Manager (Task Executor).CompletableFuture<Acknowledge>
submitTask(TaskDeploymentDescriptor tdd, Duration timeout)
Submit a task to the task manager.CompletableFuture<Acknowledge>
triggerCheckpoint(ExecutionAttemptID executionAttemptID, JobID jobId, long checkpointId, long timestamp, CheckpointOptions checkpointOptions)
Trigger for the given task a checkpoint.CompletableFuture<Acknowledge>
updatePartitions(ExecutionAttemptID executionAttemptID, Iterable<PartitionInfo> partitionInfos, Duration timeout)
Update the task where the given partitions can be found.
-
-
-
Constructor Detail
-
RpcTaskManagerGateway
public RpcTaskManagerGateway(TaskExecutorGateway taskExecutorGateway, JobMasterId jobMasterId)
-
-
Method Detail
-
getAddress
public String getAddress()
Description copied from interface:TaskManagerGateway
Return the address of the task manager with which the gateway is associated.- Specified by:
getAddress
in interfaceTaskManagerGateway
- Returns:
- Address of the task manager with which this gateway is associated.
-
submitTask
public CompletableFuture<Acknowledge> submitTask(TaskDeploymentDescriptor tdd, Duration timeout)
Description copied from interface:TaskManagerGateway
Submit a task to the task manager.- Specified by:
submitTask
in interfaceTaskManagerGateway
- Parameters:
tdd
- describing the task to submittimeout
- of the submit operation- Returns:
- Future acknowledge of the successful operation
-
cancelTask
public CompletableFuture<Acknowledge> cancelTask(ExecutionAttemptID executionAttemptID, Duration timeout)
Description copied from interface:TaskManagerGateway
Cancel the given task.- Specified by:
cancelTask
in interfaceTaskManagerGateway
- Parameters:
executionAttemptID
- identifying the tasktimeout
- of the submit operation- Returns:
- Future acknowledge if the task is successfully canceled
-
updatePartitions
public CompletableFuture<Acknowledge> updatePartitions(ExecutionAttemptID executionAttemptID, Iterable<PartitionInfo> partitionInfos, Duration timeout)
Description copied from interface:TaskManagerGateway
Update the task where the given partitions can be found.- Specified by:
updatePartitions
in interfaceTaskManagerGateway
- Parameters:
executionAttemptID
- identifying the taskpartitionInfos
- telling where the partition can be retrieved fromtimeout
- of the submit operation- Returns:
- Future acknowledge if the partitions have been successfully updated
-
releasePartitions
public void releasePartitions(JobID jobId, Set<ResultPartitionID> partitionIds)
Description copied from interface:TaskManagerGateway
Batch release intermediate result partitions.- Specified by:
releasePartitions
in interfaceTaskManagerGateway
- Parameters:
jobId
- id of the job that the partitions belong topartitionIds
- partition ids to release
-
notifyCheckpointOnComplete
public void notifyCheckpointOnComplete(ExecutionAttemptID executionAttemptID, JobID jobId, long completedCheckpointId, long completedTimestamp, long lastSubsumedCheckpointId)
Description copied from interface:TaskManagerGateway
Notify the given task about a completed checkpoint and the last subsumed checkpoint id if possible.- Specified by:
notifyCheckpointOnComplete
in interfaceTaskManagerGateway
- Parameters:
executionAttemptID
- identifying the taskjobId
- identifying the job to which the task belongscompletedCheckpointId
- of the completed checkpointcompletedTimestamp
- of the completed checkpointlastSubsumedCheckpointId
- of the last subsumed checkpoint id,
-
notifyCheckpointAborted
public void notifyCheckpointAborted(ExecutionAttemptID executionAttemptID, JobID jobId, long checkpointId, long latestCompletedCheckpointId, long timestamp)
Description copied from interface:TaskManagerGateway
Notify the given task about a aborted checkpoint.- Specified by:
notifyCheckpointAborted
in interfaceTaskManagerGateway
- Parameters:
executionAttemptID
- identifying the taskjobId
- identifying the job to which the task belongscheckpointId
- of the subsumed checkpointlatestCompletedCheckpointId
- of the latest completed checkpointtimestamp
- of the subsumed checkpoint
-
triggerCheckpoint
public CompletableFuture<Acknowledge> triggerCheckpoint(ExecutionAttemptID executionAttemptID, JobID jobId, long checkpointId, long timestamp, CheckpointOptions checkpointOptions)
Description copied from interface:TaskManagerGateway
Trigger for the given task a checkpoint.- Specified by:
triggerCheckpoint
in interfaceTaskManagerGateway
- Parameters:
executionAttemptID
- identifying the taskjobId
- identifying the job to which the task belongscheckpointId
- of the checkpoint to triggertimestamp
- of the checkpoint to triggercheckpointOptions
- of the checkpoint to trigger- Returns:
- Future acknowledge which is returned once the checkpoint has been triggered
-
freeSlot
public CompletableFuture<Acknowledge> freeSlot(AllocationID allocationId, Throwable cause, Duration timeout)
Description copied from interface:TaskManagerGateway
Frees the slot with the given allocation ID.- Specified by:
freeSlot
in interfaceTaskManagerGateway
- Parameters:
allocationId
- identifying the slot to freecause
- of the freeing operationtimeout
- for the operation- Returns:
- Future acknowledge which is returned once the slot has been freed
-
sendOperatorEventToTask
public CompletableFuture<Acknowledge> sendOperatorEventToTask(ExecutionAttemptID task, OperatorID operator, SerializedValue<OperatorEvent> evt)
Description copied from interface:TaskExecutorOperatorEventGateway
Sends an operator event to an operator in a task executed by the Task Manager (Task Executor).The reception is acknowledged (future is completed) when the event has been dispatched to the
AbstractInvokable.dispatchOperatorEvent(OperatorID, SerializedValue)
method. It is not guaranteed that the event is processed successfully within the implementation. These cases are up to the task and event sender to handle (for example with an explicit response message upon success, or by triggering failure/recovery upon exception).- Specified by:
sendOperatorEventToTask
in interfaceTaskExecutorOperatorEventGateway
- Specified by:
sendOperatorEventToTask
in interfaceTaskManagerGateway
-
-