session.commit();
profiler.stop();
- deleteSnapshotSources(snapshotIdsPartition);
-
deleteSnapshotGraphs(snapshotIdsPartition);
deleteSnapshotData(snapshotIdsPartition);
deleteSnapshotDuplications(snapshotIdsPartition);
- deleteSnapshotSources(snapshotIdsPartition);
-
deleteSnapshotGraphs(snapshotIdsPartition);
deleteSnapshotData(snapshotIdsPartition);
profiler.stop();
}
- private void deleteSnapshotSources(final List<List<Long>> snapshotIdsPartition) {
- profiler.start("deleteSnapshotSource (snapshot_sources)");
- for (List<Long> partSnapshotIds : snapshotIdsPartition) {
- purgeMapper.deleteSnapshotSource(partSnapshotIds);
- }
- session.commit();
- profiler.stop();
- }
-
private void deleteSnapshotDuplications(final List<List<Long>> snapshotIdsPartition) {
profiler.start("deleteSnapshotDuplications (duplications_index)");
for (List<Long> partSnapshotIds : snapshotIdsPartition) {
void deleteSnapshotMeasures(@Param("snapshotIds") List<Long> snapshotIds);
- void deleteSnapshotSource(@Param("snapshotIds") List<Long> snapshotIds);
-
void deleteSnapshotGraphs(@Param("snapshotIds") List<Long> snapshotIds);
void deleteSnapshotData(@Param("snapshotIds") List<Long> snapshotIds);
</foreach>
</delete>
- <delete id="deleteSnapshotSource" parameterType="map">
- delete from snapshot_sources where snapshot_id in
- <foreach collection="snapshotIds" open="(" close=")" item="snapshotId" separator=",">
- #{snapshotId}
- </foreach>
- </delete>
-
<delete id="deleteSnapshotGraphs" parameterType="map">
delete from graphs where snapshot_id in
<foreach collection="snapshotIds" open="(" close=")" item="snapshotId" separator=",">
MyBatis.closeQuietly(session);
}
checkTables("shouldDeleteSnapshot",
- "snapshots", "project_measures", "snapshot_sources", "duplications_index", "events", "dependencies", "snapshot_data");
+ "snapshots", "project_measures", "duplications_index", "events", "dependencies", "snapshot_data");
}
/**
MyBatis.closeQuietly(session);
}
checkTables("shouldPurgeSnapshot",
- "snapshots", "project_measures", "snapshot_sources", "duplications_index", "events", "dependencies", "snapshot_data");
+ "snapshots", "project_measures", "duplications_index", "events", "dependencies", "snapshot_data");
}
@Test
parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="P" islast="[false]"
path="[null]"/>
- <snapshot_sources ID="1" SNAPSHOT_ID="1" DATA="foo" UPDATED_AT="[null]"/>
<project_measures ID="1" characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]"
variation_value_3="[null]" variation_value_4="[null]"
variation_value_5="[null]"
dep_usage="USES" dep_weight="1" from_scope="PRJ" to_scope="LIB"/>
<events id="1" name="Version 1.0" resource_id="1" snapshot_id="1" category="VERSION" description="[null]"
event_date="2008-12-02 13:58:00.00" created_at="[null]" event_data="[null]"/>
- <duplications_index id="1" project_snapshot_id="1" snapshot_id="1" hash="bb" index_in_file="0" start_line="0" end_line="0"/>
- <snapshot_data id="1" resource_id="1" snapshot_id="1" snapshot_data="0,10,k" data_type="highlight_syntax" created_at="[null]" updated_at="[null]" />
+ <duplications_index id="1" project_snapshot_id="1" snapshot_id="1" hash="bb" index_in_file="0" start_line="0"
+ end_line="0"/>
+ <snapshot_data id="1" resource_id="1" snapshot_id="1" snapshot_data="0,10,k" data_type="highlight_syntax"
+ created_at="[null]" updated_at="[null]"/>
</dataset>
period3_mode="[null]" period3_param="[null]" period3_date="[null]"
period4_mode="[null]" period4_param="[null]" period4_date="[null]"
period5_mode="[null]" period5_param="[null]" period5_date="[null]"
- depth="[null]" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" build_date="2008-12-02 13:58:00.00"
+ depth="[null]" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00"
+ build_date="2008-12-02 13:58:00.00"
version="[null]" path="[null]"/>
- <snapshot_sources ID="1" SNAPSHOT_ID="1" DATA="foo"/>
<project_measures ID="1" characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]"
variation_value_3="[null]" variation_value_4="[null]"
variation_value_5="[null]"
dep_usage="USES" dep_weight="1" from_scope="PRJ" to_scope="LIB"/>
<events id="1" name="Version 1.0" resource_id="1" snapshot_id="1" category="VERSION" description="[null]"
event_date="2008-12-02 13:58:00.00" created_at="[null]" event_data="[null]"/>
- <duplications_index id="1" project_snapshot_id="1" snapshot_id="1" hash="bb" index_in_file="0" start_line="0" end_line="0"/>
- <snapshot_data id="1" resource_id="1" snapshot_id="1" snapshot_data="0,10,k" data_type="highlight_syntax" created_at="[null]" updated_at="[null]" />
+ <duplications_index id="1" project_snapshot_id="1" snapshot_id="1" hash="bb" index_in_file="0" start_line="0"
+ end_line="0"/>
+ <snapshot_data id="1" resource_id="1" snapshot_id="1" snapshot_data="0,10,k" data_type="highlight_syntax"
+ created_at="[null]" updated_at="[null]"/>
- <!-- snapshot to remove, id 5 on resource 5-->
+ <!-- snapshot to remove, id 5 on resource 5-->
<snapshots id="5" project_id="5" parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]"
status="P" islast="[true]" purge_status="[null]"
period1_mode="[null]" period1_param="[null]" period1_date="[null]"
period3_mode="[null]" period3_param="[null]" period3_date="[null]"
period4_mode="[null]" period4_param="[null]" period4_date="[null]"
period5_mode="[null]" period5_param="[null]" period5_date="[null]"
- depth="[null]" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" build_date="2008-12-02 13:58:00.00"
+ depth="[null]" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00"
+ build_date="2008-12-02 13:58:00.00"
version="[null]" path="[null]"/>
- <snapshot_sources ID="2" SNAPSHOT_ID="5" DATA="foo"/>
<project_measures ID="2" characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]"
variation_value_3="[null]" variation_value_4="[null]"
variation_value_5="[null]"
dep_usage="USES" dep_weight="1" from_scope="PRJ" to_scope="LIB"/>
<events id="2" name="Version 1.0" resource_id="5" snapshot_id="5" category="VERSION" description="[null]"
event_date="2008-12-02 13:58:00.00" created_at="[null]" event_data="[null]"/>
- <duplications_index id="2" project_snapshot_id="5" snapshot_id="5" hash="bb" index_in_file="0" start_line="0" end_line="0"/>
- <snapshot_data id="2" resource_id="5" snapshot_id="5" snapshot_data="0,10,k" data_type="highlight_syntax" created_at="[null]" updated_at="[null]" />
+ <duplications_index id="2" project_snapshot_id="5" snapshot_id="5" hash="bb" index_in_file="0" start_line="0"
+ end_line="0"/>
+ <snapshot_data id="2" resource_id="5" snapshot_id="5" snapshot_data="0,10,k" data_type="highlight_syntax"
+ created_at="[null]" updated_at="[null]"/>
</dataset>
period3_mode="[null]" period3_param="[null]" period3_date="[null]"
period4_mode="[null]" period4_param="[null]" period4_date="[null]"
period5_mode="[null]" period5_param="[null]" period5_date="[null]"
- depth="[null]" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" build_date="2008-12-02 13:58:00.00" version="[null]" path="[null]"/>
-
- <!--<snapshot_sources ID="1" SNAPSHOT_ID="1" DATA="foo"/>-->
+ depth="[null]" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00"
+ build_date="2008-12-02 13:58:00.00" version="[null]" path="[null]"/>
<!--switched_off="[null]" permanent_id="[null]" RULE_ID="1" FAILURE_LEVEL="2"-->
<!--MESSAGE="msg1" LINE="[null]" COST="[null]"-->
<!--checksum="[null]" person_id="[null]"/>-->
<project_measures ID="1" project_id="1" SNAPSHOT_ID="1" RULE_ID="[null]" characteristic_id="[null]"
- url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]"
- variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" VALUE="10.0" METRIC_ID="1" rules_category_id="[null]"
+ url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]"
+ variation_value_4="[null]"
+ variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" VALUE="10.0" METRIC_ID="1"
+ rules_category_id="[null]"
person_id="[null]"
- text_value="[null]" tendency="[null]" measure_date="[null]" alert_status="[null]" description="[null]" measure_data="[null]"/>
+ text_value="[null]" tendency="[null]" measure_date="[null]" alert_status="[null]"
+ description="[null]" measure_data="[null]"/>
<!--<dependencies id="1" from_resource_id="1" from_snapshot_id="1" to_resource_id="2" to_snapshot_id="2"-->
<!--parent_dependency_id="[null]" project_snapshot_id="[null]"-->
<!--dep_usage="USES" dep_weight="1" from_scope="LIB" to_scope="PRJ"/>-->
<events id="1" resource_id="1" snapshot_id="1"
- category="VERSION" description="[null]" name="Version 1.0" event_date="2008-12-02 13:58:00.00" created_at="[null]"
+ category="VERSION" description="[null]" name="Version 1.0" event_date="2008-12-02 13:58:00.00"
+ created_at="[null]"
event_data="[null]"/>
<!--<duplications_index id="1" project_snapshot_id="1" snapshot_id="1"-->
period3_mode="[null]" period3_param="[null]" period3_date="[null]"
period4_mode="[null]" period4_param="[null]" period4_date="[null]"
period5_mode="[null]" period5_param="[null]" period5_date="[null]"
- depth="[null]" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" build_date="2008-12-02 13:58:00.00" version="[null]" path="[null]"/>
+ depth="[null]" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00"
+ build_date="2008-12-02 13:58:00.00" version="[null]" path="[null]"/>
- <snapshot_sources ID="2" SNAPSHOT_ID="2" DATA="foo" UPDATED_AT="[null]"/>
<project_measures ID="2" project_id="2" SNAPSHOT_ID="2" RULE_ID="[null]" characteristic_id="[null]"
- url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]"
- variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" VALUE="10.0" METRIC_ID="1" rules_category_id="[null]"
+ url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]"
+ variation_value_4="[null]"
+ variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" VALUE="10.0" METRIC_ID="1"
+ rules_category_id="[null]"
person_id="[null]"
- text_value="[null]" tendency="[null]" measure_date="[null]" alert_status="[null]" description="[null]" measure_data="[null]"/>
+ text_value="[null]" tendency="[null]" measure_date="[null]" alert_status="[null]"
+ description="[null]" measure_data="[null]"/>
<dependencies id="3" from_resource_id="33" from_snapshot_id="33" to_resource_id="44" to_snapshot_id="44"
parent_dependency_id="[null]" project_snapshot_id="[null]"
dep_usage="USES" dep_weight="1" from_scope="LIB" to_scope="PRJ"/>
<events id="2" resource_id="2" snapshot_id="2"
- category="VERSION" description="[null]" name="Version 1.0" event_date="2008-12-02 13:58:00.00" created_at="[null]"
+ category="VERSION" description="[null]" name="Version 1.0" event_date="2008-12-02 13:58:00.00"
+ created_at="[null]"
event_data="[null]"/>
<duplications_index id="2" project_snapshot_id="2" snapshot_id="2"
hash="bb" index_in_file="0" start_line="0" end_line="0"/>
- <snapshot_data id="2" resource_id="5" snapshot_id="5" snapshot_data="0,10,k" data_type="highlight_syntax" created_at="[null]" updated_at="[null]" />
+ <snapshot_data id="2" resource_id="5" snapshot_id="5" snapshot_data="0,10,k" data_type="highlight_syntax"
+ created_at="[null]" updated_at="[null]"/>
</dataset>
period3_mode="[null]" period3_param="[null]" period3_date="[null]"
period4_mode="[null]" period4_param="[null]" period4_date="[null]"
period5_mode="[null]" period5_param="[null]" period5_date="[null]"
- depth="[null]" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" build_date="2008-12-02 13:58:00.00" version="[null]" path="[null]"/>
-
- <snapshot_sources ID="1" SNAPSHOT_ID="1" DATA="foo"/>
+ depth="[null]" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00"
+ build_date="2008-12-02 13:58:00.00" version="[null]" path="[null]"/>
<project_measures ID="1" project_id="1" SNAPSHOT_ID="1" RULE_ID="[null]" characteristic_id="[null]"
- url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]"
- variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" VALUE="10.0" METRIC_ID="1" rules_category_id="[null]"
- person_id="[null]"
- text_value="[null]" tendency="[null]" measure_date="[null]" alert_status="[null]" description="[null]" measure_data="[null]"/>
+ url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]"
+ variation_value_4="[null]" variation_value_5="[null]" rule_priority="[null]" alert_text="[null]"
+ VALUE="10.0" METRIC_ID="1" rules_category_id="[null]" person_id="[null]" text_value="[null]"
+ tendency="[null]" measure_date="[null]" alert_status="[null]" description="[null]"
+ measure_data="[null]"/>
<dependencies id="1" from_resource_id="1" from_snapshot_id="1" to_resource_id="2" to_snapshot_id="2"
parent_dependency_id="[null]" project_snapshot_id="[null]"
dep_usage="USES" dep_weight="1" from_scope="LIB" to_scope="PRJ"/>
<events id="1" resource_id="1" snapshot_id="1"
- category="VERSION" description="[null]" name="Version 1.0" event_date="2008-12-02 13:58:00.00" created_at="[null]"
+ category="VERSION" description="[null]" name="Version 1.0" event_date="2008-12-02 13:58:00.00"
+ created_at="[null]"
event_data="[null]"/>
<duplications_index id="1" project_snapshot_id="1" snapshot_id="1"
hash="bb" index_in_file="0" start_line="0" end_line="0"/>
- <snapshot_data id="1" resource_id="1" snapshot_id="1" snapshot_data="0,10,k" data_type="highlight_syntax" created_at="[null]" updated_at="[null]" />
+ <snapshot_data id="1" resource_id="1" snapshot_id="1" snapshot_data="0,10,k" data_type="highlight_syntax"
+ created_at="[null]" updated_at="[null]"/>
<!-- The following is not purged but is kept for DBUnit -->
<snapshots id="2"
- project_id="2" parent_snapshot_id="[null]" root_project_id="2" root_snapshot_id="[null]"
- status="P" islast="[false]" purge_status="1"
- period1_mode="[null]" period1_param="[null]" period1_date="[null]"
- period2_mode="[null]" period2_param="[null]" period2_date="[null]"
- period3_mode="[null]" period3_param="[null]" period3_date="[null]"
- period4_mode="[null]" period4_param="[null]" period4_date="[null]"
- period5_mode="[null]" period5_param="[null]" period5_date="[null]"
- depth="[null]" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" build_date="2008-12-02 13:58:00.00" version="[null]" path="[null]"/>
-
- <snapshot_sources ID="2" SNAPSHOT_ID="2" DATA="foo"/>
-
- <project_measures ID="2" project_id="2" SNAPSHOT_ID="2" RULE_ID="[null]" characteristic_id="[null]"
- url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]"
- variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" VALUE="10.0" METRIC_ID="1" rules_category_id="[null]"
- person_id="[null]"
- text_value="[null]" tendency="[null]" measure_date="[null]" alert_status="[null]" description="[null]" measure_data="[null]"/>
-
- <dependencies id="3" from_resource_id="33" from_snapshot_id="33" to_resource_id="44" to_snapshot_id="44"
- parent_dependency_id="[null]" project_snapshot_id="[null]"
- dep_usage="USES" dep_weight="1" from_scope="PRJ" to_scope="LIB"/>
-
- <dependencies id="4" from_resource_id="55" from_snapshot_id="55" to_resource_id="66" to_snapshot_id="66"
- parent_dependency_id="[null]" project_snapshot_id="2"
- dep_usage="USES" dep_weight="1" from_scope="LIB" to_scope="PRJ"/>
-
- <events id="2" resource_id="2" snapshot_id="2"
- category="VERSION" description="[null]" name="Version 1.0" event_date="2008-12-02 13:58:00.00" created_at="[null]"
- event_data="[null]"/>
-
- <duplications_index id="2" project_snapshot_id="2" snapshot_id="2"
- hash="bb" index_in_file="0" start_line="0" end_line="0"/>
-
- <snapshot_data id="2" resource_id="5" snapshot_id="5" snapshot_data="0,10,k" data_type="highlight_syntax" created_at="[null]" updated_at="[null]" />
+ project_id="2" parent_snapshot_id="[null]" root_project_id="2" root_snapshot_id="[null]"
+ status="P" islast="[false]" purge_status="1"
+ period1_mode="[null]" period1_param="[null]" period1_date="[null]"
+ period2_mode="[null]" period2_param="[null]" period2_date="[null]"
+ period3_mode="[null]" period3_param="[null]" period3_date="[null]"
+ period4_mode="[null]" period4_param="[null]" period4_date="[null]"
+ period5_mode="[null]" period5_param="[null]" period5_date="[null]"
+ depth="[null]" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00"
+ build_date="2008-12-02 13:58:00.00" version="[null]" path="[null]"/>
+
+ <project_measures ID="2" project_id="2" SNAPSHOT_ID="2" RULE_ID="[null]" characteristic_id="[null]"
+ url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]"
+ variation_value_4="[null]"
+ variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" VALUE="10.0" METRIC_ID="1"
+ rules_category_id="[null]"
+ person_id="[null]"
+ text_value="[null]" tendency="[null]" measure_date="[null]" alert_status="[null]"
+ description="[null]" measure_data="[null]"/>
+
+ <dependencies id="3" from_resource_id="33" from_snapshot_id="33" to_resource_id="44" to_snapshot_id="44"
+ parent_dependency_id="[null]" project_snapshot_id="[null]"
+ dep_usage="USES" dep_weight="1" from_scope="PRJ" to_scope="LIB"/>
+
+ <dependencies id="4" from_resource_id="55" from_snapshot_id="55" to_resource_id="66" to_snapshot_id="66"
+ parent_dependency_id="[null]" project_snapshot_id="2"
+ dep_usage="USES" dep_weight="1" from_scope="LIB" to_scope="PRJ"/>
+
+ <events id="2" resource_id="2" snapshot_id="2"
+ category="VERSION" description="[null]" name="Version 1.0" event_date="2008-12-02 13:58:00.00"
+ created_at="[null]"
+ event_data="[null]"/>
+
+ <duplications_index id="2" project_snapshot_id="2" snapshot_id="2"
+ hash="bb" index_in_file="0" start_line="0" end_line="0"/>
+
+ <snapshot_data id="2" resource_id="5" snapshot_id="5" snapshot_data="0,10,k" data_type="highlight_syntax"
+ created_at="[null]" updated_at="[null]"/>
</dataset>