public class CheckpointAMPreemptionPolicy extends Object implements AMPreemptionPolicy
AMPreemptionPolicy.Context| Constructor and Description |
|---|
CheckpointAMPreemptionPolicy() |
| 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 yarnAttemptID)
This method is invoked by components interested to learn whether a certain
task is being preempted.
|
void |
preempt(AMPreemptionPolicy.Context ctxt,
org.apache.hadoop.yarn.api.records.PreemptionMessage preemptionRequests)
Callback informing the policy of ResourceManager.
|
void |
reportSuccessfulPreemption(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId taskAttemptID)
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
CheckpointID for a given TaskId. |
public void init(AppContext context)
init in interface AMPreemptionPolicypublic void preempt(AMPreemptionPolicy.Context ctxt, org.apache.hadoop.yarn.api.records.PreemptionMessage preemptionRequests)
AMPreemptionPolicypreempt in interface AMPreemptionPolicyctxt - Handle to the current state of running containerspreemptionRequests - Request from RM for resources to return.public void handleFailedContainer(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId attemptID)
AMPreemptionPolicyhandleFailedContainer in interface AMPreemptionPolicyattemptID - Task attempt that failedpublic void handleCompletedContainer(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId attemptID)
AMPreemptionPolicyhandleCompletedContainer in interface AMPreemptionPolicyattemptID - Task attempt that completedpublic boolean isPreempted(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId yarnAttemptID)
AMPreemptionPolicyisPreempted in interface AMPreemptionPolicyyarnAttemptID - Task attempt to querypublic void reportSuccessfulPreemption(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId taskAttemptID)
AMPreemptionPolicyreportSuccessfulPreemption in interface AMPreemptionPolicytaskAttemptID - Task attempt that preemptedpublic org.apache.hadoop.mapreduce.checkpoint.TaskCheckpointID getCheckpointID(org.apache.hadoop.mapreduce.v2.api.records.TaskId taskId)
AMPreemptionPolicyTaskIdgetCheckpointID in interface AMPreemptionPolicytaskId - TaskIDpublic void setCheckpointID(org.apache.hadoop.mapreduce.v2.api.records.TaskId taskId,
org.apache.hadoop.mapreduce.checkpoint.TaskCheckpointID cid)
AMPreemptionPolicyCheckpointID for a given TaskId. Assigning a null is akin to remove all previous checkpoints for
this task.setCheckpointID in interface AMPreemptionPolicytaskId - TaskIDcid - Checkpoint to assign or null to remove it.Copyright © 2008–2024 Apache Software Foundation. All rights reserved.