use of org.apache.hadoop.yarn.api.protocolrecords.GetNewReservationResponse in project hadoop by apache.
the class ClientRMService method getNewReservation.
@Override
public GetNewReservationResponse getNewReservation(GetNewReservationRequest request) throws YarnException, IOException {
checkReservationSytem(AuditConstants.CREATE_NEW_RESERVATION_REQUEST);
GetNewReservationResponse response = recordFactory.newRecordInstance(GetNewReservationResponse.class);
ReservationId reservationId = reservationSystem.getNewReservationId();
response.setReservationId(reservationId);
// Create a new Reservation Id
return response;
}
use of org.apache.hadoop.yarn.api.protocolrecords.GetNewReservationResponse in project hadoop by apache.
the class TestReservationSystemWithRMHA method getNewReservation.
private GetNewReservationResponse getNewReservation(ClientRMService clientRMService) {
GetNewReservationRequest newReservationRequest = GetNewReservationRequest.newInstance();
GetNewReservationResponse getNewReservationResponse = null;
try {
getNewReservationResponse = clientRMService.getNewReservation(newReservationRequest);
} catch (Exception e) {
Assert.fail(e.getMessage());
}
return getNewReservationResponse;
}
use of org.apache.hadoop.yarn.api.protocolrecords.GetNewReservationResponse in project hadoop by apache.
the class ReservationACLsTestBase method createReservation.
private ReservationId createReservation(String creator) throws Exception {
ApplicationClientProtocol creatorClient = getRMClientForUser(creator);
GetNewReservationRequest getNewReservationRequest = GetNewReservationRequest.newInstance();
GetNewReservationResponse response = creatorClient.getNewReservation(getNewReservationRequest);
return response.getReservationId();
}
use of org.apache.hadoop.yarn.api.protocolrecords.GetNewReservationResponse in project hadoop by apache.
the class RMWebServices method createNewReservation.
/**
* Function that actually creates the {@link ReservationId} by calling the
* ClientRMService.
*
* @return returns structure containing the {@link ReservationId}
* @throws IOException if creation fails.
*/
private NewReservation createNewReservation() throws IOException {
GetNewReservationRequest req = recordFactory.newRecordInstance(GetNewReservationRequest.class);
GetNewReservationResponse resp;
try {
resp = rm.getClientRMService().getNewReservation(req);
} catch (YarnException e) {
String msg = "Unable to create new reservation from RM web service";
LOG.error(msg, e);
throw new YarnRuntimeException(msg, e);
}
NewReservation reservationId = new NewReservation(resp.getReservationId().toString());
return reservationId;
}
Aggregations