Java Code Examples for org.apache.hadoop.yarn.server.api.records.NodeHealthStatus#setLastHealthReportTime()
The following examples show how to use
org.apache.hadoop.yarn.server.api.records.NodeHealthStatus#setLastHealthReportTime() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NodeStatusUpdaterImpl.java From hadoop with Apache License 2.0 | 6 votes |
private NodeStatus getNodeStatus(int responseId) throws IOException { NodeHealthStatus nodeHealthStatus = this.context.getNodeHealthStatus(); nodeHealthStatus.setHealthReport(healthChecker.getHealthReport()); nodeHealthStatus.setIsNodeHealthy(healthChecker.isHealthy()); nodeHealthStatus.setLastHealthReportTime(healthChecker .getLastHealthReportTime()); if (LOG.isDebugEnabled()) { LOG.debug("Node's health-status : " + nodeHealthStatus.getIsNodeHealthy() + ", " + nodeHealthStatus.getHealthReport()); } List<ContainerStatus> containersStatuses = getContainerStatuses(); NodeStatus nodeStatus = NodeStatus.newInstance(nodeId, responseId, containersStatuses, createKeepAliveApplicationList(), nodeHealthStatus); return nodeStatus; }
Example 2
Source File: NodeStatusUpdaterImpl.java From big-c with Apache License 2.0 | 6 votes |
private NodeStatus getNodeStatus(int responseId) throws IOException { NodeHealthStatus nodeHealthStatus = this.context.getNodeHealthStatus(); nodeHealthStatus.setHealthReport(healthChecker.getHealthReport()); nodeHealthStatus.setIsNodeHealthy(healthChecker.isHealthy()); nodeHealthStatus.setLastHealthReportTime(healthChecker .getLastHealthReportTime()); if (LOG.isDebugEnabled()) { LOG.debug("Node's health-status : " + nodeHealthStatus.getIsNodeHealthy() + ", " + nodeHealthStatus.getHealthReport()); } List<ContainerStatus> containersStatuses = getContainerStatuses(); NodeStatus nodeStatus = NodeStatus.newInstance(nodeId, responseId, containersStatuses, createKeepAliveApplicationList(), nodeHealthStatus); return nodeStatus; }
Example 3
Source File: TestYarnServerApiClasses.java From hadoop with Apache License 2.0 | 5 votes |
private NodeHealthStatus getNodeHealthStatus() { NodeHealthStatus healStatus = recordFactory .newRecordInstance(NodeHealthStatus.class); healStatus.setHealthReport("healthReport"); healStatus.setIsNodeHealthy(true); healStatus.setLastHealthReportTime(1000); return healStatus; }
Example 4
Source File: MockNM.java From hadoop with Apache License 2.0 | 5 votes |
public NodeHeartbeatResponse nodeHeartbeat(Map<ApplicationId, List<ContainerStatus>> conts, boolean isHealthy, int resId) throws Exception { NodeHeartbeatRequest req = Records.newRecord(NodeHeartbeatRequest.class); NodeStatus status = Records.newRecord(NodeStatus.class); status.setResponseId(resId); status.setNodeId(nodeId); for (Map.Entry<ApplicationId, List<ContainerStatus>> entry : conts.entrySet()) { Log.info("entry.getValue() " + entry.getValue()); status.setContainersStatuses(entry.getValue()); } NodeHealthStatus healthStatus = Records.newRecord(NodeHealthStatus.class); healthStatus.setHealthReport(""); healthStatus.setIsNodeHealthy(isHealthy); healthStatus.setLastHealthReportTime(1); status.setNodeHealthStatus(healthStatus); req.setNodeStatus(status); req.setLastKnownContainerTokenMasterKey(this.currentContainerTokenMasterKey); req.setLastKnownNMTokenMasterKey(this.currentNMTokenMasterKey); NodeHeartbeatResponse heartbeatResponse = resourceTracker.nodeHeartbeat(req); MasterKey masterKeyFromRM = heartbeatResponse.getContainerTokenMasterKey(); if (masterKeyFromRM != null && masterKeyFromRM.getKeyId() != this.currentContainerTokenMasterKey .getKeyId()) { this.currentContainerTokenMasterKey = masterKeyFromRM; } masterKeyFromRM = heartbeatResponse.getNMTokenMasterKey(); if (masterKeyFromRM != null && masterKeyFromRM.getKeyId() != this.currentNMTokenMasterKey .getKeyId()) { this.currentNMTokenMasterKey = masterKeyFromRM; } return heartbeatResponse; }
Example 5
Source File: TestYarnServerApiClasses.java From big-c with Apache License 2.0 | 5 votes |
private NodeHealthStatus getNodeHealthStatus() { NodeHealthStatus healStatus = recordFactory .newRecordInstance(NodeHealthStatus.class); healStatus.setHealthReport("healthReport"); healStatus.setIsNodeHealthy(true); healStatus.setLastHealthReportTime(1000); return healStatus; }
Example 6
Source File: MockNM.java From big-c with Apache License 2.0 | 5 votes |
public NodeHeartbeatResponse nodeHeartbeat(Map<ApplicationId, List<ContainerStatus>> conts, boolean isHealthy, int resId) throws Exception { NodeHeartbeatRequest req = Records.newRecord(NodeHeartbeatRequest.class); NodeStatus status = Records.newRecord(NodeStatus.class); status.setResponseId(resId); status.setNodeId(nodeId); for (Map.Entry<ApplicationId, List<ContainerStatus>> entry : conts.entrySet()) { Log.info("entry.getValue() " + entry.getValue()); status.setContainersStatuses(entry.getValue()); } NodeHealthStatus healthStatus = Records.newRecord(NodeHealthStatus.class); healthStatus.setHealthReport(""); healthStatus.setIsNodeHealthy(isHealthy); healthStatus.setLastHealthReportTime(1); status.setNodeHealthStatus(healthStatus); req.setNodeStatus(status); req.setLastKnownContainerTokenMasterKey(this.currentContainerTokenMasterKey); req.setLastKnownNMTokenMasterKey(this.currentNMTokenMasterKey); NodeHeartbeatResponse heartbeatResponse = resourceTracker.nodeHeartbeat(req); MasterKey masterKeyFromRM = heartbeatResponse.getContainerTokenMasterKey(); if (masterKeyFromRM != null && masterKeyFromRM.getKeyId() != this.currentContainerTokenMasterKey .getKeyId()) { this.currentContainerTokenMasterKey = masterKeyFromRM; } masterKeyFromRM = heartbeatResponse.getNMTokenMasterKey(); if (masterKeyFromRM != null && masterKeyFromRM.getKeyId() != this.currentNMTokenMasterKey .getKeyId()) { this.currentNMTokenMasterKey = masterKeyFromRM; } return heartbeatResponse; }
Example 7
Source File: TestNodeHealthService.java From hadoop with Apache License 2.0 | 4 votes |
private void setHealthStatus(NodeHealthStatus healthStatus, boolean isHealthy, String healthReport, long lastHealthReportTime) { healthStatus.setHealthReport(healthReport); healthStatus.setIsNodeHealthy(isHealthy); healthStatus.setLastHealthReportTime(lastHealthReportTime); }
Example 8
Source File: TestNodeHealthService.java From big-c with Apache License 2.0 | 4 votes |
private void setHealthStatus(NodeHealthStatus healthStatus, boolean isHealthy, String healthReport, long lastHealthReportTime) { healthStatus.setHealthReport(healthReport); healthStatus.setIsNodeHealthy(isHealthy); healthStatus.setLastHealthReportTime(lastHealthReportTime); }