YARN-8758. Support getting PreemptionMessage when using AMRMClientAsyn. (Zian Chen via wangda)
Change-Id: Ibf5d165f49957b582eeadeb41dc285c84d2f05e7 (cherry picked from commit 6926fd0ec634df2576bbc9f45e9636b99260db72) (cherry picked from commit abe4a8e5d82e70ce991e2830f20eba9f25a2491a)
This commit is contained in:
parent
1a890b17b9
commit
30f50a0682
@ -39,6 +39,7 @@
|
|||||||
import org.apache.hadoop.yarn.api.records.ExecutionType;
|
import org.apache.hadoop.yarn.api.records.ExecutionType;
|
||||||
import org.apache.hadoop.yarn.api.records.FinalApplicationStatus;
|
import org.apache.hadoop.yarn.api.records.FinalApplicationStatus;
|
||||||
import org.apache.hadoop.yarn.api.records.NodeReport;
|
import org.apache.hadoop.yarn.api.records.NodeReport;
|
||||||
|
import org.apache.hadoop.yarn.api.records.PreemptionMessage;
|
||||||
import org.apache.hadoop.yarn.api.records.Priority;
|
import org.apache.hadoop.yarn.api.records.Priority;
|
||||||
import org.apache.hadoop.yarn.api.records.RejectedSchedulingRequest;
|
import org.apache.hadoop.yarn.api.records.RejectedSchedulingRequest;
|
||||||
import org.apache.hadoop.yarn.api.records.Resource;
|
import org.apache.hadoop.yarn.api.records.Resource;
|
||||||
@ -553,6 +554,16 @@ public void onContainersReceivedFromPreviousAttempts(
|
|||||||
public void onRequestsRejected(
|
public void onRequestsRejected(
|
||||||
List<RejectedSchedulingRequest> rejectedSchedulingRequests) {
|
List<RejectedSchedulingRequest> rejectedSchedulingRequests) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when the RM responds to a heartbeat with preemption message
|
||||||
|
* @param preemptionMessage
|
||||||
|
*/
|
||||||
|
@Public
|
||||||
|
@Unstable
|
||||||
|
public void onPreemptionMessageReceived(
|
||||||
|
PreemptionMessage preemptionMessage) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
import org.apache.hadoop.yarn.api.records.ContainerStatus;
|
import org.apache.hadoop.yarn.api.records.ContainerStatus;
|
||||||
import org.apache.hadoop.yarn.api.records.FinalApplicationStatus;
|
import org.apache.hadoop.yarn.api.records.FinalApplicationStatus;
|
||||||
import org.apache.hadoop.yarn.api.records.NodeReport;
|
import org.apache.hadoop.yarn.api.records.NodeReport;
|
||||||
|
import org.apache.hadoop.yarn.api.records.PreemptionMessage;
|
||||||
import org.apache.hadoop.yarn.api.records.Priority;
|
import org.apache.hadoop.yarn.api.records.Priority;
|
||||||
import org.apache.hadoop.yarn.api.records.RejectedSchedulingRequest;
|
import org.apache.hadoop.yarn.api.records.RejectedSchedulingRequest;
|
||||||
import org.apache.hadoop.yarn.api.records.Resource;
|
import org.apache.hadoop.yarn.api.records.Resource;
|
||||||
@ -401,6 +402,14 @@ public void run() {
|
|||||||
handler.onContainersAllocated(allocated);
|
handler.onContainersAllocated(allocated);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PreemptionMessage preemptionMessage = response.getPreemptionMessage();
|
||||||
|
if (preemptionMessage != null) {
|
||||||
|
if (handler instanceof AMRMClientAsync.AbstractCallbackHandler) {
|
||||||
|
((AMRMClientAsync.AbstractCallbackHandler) handler)
|
||||||
|
.onPreemptionMessageReceived(preemptionMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!response.getContainersFromPreviousAttempts().isEmpty()) {
|
if (!response.getContainersFromPreviousAttempts().isEmpty()) {
|
||||||
if (handler instanceof AMRMClientAsync.AbstractCallbackHandler) {
|
if (handler instanceof AMRMClientAsync.AbstractCallbackHandler) {
|
||||||
((AMRMClientAsync.AbstractCallbackHandler) handler)
|
((AMRMClientAsync.AbstractCallbackHandler) handler)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user