[TE] filter inactive metrics from related dataset metrics
@@ -105,6 +105,7 @@ public class MetricDatasetPipeline extends Pipeline {
double datasetScore = datasetScores.get(d);
Collection<MetricConfigDTO> dtos = metricDAO.findByDataset(d);
+ dtos = removeInactive(dtos);
dtos = removeExisting(dtos, metrics);
dtos = removeMeta(dtos);
@@ -135,6 +136,15 @@ public class MetricDatasetPipeline extends Pipeline {
return out;
}
+ static Collection<MetricConfigDTO> removeInactive(Iterable<MetricConfigDTO> dtos) {
+ Collection<MetricConfigDTO> out = new ArrayList<>();
+ for(MetricConfigDTO dto : dtos) {
+ if(dto.isActive())
+ out.add(dto);
+ }
+ return out;
+ }
+
static boolean findExisting(MetricConfigDTO dto, Iterable<MetricEntity> existing) {
for(MetricEntity me : existing) {
if(me.getId() == dto.getId()) {
