class JobControllerService {

  Iterable<Pair<Source, Set<Store>>> getSourceToStoreMappings() {
    // build mapping from source to store.
    // compile a set of sources via subscribed FeatureSets of stores.
    Stream<Pair<Source, Store>> distinctPairs =
        getAllStores().stream()
            .flatMap(
                store ->
                    getFeatureSetsForStore(store).stream()
                        .map(f -> f.getSpec().getSource())
                        .map(source -> Pair.of(source, store)))
            .distinct();
    return groupingStrategy.collectSingleJobInput(distinctPairs);
  }

  @Autowired public  JobControllerService(
      JobRepository jobRepository,
      CoreServiceGrpc.CoreServiceBlockingStub specService,
      JobManager jobManager,
      FeastProperties feastProperties,
      JobGroupingStrategy groupingStrategy,
      KafkaTemplate<String, FeatureSetSpec> specPublisher);

}