@RpcMethod public void reserve(Resource resource,Integer generation,AsyncMethodCallback<Host.AsyncClient.reserve_call> handler) throws RpcException {
  ensureClient();
  ReserveRequest reserveRequest=new ReserveRequest();
  reserveRequest.setResource(resource);
  if (null != generation) {
    reserveRequest.setGeneration(generation);
  }
  clientProxy.setTimeout(RESERVE_TIMEOUT_MS);
  logger.info("reserve resource {}, generation {}, target {}, request {}",resource,generation,getHostIp(),reserveRequest);
  try {
    clientProxy.reserve(reserveRequest,handler);
  }
 catch (  TException e) {
    throw new RpcException(e.getMessage());
  }
}

@ RpcMethod public void reserve ( Resource resource , Integer generation , AsyncMethodCallback < Host . AsyncClient . reserve_call > handler ) throws RpcException { ensureClient ( ) ; ReserveRequest reserveRequest = new ReserveRequest ( ) ; reserveRequest . setResource ( resource ) ; if ( null != generation ) { reserveRequest . setGeneration ( generation ) ; } clientProxy . setTimeout ( RESERVE_TIMEOUT_MS ) ; logger . info ( "reserve resource {}, generation {}, target {}, request {}" , resource , generation , getHostIp ( ) , reserveRequest ) ; try { clientProxy . reserve ( reserveRequest , handler ) ; } catch ( TException e ) { throw new RpcException ( e . getMessage ( ) ) ; } }
this method performs an asynchronous thrift call to reserve space for a resource on a host . on completion , the specified handler is invoked .
