Java Code Examples for org.apache.hadoop.yarn.server.api.protocolrecords.NodeHeartbeatResponse#setNextHeartBeatInterval()

The following examples show how to use org.apache.hadoop.yarn.server.api.protocolrecords.NodeHeartbeatResponse#setNextHeartBeatInterval() . 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: YarnServerBuilderUtils.java    From hadoop with Apache License 2.0 6 votes vote down vote up
public static NodeHeartbeatResponse newNodeHeartbeatResponse(int responseId,
    NodeAction action, List<ContainerId> containersToCleanUp,
    List<ApplicationId> applicationsToCleanUp,
    MasterKey containerTokenMasterKey, MasterKey nmTokenMasterKey,
    long nextHeartbeatInterval) {
  NodeHeartbeatResponse response = recordFactory
      .newRecordInstance(NodeHeartbeatResponse.class);
  response.setResponseId(responseId);
  response.setNodeAction(action);
  response.setContainerTokenMasterKey(containerTokenMasterKey);
  response.setNMTokenMasterKey(nmTokenMasterKey);
  response.setNextHeartBeatInterval(nextHeartbeatInterval);
  if(containersToCleanUp != null) {
    response.addAllContainersToCleanup(containersToCleanUp);
  }
  if(applicationsToCleanUp != null) {
    response.addAllApplicationsToCleanup(applicationsToCleanUp);
  }
  return response;
}
 
Example 2
Source File: YarnServerBuilderUtils.java    From big-c with Apache License 2.0 6 votes vote down vote up
public static NodeHeartbeatResponse newNodeHeartbeatResponse(int responseId,
    NodeAction action, List<ContainerId> containersToCleanUp,
    List<ApplicationId> applicationsToCleanUp,List<NodeContainerUpdate> listNodeContainerUpdate,
    MasterKey containerTokenMasterKey, MasterKey nmTokenMasterKey,
    long nextHeartbeatInterval) {
  NodeHeartbeatResponse response = recordFactory
      .newRecordInstance(NodeHeartbeatResponse.class);
  response.setResponseId(responseId);
  response.setNodeAction(action);
  response.setContainerTokenMasterKey(containerTokenMasterKey);
  response.setNMTokenMasterKey(nmTokenMasterKey);
  response.setNextHeartBeatInterval(nextHeartbeatInterval);
  
  if(containersToCleanUp != null) {
    response.addAllContainersToCleanup(containersToCleanUp);
  }
  if(applicationsToCleanUp != null) {
    response.addAllApplicationsToCleanup(applicationsToCleanUp);
  }
  if(listNodeContainerUpdate != null){
    response.addNodeContainersToUpdate(listNodeContainerUpdate);	
  }
  return response;
}