Class KeepRuleImpl
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.cleanup.v2019.rules.KeepRuleImpl
-
- All Implemented Interfaces:
SKeepRule
,DbFieldsProvider
,KeepRule
public class KeepRuleImpl extends Object implements SKeepRule
- Since:
- 2019.1
- See Also:
StorableRule
-
-
Constructor Summary
Constructors Constructor Description KeepRuleImpl(Set<KeepBuildDataPart> keepBuildDataParts, Set<KeepFilter> filters, Set<KeepPartition> partitions, KeepLimit limit, boolean preserveArtifactDependencies)
-
Method Summary
All Methods Static Methods Instance Methods Concrete 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.static KeepLevel
computeHigherLevel(Collection<KeepBuildDataPart> keepBuildDataParts)
Returns higher keep level of the provided keep build data parts.Map<Long,Collection<KeepBuildDataPart>>
computeHistoryBuildsDataToKeep(String buildTypeId, DbBuildsData historyBuildsData)
Computes data to keep for every incoming history build.boolean
equals(Object o)
Collection<KeepFilter>
getFilters()
Only builds satisfying all the filters will be kept by this rule.Collection<KeepBuildDataPart>
getKeepBuildDataParts()
KeepLimit
getLimit()
Limits builds to keep (after filtering, for every partition subset).Collection<KeepPartition>
getPartitions()
Provides builds partitioning to subsets: builds are in the same subset if they are in the same partition for every partition.int
hashCode()
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.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.serverSide.impl.cleanup.SKeepRule
getRequiredDbFields
-
-
-
-
Constructor Detail
-
KeepRuleImpl
public KeepRuleImpl(@NotNull Set<KeepBuildDataPart> keepBuildDataParts, @NotNull Set<KeepFilter> filters, @NotNull Set<KeepPartition> partitions, @NotNull KeepLimit limit, boolean preserveArtifactDependencies) throws IllegalRuleException
- Throws:
IllegalRuleException
-
-
Method Detail
-
getKeepBuildDataParts
@NotNull public Collection<KeepBuildDataPart> getKeepBuildDataParts()
- Specified by:
getKeepBuildDataParts
in interfaceSKeepRule
-
getFilters
@NotNull public Collection<KeepFilter> getFilters()
Description copied from interface:SKeepRule
Only builds satisfying all the filters will be kept by this rule.- Specified by:
getFilters
in interfaceSKeepRule
-
getPartitions
@NotNull public Collection<KeepPartition> getPartitions()
Description copied from interface:SKeepRule
Provides builds partitioning to subsets: builds are in the same subset if they are in the same partition for every partition. Preserving will be applied for every subset separately.- Specified by:
getPartitions
in interfaceSKeepRule
-
getLimit
@NotNull public KeepLimit getLimit()
Description copied from interface:SKeepRule
Limits builds to keep (after filtering, for every partition subset).
-
shouldPreserveArtifactDependencies
public boolean shouldPreserveArtifactDependencies()
Description copied from interface:KeepRule
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.KeepRule.computeHistoryBuildsDataToKeep(String, DbBuildsData)
)} result has aKeepBuildDataPart
with levelKeepLevel.HISTORY
or stronger for build.- Specified by:
shouldPreserveArtifactDependencies
in interfaceKeepRule
-
computeHistoryBuildsDataToKeep
@NotNull public Map<Long,Collection<KeepBuildDataPart>> computeHistoryBuildsDataToKeep(@NotNull String buildTypeId, @NotNull DbBuildsData historyBuildsData)
Description copied from interface:KeepRule
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
.- Specified by:
computeHistoryBuildsDataToKeep
in interfaceKeepRule
- Returns:
- map from build id to collection of build data parts to keep
-
computeBuildIdsToKeepStatistics
@NotNull public Collection<Long> computeBuildIdsToKeepStatistics(@NotNull String buildTypeId, @NotNull DbBuildsData buildsData)
Description copied from interface:KeepRule
Returns such ids of the provided builds, statistical data of which should be kept.
AllbuildsData
must belong to the same build configuration with idbuildTypeId
.- Specified by:
computeBuildIdsToKeepStatistics
in interfaceKeepRule
- Returns:
- build ids to keep
-
computeHigherLevel
@NotNull public static KeepLevel computeHigherLevel(@NotNull Collection<KeepBuildDataPart> keepBuildDataParts)
Returns higher keep level of the provided keep build data parts. Can beKeepLevel.STATISTICS
or stronger (more preserving).
-
-