@Override public void cancelResourceRequest(SamzaResourceRequest request){
  log.info("Cancelling request {} ",request);
synchronized (lock) {
    AMRMClient.ContainerRequest containerRequest=requestsMap.get(request);
    if (containerRequest == null) {
      log.info("Cancellation of {} already done. ",containerRequest);
      return;
    }
    requestsMap.remove(request);
    amClient.removeContainerRequest(containerRequest);
  }
}

@ Override public void cancelResourceRequest ( SamzaResourceRequest request ) { log . info ( "Cancelling request {} " , request ) ; synchronized ( lock ) { AMRMClient . ContainerRequest containerRequest = requestsMap . get ( request ) ; if ( containerRequest == null ) { log . info ( "Cancellation of {} already done. " , containerRequest ) ; return ; } requestsMap . remove ( request ) ; amClient . removeContainerRequest ( containerRequest ) ; } }
remove a previously submitted resource request . the previous container request may have been submitted . even after the remove request , a callback implementation must be prepared to receive an allocation for the previous request . this is merely a best effort cancellation .
