|
23 | 23 | import feast.core.log.Action; |
24 | 24 | import feast.core.log.AuditLogger; |
25 | 25 | import feast.core.log.Resource; |
26 | | -import feast.core.model.FeatureSet; |
27 | 26 | import feast.core.model.Job; |
28 | 27 | import feast.core.model.JobStatus; |
29 | 28 | import feast.proto.core.CoreServiceProto.ListFeatureSetsRequest; |
30 | | -import feast.proto.core.CoreServiceProto.ListFeatureSetsResponse; |
31 | 29 | import feast.proto.core.CoreServiceProto.ListIngestionJobsRequest; |
32 | 30 | import feast.proto.core.CoreServiceProto.ListIngestionJobsResponse; |
33 | 31 | import feast.proto.core.CoreServiceProto.RestartIngestionJobRequest; |
@@ -115,20 +113,17 @@ public ListIngestionJobsResponse listJobs(ListIngestionJobsRequest request) |
115 | 113 | if (filter.hasFeatureSetReference()) { |
116 | 114 | // find a matching featuresets for reference |
117 | 115 | FeatureSetReference fsReference = filter.getFeatureSetReference(); |
118 | | - ListFeatureSetsResponse response = |
119 | | - this.specService.listFeatureSets(this.toListFeatureSetFilter(fsReference)); |
120 | | - List<FeatureSet> featureSets = |
121 | | - response.getFeatureSetsList().stream() |
122 | | - .map(FeatureSet::fromProto) |
123 | | - .collect(Collectors.toList()); |
124 | 116 |
|
125 | 117 | // find jobs for the matching featuresets |
126 | 118 | Collection<Job> matchingJobs = |
127 | | - this.jobRepository.findByFeatureSetJobStatusesIn( |
128 | | - featureSets.stream() |
129 | | - .flatMap(fs -> fs.getJobStatuses().stream()) |
130 | | - .collect(Collectors.toList())); |
131 | | - List<String> jobIds = matchingJobs.stream().map(Job::getId).collect(Collectors.toList()); |
| 119 | + this.jobRepository |
| 120 | + .findByFeatureSetJobStatusesFeatureSetNameAndFeatureSetJobStatusesFeatureSetProjectName( |
| 121 | + fsReference.getName(), fsReference.getProject()); |
| 122 | + List<String> jobIds = |
| 123 | + matchingJobs.stream() |
| 124 | + .filter(job -> job.getStatus().equals(JobStatus.RUNNING)) |
| 125 | + .map(Job::getId) |
| 126 | + .collect(Collectors.toList()); |
132 | 127 | matchingJobIds = this.mergeResults(matchingJobIds, jobIds); |
133 | 128 | } |
134 | 129 | } |
|
0 commit comments