aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeCommands.java18
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeDao.java2
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeMapper.java20
-rw-r--r--server/sonar-db-dao/src/main/resources/org/sonar/db/purge/PurgeMapper.xml32
4 files changed, 36 insertions, 36 deletions
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeCommands.java b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeCommands.java
index 8df3dfbc83b..7e6c0f1bf6f 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeCommands.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeCommands.java
@@ -58,7 +58,7 @@ class PurgeCommands {
void deleteAnalyses(String rootUuid) {
profiler.start("deleteAnalyses (events)");
- purgeMapper.deleteComponentEvents(rootUuid);
+ purgeMapper.deleteEventsByComponentUuid(rootUuid);
session.commit();
profiler.stop();
@@ -134,31 +134,31 @@ class PurgeCommands {
void deletePermissions(long rootId) {
profiler.start("deletePermissions (group_roles)");
- purgeMapper.deleteComponentGroupRoles(rootId);
+ purgeMapper.deleteGroupRolesByComponentId(rootId);
session.commit();
profiler.stop();
profiler.start("deletePermissions (user_roles)");
- purgeMapper.deleteComponentUserRoles(rootId);
+ purgeMapper.deleteUserRolesByComponentId(rootId);
session.commit();
profiler.stop();
}
void deleteIssues(String rootUuid) {
profiler.start("deleteIssues (issue_changes)");
- purgeMapper.deleteComponentIssueChanges(rootUuid);
+ purgeMapper.deleteIssueChangesByProjectUuid(rootUuid);
session.commit();
profiler.stop();
profiler.start("deleteIssues (issues)");
- purgeMapper.deleteComponentIssues(rootUuid);
+ purgeMapper.deleteIssuesByProjectUuid(rootUuid);
session.commit();
profiler.stop();
}
void deleteLinks(String rootUuid) {
profiler.start("deleteLinks (project_links)");
- purgeMapper.deleteComponentLinks(rootUuid);
+ purgeMapper.deleteProjectLinksByComponentUuid(rootUuid);
session.commit();
profiler.stop();
}
@@ -168,19 +168,19 @@ class PurgeCommands {
List<List<String>> uuidsPartitions = Lists.partition(IdUuidPairs.uuids(rootAndModulesOrSubviewsIds), MAX_RESOURCES_PER_QUERY);
profiler.start("deleteByRootAndModulesOrSubviews (properties)");
- idPartitions.forEach(purgeMapper::deleteComponentProperties);
+ idPartitions.forEach(purgeMapper::deletePropertiesByComponentIds);
session.commit();
profiler.stop();
profiler.start("deleteByRootAndModulesOrSubviews (manual_measures)");
- uuidsPartitions.forEach(purgeMapper::deleteComponentManualMeasures);
+ uuidsPartitions.forEach(purgeMapper::deleteManualMeasuresByComponentUuids);
session.commit();
profiler.stop();
}
void deleteComponents(String rootUuid) {
profiler.start("deleteComponents (projects)");
- purgeMapper.deleteComponents(rootUuid);
+ purgeMapper.deleteComponentsByProjectUuid(rootUuid);
session.commit();
profiler.stop();
}
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeDao.java
index 216a92217e1..59b621b7747 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeDao.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeDao.java
@@ -126,7 +126,7 @@ public class PurgeDao implements Dao {
PurgeMapper mapper = mapper(session);
executeLargeInputs(conf.getDisabledComponentUuids(),
input -> {
- mapper.deleteFileSourcesByUuid(input);
+ mapper.deleteFileSourcesByFileUuid(input);
mapper.resolveComponentIssuesNotAlreadyResolved(input, system2.now());
return emptyList();
});
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeMapper.java b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeMapper.java
index 6889113e7ae..6ea23a7994b 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeMapper.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeMapper.java
@@ -50,27 +50,27 @@ public interface PurgeMapper {
void resolveComponentIssuesNotAlreadyResolved(@Param("componentUuids") List<String> componentUuids, @Param("dateAsLong") Long dateAsLong);
- void deleteComponentLinks(@Param("rootUuid") String rootUuid);
+ void deleteProjectLinksByComponentUuid(@Param("rootUuid") String rootUuid);
- void deleteComponentProperties(@Param("componentIds") List<Long> componentIds);
+ void deletePropertiesByComponentIds(@Param("componentIds") List<Long> componentIds);
- void deleteComponents(@Param("rootUuid") String rootUuid);
+ void deleteComponentsByProjectUuid(@Param("rootUuid") String rootUuid);
- void deleteComponentGroupRoles(@Param("rootId") long rootId);
+ void deleteGroupRolesByComponentId(@Param("rootId") long rootId);
- void deleteComponentUserRoles(@Param("rootId") long rootId);
+ void deleteUserRolesByComponentId(@Param("rootId") long rootId);
- void deleteComponentManualMeasures(@Param("componentUuids") List<String> componentUuids);
+ void deleteManualMeasuresByComponentUuids(@Param("componentUuids") List<String> componentUuids);
- void deleteComponentEvents(@Param("componentUuid") String componentUuid);
+ void deleteEventsByComponentUuid(@Param("componentUuid") String componentUuid);
List<PurgeableAnalysisDto> selectPurgeableAnalysesWithEvents(@Param("componentUuid") String componentUuid);
List<PurgeableAnalysisDto> selectPurgeableAnalysesWithoutEvents(@Param("componentUuid") String componentUuid);
- void deleteComponentIssueChanges(@Param("rootUuid") String rootUuid);
+ void deleteIssueChangesByProjectUuid(@Param("projectUuid") String projectUuid);
- void deleteComponentIssues(@Param("rootUuid") String rootUuid);
+ void deleteIssuesByProjectUuid(@Param("projectUuid") String projectUuid);
List<String> selectOldClosedIssueKeys(@Param("projectUuid") String projectUuid, @Nullable @Param("toDate") Long toDate);
@@ -80,7 +80,7 @@ public interface PurgeMapper {
void deleteFileSourcesByProjectUuid(String rootProjectUuid);
- void deleteFileSourcesByUuid(@Param("fileUuids") List<String> fileUuids);
+ void deleteFileSourcesByFileUuid(@Param("fileUuids") List<String> fileUuids);
void deleteCeActivityByProjectUuid(@Param("projectUuid") String projectUuid);
diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/purge/PurgeMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/purge/PurgeMapper.xml
index 8f81562b9a6..80f7f578784 100644
--- a/server/sonar-db-dao/src/main/resources/org/sonar/db/purge/PurgeMapper.xml
+++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/purge/PurgeMapper.xml
@@ -163,13 +163,13 @@
and resolution is null
</update>
- <delete id="deleteComponentLinks" parameterType="map">
+ <delete id="deleteProjectLinksByComponentUuid" parameterType="map">
delete from project_links
where
component_uuid = #{rootUuid,jdbcType=VARCHAR}
</delete>
- <delete id="deleteComponentProperties" parameterType="map">
+ <delete id="deletePropertiesByComponentIds" parameterType="map">
delete from properties
where
resource_id in
@@ -178,70 +178,70 @@
</foreach>
</delete>
- <delete id="deleteComponents" parameterType="map">
+ <delete id="deleteComponentsByProjectUuid" parameterType="map">
delete from projects
where
project_uuid = #{rootUuid,jdbcType=VARCHAR}
</delete>
- <delete id="deleteComponentGroupRoles" parameterType="map">
+ <delete id="deleteGroupRolesByComponentId" parameterType="map">
delete from group_roles
where
resource_id = #{rootId,jdbcType=INTEGER}
</delete>
- <delete id="deleteComponentUserRoles" parameterType="map">
+ <delete id="deleteUserRolesByComponentId" parameterType="map">
delete from user_roles
where
resource_id = #{rootId,jdbcType=INTEGER}
</delete>
- <delete id="deleteComponentManualMeasures" parameterType="map">
+ <delete id="deleteManualMeasuresByComponentUuids" parameterType="map">
delete from manual_measures where component_uuid in
<foreach collection="componentUuids" open="(" close=")" item="componentUuid" separator=",">
#{componentUuid,jdbcType=VARCHAR}
</foreach>
</delete>
- <delete id="deleteComponentEvents" parameterType="map">
+ <delete id="deleteEventsByComponentUuid" parameterType="map">
delete from events
where
component_uuid = #{componentUuid,jdbcType=VARCHAR}
</delete>
- <delete id="deleteComponentIssueChanges" parameterType="map">
+ <delete id="deleteIssueChangesByProjectUuid" parameterType="map">
delete from issue_changes ic
where
- exists (select 1 from issues i where i.kee=ic.issue_key and i.project_uuid = #{rootUuid,jdbcType=VARCHAR})
+ exists (select 1 from issues i where i.kee=ic.issue_key and i.project_uuid = #{projectUuid,jdbcType=VARCHAR})
</delete>
<!-- Mssql -->
- <delete id="deleteComponentIssueChanges" databaseId="mssql" parameterType="map">
+ <delete id="deleteIssueChangesByProjectUuid" databaseId="mssql" parameterType="map">
delete issue_changes from issue_changes
inner join issues on
issue_changes.issue_key=issues.kee
where
- issues.project_uuid = #{rootUuid,jdbcType=VARCHAR}
+ issues.project_uuid = #{projectUuid,jdbcType=VARCHAR}
</delete>
<!-- Mysql -->
- <delete id="deleteComponentIssueChanges" databaseId="mysql" parameterType="map">
+ <delete id="deleteIssueChangesByProjectUuid" databaseId="mysql" parameterType="map">
delete ic from issue_changes as ic, issues as i
where
ic.issue_key=i.kee
- and i.component_uuid = #{rootUuid,jdbcType=VARCHAR}
+ and i.component_uuid = #{projectUuid,jdbcType=VARCHAR}
</delete>
- <delete id="deleteComponentIssues" parameterType="map">
+ <delete id="deleteIssuesByProjectUuid" parameterType="map">
delete from issues
- where project_uuid = #{rootUuid,jdbcType=VARCHAR}
+ where project_uuid = #{projectUuid,jdbcType=VARCHAR}
</delete>
<delete id="deleteFileSourcesByProjectUuid">
delete from file_sources where project_uuid=#{rootProjectUuid,jdbcType=VARCHAR}
</delete>
- <delete id="deleteFileSourcesByUuid">
+ <delete id="deleteFileSourcesByFileUuid">
delete from file_sources
where
file_uuid in