Optional<String> getActiveContainerHost(String containerID) {
    String activeContainerId = containerID;
    if (StandbyTaskUtil.isStandbyContainer(containerID)) {
      activeContainerId = StandbyTaskUtil.getActiveContainerId(containerID);
    }
    SamzaResource resource = samzaApplicationState.pendingProcessors.get(activeContainerId);
    if (resource == null) {
      resource = samzaApplicationState.runningProcessors.get(activeContainerId);
    }
    return Optional.ofNullable(resource)
            .map(SamzaResource::getHost);
  }
This method returns the active container host given a standby or active container ID.

@param containerID Standby or active container container ID
@return The active container host
samza-core/src/main/java/org/apache/samza/clustermanager/StandbyContainerManager.java