@@ -40,7 +40,6 @@ public final class SnapshotDto { | |||
private Long createdAt; | |||
private Long buildDate; | |||
private String status = STATUS_UNPROCESSED; | |||
private Integer purgeStatus; | |||
private Boolean last; | |||
private String codePeriodVersion; | |||
private String projectVersion; | |||
@@ -93,16 +92,6 @@ public final class SnapshotDto { | |||
return this; | |||
} | |||
@CheckForNull | |||
public Integer getPurgeStatus() { | |||
return purgeStatus; | |||
} | |||
public SnapshotDto setPurgeStatus(@Nullable Integer purgeStatus) { | |||
this.purgeStatus = purgeStatus; | |||
return this; | |||
} | |||
public Boolean getLast() { | |||
return last; | |||
} | |||
@@ -215,7 +204,6 @@ public final class SnapshotDto { | |||
Objects.equals(createdAt, that.createdAt) && | |||
Objects.equals(buildDate, that.buildDate) && | |||
Objects.equals(status, that.status) && | |||
Objects.equals(purgeStatus, that.purgeStatus) && | |||
Objects.equals(last, that.last) && | |||
Objects.equals(codePeriodVersion, that.codePeriodVersion) && | |||
Objects.equals(projectVersion, that.projectVersion) && | |||
@@ -226,7 +214,7 @@ public final class SnapshotDto { | |||
@Override | |||
public int hashCode() { | |||
return Objects.hash(id, uuid, componentUuid, createdAt, buildDate, status, purgeStatus, last, codePeriodVersion, projectVersion, periodMode, periodParam, periodDate); | |||
return Objects.hash(id, uuid, componentUuid, createdAt, buildDate, status, last, codePeriodVersion, projectVersion, periodMode, periodParam, periodDate); | |||
} | |||
@Override | |||
@@ -238,7 +226,6 @@ public final class SnapshotDto { | |||
", createdAt=" + createdAt + | |||
", buildDate=" + buildDate + | |||
", status='" + status + '\'' + | |||
", purgeStatus=" + purgeStatus + | |||
", last=" + last + | |||
", codePeriodVersion='" + codePeriodVersion + '\'' + | |||
", projectVersion='" + projectVersion + '\'' + |
@@ -52,6 +52,10 @@ public interface PurgeMapper { | |||
void deleteAnalysisWastedMeasures(@Param("analysisUuids") List<String> analysisUuids, @Param("metricIds") List<Long> metricIds); | |||
/** | |||
* Purge status flag is used to not attempt to remove duplications & historical data of analysis of which we already | |||
* removed them. | |||
*/ | |||
void updatePurgeStatusToOne(@Param("analysisUuids") List<String> analysisUuid); | |||
void resolveComponentIssuesNotAlreadyResolved(@Param("componentUuids") List<String> componentUuids, @Param("dateAsLong") Long dateAsLong); |
@@ -28,6 +28,9 @@ public final class PurgeSnapshotQuery { | |||
private final String componentUuid; | |||
private String[] status; | |||
private Boolean islast; | |||
/** | |||
* If {@code true}, selects only analysis which have not been purged from historical and duplication data before. | |||
*/ | |||
private Boolean notPurged; | |||
public PurgeSnapshotQuery(String componentUuid) { |
@@ -9,7 +9,6 @@ | |||
s.created_at as createdAt, | |||
s.build_date as buildDate, | |||
s.status as status, | |||
s.purge_status as purgeStatus, | |||
s.islast as last, | |||
s.version as rawCodePeriodVersion, | |||
s.project_version as rawProjectVersion, | |||
@@ -164,7 +163,6 @@ | |||
created_at, | |||
build_date, | |||
status, | |||
purge_status, | |||
islast, | |||
version, | |||
project_version, | |||
@@ -178,7 +176,6 @@ | |||
#{createdAt, jdbcType=BIGINT}, | |||
#{buildDate, jdbcType=BIGINT}, | |||
#{status, jdbcType=VARCHAR}, | |||
#{purgeStatus, jdbcType=INTEGER}, | |||
#{last, jdbcType=BOOLEAN}, | |||
#{codePeriodVersion, jdbcType=VARCHAR}, | |||
#{projectVersion, jdbcType=VARCHAR}, |
@@ -73,7 +73,6 @@ public class SnapshotDaoTest { | |||
.setUuid("ABCD") | |||
.setStatus("P") | |||
.setLast(true) | |||
.setPurgeStatus(1) | |||
.setPeriodMode("days") | |||
.setPeriodParam("30") | |||
.setPeriodDate(1500000000001L) | |||
@@ -88,7 +87,6 @@ public class SnapshotDaoTest { | |||
assertThat(result.getComponentUuid()).isEqualTo(project.uuid()); | |||
assertThat(result.getStatus()).isEqualTo("P"); | |||
assertThat(result.getLast()).isTrue(); | |||
assertThat(result.getPurgeStatus()).isEqualTo(1); | |||
assertThat(result.getCodePeriodVersion()).isEqualTo("2.1-SNAPSHOT"); | |||
assertThat(result.getProjectVersion()).isEqualTo("2.1.0.2336"); | |||
assertThat(result.getPeriodMode()).isEqualTo("days"); | |||
@@ -299,7 +297,6 @@ public class SnapshotDaoTest { | |||
SnapshotDto dto = underTest.insert(db.getSession(), newAnalysis(project) | |||
.setStatus("P") | |||
.setLast(true) | |||
.setPurgeStatus(1) | |||
.setPeriodMode("days") | |||
.setPeriodParam("30") | |||
.setPeriodDate(1500000000001L) | |||
@@ -312,7 +309,6 @@ public class SnapshotDaoTest { | |||
assertThat(dto.getComponentUuid()).isEqualTo(project.uuid()); | |||
assertThat(dto.getStatus()).isEqualTo("P"); | |||
assertThat(dto.getLast()).isTrue(); | |||
assertThat(dto.getPurgeStatus()).isEqualTo(1); | |||
assertThat(dto.getPeriodMode()).isEqualTo("days"); | |||
assertThat(dto.getPeriodModeParameter()).isEqualTo("30"); | |||
assertThat(dto.getPeriodDate()).isEqualTo(1500000000001L); | |||
@@ -436,7 +432,6 @@ public class SnapshotDaoTest { | |||
.setComponentUuid("uuid_3") | |||
.setStatus("P") | |||
.setLast(true) | |||
.setPurgeStatus(1) | |||
.setCodePeriodVersion("2.1-SNAPSHOT") | |||
.setPeriodMode("days1") | |||
.setPeriodParam("30") |