private static List<JobInstance> getHostAffinityEnabledJobs(File localStoreDirFile) {
    List<JobInstance> jobInstances = new ArrayList<>();
    for (File jobStore : localStoreDirFile.listFiles(File::isDirectory)) {
    // Name of the jobStore(jobStorePath) is of the form : ${job.name}-${job.id}.
      String jobStorePath = jobStore.getName();
      int indexSeparator = jobStorePath.lastIndexOf("-");
      if (indexSeparator != -1) {
        jobInstances.add(new JobInstance(jobStorePath.substring(0, indexSeparator),
                                         jobStorePath.substring(indexSeparator + 1)));
      }
    }
    return jobInstances;
  }
Helper method to find and return the list of host affinity enabled jobs on this NM.
@param localStoreDirFile the location in which all stores of host affinity enabled jobs are persisted.
@return the list of the host affinity enabled jobs that are installed on this NM.
samza-rest/src/main/java/org/apache/samza/monitor/LocalStoreMonitor.java