Interface KeepRule
-
- All Superinterfaces:
DbFieldsProvider
- All Known Subinterfaces:
SKeepRule
- All Known Implementing Classes:
KeepRuleImpl
public interface KeepRule extends DbFieldsProvider
Defines builds keep rule. Provides: 1) for history builds - data parts to keep; 2) for all (history and statistical) builds - build ids to keep statistics. Build data that should be kept by any rule will not be cleaned during cleanup.- Since:
- 2019.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Collection<Long>
computeBuildIdsToKeepStatistics(String buildTypeId, DbBuildsData buildsData)
Returns such ids of the provided builds, statistical data of which should be kept.Map<Long,Collection<KeepBuildDataPart>>
computeHistoryBuildsDataToKeep(String buildTypeId, DbBuildsData historyBuildsData)
Computes data to keep for every incoming history build.Collection<DbField<?>>
getRequiredDbFields()
Provides database fields that should be requested within one query.boolean
shouldPreserveArtifactDependencies()
Defines should all artifact dependencies (some builds typically from another build configurations) be kept for such builds, history of which is preserved by this rule, i.e.
-
-
-
Method Detail
-
getRequiredDbFields
@NotNull Collection<DbField<?>> getRequiredDbFields()
Provides database fields that should be requested within one query. Can be empty.- Specified by:
getRequiredDbFields
in interfaceDbFieldsProvider
-
shouldPreserveArtifactDependencies
boolean shouldPreserveArtifactDependencies()
Defines should all artifact dependencies (some builds typically from another build configurations) be kept for such builds, history of which is preserved by this rule, i.e.computeHistoryBuildsDataToKeep(String, DbBuildsData)
)} result has aKeepBuildDataPart
with levelKeepLevel.HISTORY
or stronger for build.
-
computeHistoryBuildsDataToKeep
@NotNull Map<Long,Collection<KeepBuildDataPart>> computeHistoryBuildsDataToKeep(@NotNull String buildTypeId, @NotNull DbBuildsData historyBuildsData)
Computes data to keep for every incoming history build. If no data of some build should be kept, its id should be either absent in the result either data parts collection should be empty. There is no sense to return suchKeepBuildDataPart
that do not keep history.
AllhistoryBuildsData
must belong to the same build configuration with idbuildTypeId
.- Returns:
- map from build id to collection of build data parts to keep
-
computeBuildIdsToKeepStatistics
@NotNull Collection<Long> computeBuildIdsToKeepStatistics(@NotNull String buildTypeId, @NotNull DbBuildsData buildsData)
Returns such ids of the provided builds, statistical data of which should be kept.
AllbuildsData
must belong to the same build configuration with idbuildTypeId
.- Returns:
- build ids to keep
-
-