public static Map<TaskName, TaskModel> getTasks(ContainerModel containerModel, TaskMode taskMode) {
    return containerModel.getTasks().entrySet().stream()
        .filter(x -> x.getValue().getTaskMode().equals(taskMode))
        .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
  }
Returns a map of backend factory names to subset of provided storeNames that should be restored using it.
For CheckpointV1, only includes stores that should be restored using a configured changelog.
For CheckpointV2, associates stores with the highest precedence configured restore factory that has SCM in
the checkpoint, or the highest precedence restore factory configured if there are no SCMs in the checkpoint.
samza-core/src/main/scala/org/apache/samza/storage/ContainerStorageManagerUtil.java