use of org.apache.hadoop.yarn.api.protocolrecords.GetNewReservationRequest in project hadoop by apache.
the class TestClientRMService method submitReservationTestHelper.
private ReservationSubmissionRequest submitReservationTestHelper(ClientRMService clientService, long arrival, long deadline, long duration) {
ReservationSubmissionResponse sResponse = null;
GetNewReservationRequest newReservationRequest = GetNewReservationRequest.newInstance();
ReservationId reservationID = null;
try {
reservationID = clientService.getNewReservation(newReservationRequest).getReservationId();
} catch (Exception e) {
Assert.fail(e.getMessage());
}
ReservationSubmissionRequest sRequest = ReservationSystemTestUtil.createSimpleReservationRequest(reservationID, 4, arrival, deadline, duration);
try {
sResponse = clientService.submitReservation(sRequest);
} catch (Exception e) {
Assert.fail(e.getMessage());
}
Assert.assertNotNull(sResponse);
Assert.assertNotNull(reservationID);
System.out.println("Submit reservation response: " + reservationID);
return sRequest;
}
use of org.apache.hadoop.yarn.api.protocolrecords.GetNewReservationRequest 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.GetNewReservationRequest 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.GetNewReservationRequest 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