List<IdUuidPair> selectSnapshotIdUuids(PurgeSnapshotQuery query) { return purgeMapper.selectAnalysisIdsAndUuids(query); }
List<String> selectSnapshotUuids(PurgeSnapshotQuery query) { return purgeMapper.selectAnalysisIdsAndUuids(query).stream().map(IdUuidPair::getUuid).collect(Collectors.toList()); }
void deleteAnalyses(PurgeSnapshotQuery... queries) { List<IdUuidPair> snapshotIds = Arrays.stream(queries) .flatMap(q -> purgeMapper.selectAnalysisIdsAndUuids(q).stream()) .collect(Collectors.toList()); deleteAnalyses(snapshotIds); }
void deleteAnalyses(String rootComponentUuid) { profiler.start("deleteAnalyses (event_component_changes)"); purgeMapper.deleteEventComponentChangesByComponentUuid(rootComponentUuid); session.commit(); profiler.stop(); profiler.start("deleteAnalyses (events)"); purgeMapper.deleteEventsByComponentUuid(rootComponentUuid); session.commit(); profiler.stop(); List<List<String>> analysisUuidsPartitions = Lists.partition(IdUuidPairs.uuids( purgeMapper.selectAnalysisIdsAndUuids(new PurgeSnapshotQuery().setComponentUuid(rootComponentUuid))), MAX_SNAPSHOTS_PER_QUERY); deleteAnalysisDuplications(analysisUuidsPartitions); profiler.start("deleteAnalyses (project_measures)"); analysisUuidsPartitions.forEach(purgeMapper::deleteAnalysisMeasures); session.commit(); profiler.stop(); profiler.start("deleteAnalyses (snapshots)"); analysisUuidsPartitions.forEach(purgeMapper::deleteAnalyses); session.commit(); profiler.stop(); profiler.start("deleteAnalyses (analysis_properties)"); analysisUuidsPartitions.forEach(purgeMapper::deleteAnalysisProperties); session.commit(); profiler.stop(); }
List<IdUuidPair> selectSnapshotIdUuids(PurgeSnapshotQuery query) { return purgeMapper.selectAnalysisIdsAndUuids(query); }
List<String> selectSnapshotUuids(PurgeSnapshotQuery query) { return purgeMapper.selectAnalysisIdsAndUuids(query).stream().map(IdUuidPair::getUuid).collect(Collectors.toList()); }
void deleteAnalyses(String rootUuid) { deleteAnalyses(purgeMapper.selectAnalysisIdsAndUuids(new PurgeSnapshotQuery().setComponentUuid(rootUuid))); }