class JobControllerService {

  List<FeatureSet> getFeatureSetsForStore(Store store) {
    return store.getSubscriptionsList().stream()
        .flatMap(
            subscription -> {
              return specService
                  .listFeatureSets(
                      CoreServiceProto.ListFeatureSetsRequest.newBuilder()
                          .setFilter(
                              CoreServiceProto.ListFeatureSetsRequest.Filter.newBuilder()
                                  .setProject(subscription.getProject())
                                  .setFeatureSetName(subscription.getName())
                                  .build())
                          .build())
                  .getFeatureSetsList().stream()
                  .filter(
                      f ->
                          this.featureSetSubscriptions.isEmpty()
                              || isSubscribedToFeatureSet(
                                  this.featureSetSubscriptions,
                                  f.getSpec().getProject(),
                                  f.getSpec().getName()));
            })
        .distinct()
        .collect(Collectors.toList());
  }

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

}