Search in sources :

Example 1 with GetNewReservationResponse

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;
}
Also used : ReservationId(org.apache.hadoop.yarn.api.records.ReservationId) GetNewReservationResponse(org.apache.hadoop.yarn.api.protocolrecords.GetNewReservationResponse)

Example 2 with GetNewReservationResponse

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;
}
Also used : GetNewReservationRequest(org.apache.hadoop.yarn.api.protocolrecords.GetNewReservationRequest) GetNewReservationResponse(org.apache.hadoop.yarn.api.protocolrecords.GetNewReservationResponse)

Example 3 with 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();
}
Also used : GetNewReservationRequest(org.apache.hadoop.yarn.api.protocolrecords.GetNewReservationRequest) ApplicationClientProtocol(org.apache.hadoop.yarn.api.ApplicationClientProtocol) GetNewReservationResponse(org.apache.hadoop.yarn.api.protocolrecords.GetNewReservationResponse)

Example 4 with GetNewReservationResponse

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;
}
Also used : YarnRuntimeException(org.apache.hadoop.yarn.exceptions.YarnRuntimeException) GetNewReservationRequest(org.apache.hadoop.yarn.api.protocolrecords.GetNewReservationRequest) NewReservation(org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.NewReservation) GetNewReservationResponse(org.apache.hadoop.yarn.api.protocolrecords.GetNewReservationResponse) YarnException(org.apache.hadoop.yarn.exceptions.YarnException)

Aggregations

GetNewReservationResponse (org.apache.hadoop.yarn.api.protocolrecords.GetNewReservationResponse)4 GetNewReservationRequest (org.apache.hadoop.yarn.api.protocolrecords.GetNewReservationRequest)3 ApplicationClientProtocol (org.apache.hadoop.yarn.api.ApplicationClientProtocol)1 ReservationId (org.apache.hadoop.yarn.api.records.ReservationId)1 YarnException (org.apache.hadoop.yarn.exceptions.YarnException)1 YarnRuntimeException (org.apache.hadoop.yarn.exceptions.YarnRuntimeException)1 NewReservation (org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.NewReservation)1