public static Set<TaskName> getTaskNamesForProcessor(String processorId, JobModel jobModel) {
    Preconditions.checkNotNull(jobModel, "JobModel cannot be null");
    Preconditions.checkArgument(StringUtils.isNotBlank(processorId), "ProcessorId cannot be empty or null");

    return Optional.ofNullable(jobModel.getContainers().get(processorId))
        .map(ContainerModel::getTasks)
        .map(Map::keySet)
        .orElse(Collections.emptySet());
  }
A helper method to fetch the task names associated with the processor from the job model.
@param processorId processor for which task names are fetched
@param jobModel job model
@return a set of {@code TaskName} associated with the processor from the job model.
samza-core/src/main/java/org/apache/samza/job/model/JobModelUtil.java