Java Code Examples for org.apache.hadoop.yarn.api.protocolrecords.impl.pb.ReservationDeleteResponsePBImpl

Following code examples demonstrate how to use org.apache.hadoop.yarn.api.protocolrecords.impl.pb.ReservationDeleteResponsePBImplfrom hadoop. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use org.apache.hadoop.yarn.api.protocolrecords.impl.pb.ReservationDeleteResponsePBImpland various code implementation of this class.

  @Override
  public ReservationDeleteResponse deleteReservation(ReservationDeleteRequest request)
      throws YarnException, IOException {
    ReservationDeleteRequestProto requestProto =
        ((ReservationDeleteRequestPBImpl) request).getProto();
    try {
      return new ReservationDeleteResponsePBImpl(proxy.deleteReservation(null,
          requestProto));
    } catch (ServiceException e) {
      RPCUtil.unwrapAndThrowException(e);
      return null;
    }
  } 


  @Override
  public ReservationDeleteResponseProto deleteReservation(RpcController controller,
      ReservationDeleteRequestProto requestProto) throws ServiceException {
    ReservationDeleteRequestPBImpl request =
        new ReservationDeleteRequestPBImpl(requestProto);
    try {
      ReservationDeleteResponse response = real.deleteReservation(request);
      return ((ReservationDeleteResponsePBImpl) response).getProto();
    } catch (YarnException e) {
      throw new ServiceException(e);
    } catch (IOException e) {
      throw new ServiceException(e);
    }
  }