Class NoopAMPreemptionPolicy
java.lang.Object
org.apache.hadoop.mapreduce.v2.app.rm.preemption.NoopAMPreemptionPolicy
- All Implemented Interfaces:
AMPreemptionPolicy
NoOp policy that ignores all the requests for preemption.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.mapreduce.v2.app.rm.preemption.AMPreemptionPolicy
AMPreemptionPolicy.Context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.mapreduce.checkpoint.TaskCheckpointIDgetCheckpointID(org.apache.hadoop.mapreduce.v2.api.records.TaskId taskId) Method to retrieve the latest checkpoint for a givenTaskIdvoidhandleCompletedContainer(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId attemptID) Callback informing the policy of containers exiting cleanly.voidhandleFailedContainer(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId attemptID) Callback informing the policy of containers exiting with a failure.voidinit(AppContext context) booleanisPreempted(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.voidpreempt(AMPreemptionPolicy.Context ctxt, org.apache.hadoop.yarn.api.records.PreemptionMessage preemptionRequests) Callback informing the policy of ResourceManager. requests for resources to return to the cluster.voidreportSuccessfulPreemption(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..)voidsetCheckpointID(org.apache.hadoop.mapreduce.v2.api.records.TaskId taskId, org.apache.hadoop.mapreduce.checkpoint.TaskCheckpointID cid) Method to store the latestCheckpointIDfor a givenTaskId.
-
Constructor Details
-
NoopAMPreemptionPolicy
public NoopAMPreemptionPolicy()
-
-
Method Details
-
init
- Specified by:
initin interfaceAMPreemptionPolicy
-
preempt
public void preempt(AMPreemptionPolicy.Context ctxt, org.apache.hadoop.yarn.api.records.PreemptionMessage preemptionRequests) Description copied from interface:AMPreemptionPolicyCallback informing the policy of ResourceManager. requests for resources to return to the cluster. The policy may take arbitrary action to satisfy requests by checkpointing task state, returning containers, or ignoring requests. The RM may elect to enforce these requests by forcibly killing containers not returned after some duration.- Specified by:
preemptin interfaceAMPreemptionPolicy- Parameters:
ctxt- Handle to the current state of running containerspreemptionRequests- Request from RM for resources to return.
-
handleFailedContainer
public void handleFailedContainer(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId attemptID) Description copied from interface:AMPreemptionPolicyCallback informing the policy of containers exiting with a failure. This allows the policy to implemnt cleanup/compensating actions.- Specified by:
handleFailedContainerin interfaceAMPreemptionPolicy- Parameters:
attemptID- Task attempt that failed
-
isPreempted
public boolean isPreempted(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId yarnAttemptID) Description copied from interface:AMPreemptionPolicyThis method is invoked by components interested to learn whether a certain task is being preempted.- Specified by:
isPreemptedin interfaceAMPreemptionPolicy- Parameters:
yarnAttemptID- Task attempt to query- Returns:
- true if this attempt is being preempted
-
reportSuccessfulPreemption
public void reportSuccessfulPreemption(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId taskAttemptID) Description copied from interface:AMPreemptionPolicyThis method is used to report to the policy that a certain task has been successfully preempted (for bookeeping, counters, etc..)- Specified by:
reportSuccessfulPreemptionin interfaceAMPreemptionPolicy- Parameters:
taskAttemptID- Task attempt that preempted
-
getCheckpointID
public org.apache.hadoop.mapreduce.checkpoint.TaskCheckpointID getCheckpointID(org.apache.hadoop.mapreduce.v2.api.records.TaskId taskId) Description copied from interface:AMPreemptionPolicyMethod to retrieve the latest checkpoint for a givenTaskId- Specified by:
getCheckpointIDin interfaceAMPreemptionPolicy- Parameters:
taskId- TaskID- Returns:
- CheckpointID associated with this task or null
-
setCheckpointID
public void setCheckpointID(org.apache.hadoop.mapreduce.v2.api.records.TaskId taskId, org.apache.hadoop.mapreduce.checkpoint.TaskCheckpointID cid) Description copied from interface:AMPreemptionPolicyMethod to store the latestCheckpointIDfor a givenTaskId. Assigning a null is akin to remove all previous checkpoints for this task.- Specified by:
setCheckpointIDin interfaceAMPreemptionPolicy- Parameters:
taskId- TaskIDcid- Checkpoint to assign ornullto remove it.
-
handleCompletedContainer
public void handleCompletedContainer(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId attemptID) Description copied from interface:AMPreemptionPolicyCallback informing the policy of containers exiting cleanly. This is reported to the policy for bookeeping purposes.- Specified by:
handleCompletedContainerin interfaceAMPreemptionPolicy- Parameters:
attemptID- Task attempt that completed
-