public void releaseResource(String containerId) {
    if (StringUtils.isEmpty(containerId)) {
      log.warn("ContainerId is not specified");
      return;
    }

    synchronized (lock) {
      allocatedResources.values().forEach(resources -> {
        if (resources != null) {
          resources.removeIf(r -> containerId.equals(r.getContainerId()));
        }
      });
    }
  }
Releases a single resource based on containerId.
@param containerId Yarn container ID
samza-core/src/main/java/org/apache/samza/clustermanager/ResourceRequestState.java