public class KillAMPreemptionPolicy extends Object implements AMPreemptionPolicy
AMPreemptionPolicy.Context
Constructor and Description |
---|
KillAMPreemptionPolicy() |
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 AMPreemptionPolicy
public void preempt(AMPreemptionPolicy.Context ctxt, org.apache.hadoop.yarn.api.records.PreemptionMessage preemptionRequests)
AMPreemptionPolicy
preempt
in interface AMPreemptionPolicy
ctxt
- 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)
AMPreemptionPolicy
handleFailedContainer
in interface AMPreemptionPolicy
attemptID
- Task attempt that failedpublic boolean isPreempted(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId yarnAttemptID)
AMPreemptionPolicy
isPreempted
in interface AMPreemptionPolicy
yarnAttemptID
- Task attempt to querypublic void reportSuccessfulPreemption(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId taskAttemptID)
AMPreemptionPolicy
reportSuccessfulPreemption
in interface AMPreemptionPolicy
taskAttemptID
- Task attempt that preemptedpublic org.apache.hadoop.mapreduce.checkpoint.TaskCheckpointID getCheckpointID(org.apache.hadoop.mapreduce.v2.api.records.TaskId taskId)
AMPreemptionPolicy
TaskId
getCheckpointID
in interface AMPreemptionPolicy
taskId
- TaskIDpublic void setCheckpointID(org.apache.hadoop.mapreduce.v2.api.records.TaskId taskId, org.apache.hadoop.mapreduce.checkpoint.TaskCheckpointID cid)
AMPreemptionPolicy
CheckpointID
for a given TaskId
. Assigning a null is akin to remove all previous checkpoints for
this task.setCheckpointID
in interface AMPreemptionPolicy
taskId
- TaskIDcid
- Checkpoint to assign or null to remove it.public void handleCompletedContainer(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId attemptID)
AMPreemptionPolicy
handleCompletedContainer
in interface AMPreemptionPolicy
attemptID
- Task attempt that completedCopyright © 2008–2024 Apache Software Foundation. All rights reserved.