Java Code Examples for org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse#setResponseId()

The following examples show how to use org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse#setResponseId() . 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: BuilderUtils.java    From hadoop with Apache License 2.0 6 votes vote down vote up
public static AllocateResponse newAllocateResponse(int responseId,
    List<ContainerStatus> completedContainers,
    List<Container> allocatedContainers, List<NodeReport> updatedNodes,
    Resource availResources, AMCommand command, int numClusterNodes,
    PreemptionMessage preempt) {
  AllocateResponse response = recordFactory
      .newRecordInstance(AllocateResponse.class);
  response.setNumClusterNodes(numClusterNodes);
  response.setResponseId(responseId);
  response.setCompletedContainersStatuses(completedContainers);
  response.setAllocatedContainers(allocatedContainers);
  response.setUpdatedNodes(updatedNodes);
  response.setAvailableResources(availResources);
  response.setAMCommand(command);
  response.setPreemptionMessage(preempt);

  return response;
}
 
Example 2
Source File: BuilderUtils.java    From big-c with Apache License 2.0 6 votes vote down vote up
public static AllocateResponse newAllocateResponse(int responseId,
    List<ContainerStatus> completedContainers,
    List<Container> allocatedContainers, List<NodeReport> updatedNodes,
    Resource availResources, AMCommand command, int numClusterNodes,
    PreemptionMessage preempt) {
  AllocateResponse response = recordFactory
      .newRecordInstance(AllocateResponse.class);
  response.setNumClusterNodes(numClusterNodes);
  response.setResponseId(responseId);
  response.setCompletedContainersStatuses(completedContainers);
  response.setAllocatedContainers(allocatedContainers);
  response.setUpdatedNodes(updatedNodes);
  response.setAvailableResources(availResources);
  response.setAMCommand(command);
  response.setPreemptionMessage(preempt);

  return response;
}
 
Example 3
Source File: ApplicationMasterService.java    From hadoop with Apache License 2.0 5 votes vote down vote up
public void registerAppAttempt(ApplicationAttemptId attemptId) {
  AllocateResponse response =
      recordFactory.newRecordInstance(AllocateResponse.class);
  // set response id to -1 before application master for the following
  // attemptID get registered
  response.setResponseId(-1);
  LOG.info("Registering app attempt : " + attemptId);
  responseMap.put(attemptId, new AllocateResponseLock(response));
  rmContext.getNMTokenSecretManager().registerApplicationAttempt(attemptId);
}
 
Example 4
Source File: ApplicationMasterService.java    From big-c with Apache License 2.0 5 votes vote down vote up
public void registerAppAttempt(ApplicationAttemptId attemptId) {
  AllocateResponse response =
      recordFactory.newRecordInstance(AllocateResponse.class);
  // set response id to -1 before application master for the following
  // attemptID get registered
  response.setResponseId(-1);
  LOG.info("Registering app attempt : " + attemptId);
  responseMap.put(attemptId, new AllocateResponseLock(response));
  rmContext.getNMTokenSecretManager().registerApplicationAttempt(attemptId);
}