YARN-4551. Address the duplication between StatusUpdateWhenHealthy and StatusUpdateWhenUnhealthy transitions. (Sunil G via kasha)
This commit is contained in:
parent
c722b62908
commit
321072ba81
|
@ -91,6 +91,9 @@ Release 2.9.0 - UNRELEASED
|
||||||
YARN-4571. Make app id/name available to the yarn authorizer provider for
|
YARN-4571. Make app id/name available to the yarn authorizer provider for
|
||||||
better auditing. (Jian He via wangda)
|
better auditing. (Jian He via wangda)
|
||||||
|
|
||||||
|
YARN-4551. Address the duplication between StatusUpdateWhenHealthy and
|
||||||
|
StatusUpdateWhenUnhealthy transitions. (Sunil G via kasha)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
BUG FIXES
|
BUG FIXES
|
||||||
|
|
|
@ -744,6 +744,20 @@ public class RMNodeImpl implements RMNode, EventHandler<RMNodeEvent> {
|
||||||
rmNode.totalCapability = resourceOption.getResource();
|
rmNode.totalCapability = resourceOption.getResource();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static NodeHealthStatus updateRMNodeFromStatusEvents(
|
||||||
|
RMNodeImpl rmNode, RMNodeStatusEvent statusEvent) {
|
||||||
|
// Switch the last heartbeatresponse.
|
||||||
|
rmNode.latestNodeHeartBeatResponse = statusEvent.getLatestResponse();
|
||||||
|
NodeHealthStatus remoteNodeHealthStatus = statusEvent.getNodeHealthStatus();
|
||||||
|
rmNode.setHealthReport(remoteNodeHealthStatus.getHealthReport());
|
||||||
|
rmNode.setLastHealthReportTime(remoteNodeHealthStatus
|
||||||
|
.getLastHealthReportTime());
|
||||||
|
rmNode.setAggregatedContainersUtilization(statusEvent
|
||||||
|
.getAggregatedContainersUtilization());
|
||||||
|
rmNode.setNodeUtilization(statusEvent.getNodeUtilization());
|
||||||
|
return remoteNodeHealthStatus;
|
||||||
|
}
|
||||||
|
|
||||||
public static class AddNodeTransition implements
|
public static class AddNodeTransition implements
|
||||||
SingleArcTransition<RMNodeImpl, RMNodeEvent> {
|
SingleArcTransition<RMNodeImpl, RMNodeEvent> {
|
||||||
|
|
||||||
|
@ -1069,17 +1083,8 @@ public class RMNodeImpl implements RMNode, EventHandler<RMNodeEvent> {
|
||||||
|
|
||||||
RMNodeStatusEvent statusEvent = (RMNodeStatusEvent) event;
|
RMNodeStatusEvent statusEvent = (RMNodeStatusEvent) event;
|
||||||
|
|
||||||
// Switch the last heartbeatresponse.
|
NodeHealthStatus remoteNodeHealthStatus = updateRMNodeFromStatusEvents(
|
||||||
rmNode.latestNodeHeartBeatResponse = statusEvent.getLatestResponse();
|
rmNode, statusEvent);
|
||||||
|
|
||||||
NodeHealthStatus remoteNodeHealthStatus =
|
|
||||||
statusEvent.getNodeHealthStatus();
|
|
||||||
rmNode.setHealthReport(remoteNodeHealthStatus.getHealthReport());
|
|
||||||
rmNode.setLastHealthReportTime(
|
|
||||||
remoteNodeHealthStatus.getLastHealthReportTime());
|
|
||||||
rmNode.setAggregatedContainersUtilization(
|
|
||||||
statusEvent.getAggregatedContainersUtilization());
|
|
||||||
rmNode.setNodeUtilization(statusEvent.getNodeUtilization());
|
|
||||||
NodeState initialState = rmNode.getState();
|
NodeState initialState = rmNode.getState();
|
||||||
boolean isNodeDecommissioning =
|
boolean isNodeDecommissioning =
|
||||||
initialState.equals(NodeState.DECOMMISSIONING);
|
initialState.equals(NodeState.DECOMMISSIONING);
|
||||||
|
@ -1151,15 +1156,8 @@ public class RMNodeImpl implements RMNode, EventHandler<RMNodeEvent> {
|
||||||
RMNodeStatusEvent statusEvent = (RMNodeStatusEvent)event;
|
RMNodeStatusEvent statusEvent = (RMNodeStatusEvent)event;
|
||||||
|
|
||||||
// Switch the last heartbeatresponse.
|
// Switch the last heartbeatresponse.
|
||||||
rmNode.latestNodeHeartBeatResponse = statusEvent.getLatestResponse();
|
NodeHealthStatus remoteNodeHealthStatus = updateRMNodeFromStatusEvents(
|
||||||
NodeHealthStatus remoteNodeHealthStatus =
|
rmNode, statusEvent);
|
||||||
statusEvent.getNodeHealthStatus();
|
|
||||||
rmNode.setHealthReport(remoteNodeHealthStatus.getHealthReport());
|
|
||||||
rmNode.setLastHealthReportTime(
|
|
||||||
remoteNodeHealthStatus.getLastHealthReportTime());
|
|
||||||
rmNode.setAggregatedContainersUtilization(
|
|
||||||
statusEvent.getAggregatedContainersUtilization());
|
|
||||||
rmNode.setNodeUtilization(statusEvent.getNodeUtilization());
|
|
||||||
if (remoteNodeHealthStatus.getIsNodeHealthy()) {
|
if (remoteNodeHealthStatus.getIsNodeHealthy()) {
|
||||||
rmNode.context.getDispatcher().getEventHandler().handle(
|
rmNode.context.getDispatcher().getEventHandler().handle(
|
||||||
new NodeAddedSchedulerEvent(rmNode));
|
new NodeAddedSchedulerEvent(rmNode));
|
||||||
|
|
Loading…
Reference in New Issue