public Map<TaskName, LocationId> readTaskLocality() {
    Map<TaskName, LocationId> taskLocality = new HashMap<>();
    String taskLocalityPath = keyBuilder.getTaskLocalityPath();
    List<String> tasks = new ArrayList<>();
    if (zkClient.exists(taskLocalityPath)) {
      tasks = zkClient.getChildren(taskLocalityPath);
    }
    for (String taskName : tasks) {
      String taskPath = String.format("%s/%s", keyBuilder.getTaskLocalityPath(), taskName);
      String locationId = zkClient.readData(taskPath, true);
      if (locationId != null) {
        taskLocality.put(new TaskName(taskName), new LocationId(locationId));
      }
    }
    return taskLocality;
  }
Fetches all the ephemeral processor nodes of a standalone job from zookeeper.
@return a list of {@link ProcessorNode}, where each ProcessorNode represents a registered stream processor.
samza-core/src/main/java/org/apache/samza/zk/ZkUtils.java