@Override
  public void releaseResources(SamzaResource resource) {
    log.info("Releasing Container ID: {} on host: {}", resource.getContainerId(), resource.getHost());
    // ensure that updating state and removing the request are done atomically
    synchronized (lock) {
      Container container = allocatedResources.get(resource);
      if (container == null) {
        log.info("Container ID: {} on host: {} was already released.", resource.getContainerId(), resource.getHost());
        return;
      }
      amClient.releaseAssignedContainer(container.getId());
      allocatedResources.remove(resource);
      metrics.decrementAllocatedContainersInBuffer();
    }
  }
Requests the YarnContainerManager to release a resource. If the app cannot use the resource or wants to give up
the resource, it can release them.

@param resource to be released
samza-yarn/src/main/java/org/apache/samza/job/yarn/YarnClusterResourceManager.java