public interface AMPreemptionPolicy
MRAppMaster
 response to preemption requests from the ResourceManager.RMContainerAllocator| Modifier and Type | Interface and Description | 
|---|---|
| static class  | AMPreemptionPolicy.Context | 
| Modifier and Type | Method and Description | 
|---|---|
| org.apache.hadoop.mapreduce.checkpoint.TaskCheckpointID | getCheckpointID(org.apache.hadoop.mapreduce.v2.api.records.TaskId taskId)Method to retrieve the latest checkpoint for a given  TaskId | 
| void | handleCompletedContainer(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId attemptID)Callback informing the policy of containers exiting cleanly. | 
| void | handleFailedContainer(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId attemptID)Callback informing the policy of containers exiting with a failure. | 
| void | init(AppContext context) | 
| boolean | isPreempted(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId attemptID)This method is invoked by components interested to learn whether a certain
 task is being preempted. | 
| void | preempt(AMPreemptionPolicy.Context context,
       org.apache.hadoop.yarn.api.records.PreemptionMessage preemptionRequests)Callback informing the policy of ResourceManager. | 
| void | reportSuccessfulPreemption(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId attemptID)This method is used to report to the policy that a certain task has been
 successfully preempted (for bookeeping, counters, etc..) | 
| void | setCheckpointID(org.apache.hadoop.mapreduce.v2.api.records.TaskId taskId,
               org.apache.hadoop.mapreduce.checkpoint.TaskCheckpointID cid)Method to store the latest  CheckpointIDfor a givenTaskId. | 
void init(AppContext context)
void preempt(AMPreemptionPolicy.Context context, org.apache.hadoop.yarn.api.records.PreemptionMessage preemptionRequests)
context - Handle to the current state of running containerspreemptionRequests - Request from RM for resources to return.boolean isPreempted(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId attemptID)
attemptID - Task attempt to queryvoid reportSuccessfulPreemption(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId attemptID)
attemptID - Task attempt that preemptedvoid handleFailedContainer(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId attemptID)
attemptID - Task attempt that failedvoid handleCompletedContainer(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId attemptID)
attemptID - Task attempt that completedorg.apache.hadoop.mapreduce.checkpoint.TaskCheckpointID getCheckpointID(org.apache.hadoop.mapreduce.v2.api.records.TaskId taskId)
TaskIdtaskId - TaskIDvoid setCheckpointID(org.apache.hadoop.mapreduce.v2.api.records.TaskId taskId,
                     org.apache.hadoop.mapreduce.checkpoint.TaskCheckpointID cid)
CheckpointID for a given TaskId. Assigning a null is akin to remove all previous checkpoints for
 this task.taskId - TaskIDcid - Checkpoint to assign or null to remove it.Copyright © 2008–2023 Apache Software Foundation. All rights reserved.