Class BuildPromotionReplacementImpl
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.BuildPromotionReplacementImpl
-
- All Implemented Interfaces:
BuildPromotionReplacement
,BuildPromotionReplacementLog
public class BuildPromotionReplacementImpl extends Object implements BuildPromotionReplacement
This log keeps history of build promotion replacements done during various optimizations - merging in the queue, or substituting of the queued builds to already started builds.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
BuildPromotionReplacementImpl.ReplacementStatisticsImpl
-
Nested classes/interfaces inherited from interface jetbrains.buildServer.serverSide.BuildPromotionReplacement
BuildPromotionReplacement.ReplacementStatistics
-
Nested classes/interfaces inherited from interface jetbrains.buildServer.serverSide.impl.BuildPromotionReplacementLog
BuildPromotionReplacementLog.ReplacementReason
-
-
Field Summary
Fields Modifier and Type Field Description static String
REPLACEMENT_EVENT_NAME
-
Constructor Summary
Constructors Constructor Description BuildPromotionReplacementImpl(BuildPromotionManager buildPromotionManager, ServerMetricsFactory metrics, MultiNodesEvents nodesEvents)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<Long>
getOriginalPromotionIds(long replacementId)
Long
getReplacementId(long originalPromotionId)
For a given promotion id returns id of another promotion which replaced the given one in build queue.BuildPromotionReplacement.ReplacementStatistics
getStatistics()
void
rememberReplacements(Map<BuildPromotion,BuildPromotion> replacementMap, BuildPromotionReplacementLog.ReplacementReason reason)
Registers a replacement map in the log of replacementsvoid
setBuildDurationCalculator(BuildDurationCalculator buildDurationCalculator)
-
-
-
Field Detail
-
REPLACEMENT_EVENT_NAME
public static final String REPLACEMENT_EVENT_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BuildPromotionReplacementImpl
public BuildPromotionReplacementImpl(@NotNull BuildPromotionManager buildPromotionManager, @NotNull ServerMetricsFactory metrics, @NotNull MultiNodesEvents nodesEvents)
-
-
Method Detail
-
setBuildDurationCalculator
public void setBuildDurationCalculator(@NotNull BuildDurationCalculator buildDurationCalculator)
-
rememberReplacements
public void rememberReplacements(@NotNull Map<BuildPromotion,BuildPromotion> replacementMap, @NotNull BuildPromotionReplacementLog.ReplacementReason reason)
Description copied from interface:BuildPromotionReplacementLog
Registers a replacement map in the log of replacements- Specified by:
rememberReplacements
in interfaceBuildPromotionReplacementLog
- Parameters:
replacementMap
- a map where key is original build promotion and value is a replacementreason
- reason why replacement happened
-
getReplacementId
@Nullable public Long getReplacementId(long originalPromotionId)
Description copied from interface:BuildPromotionReplacement
For a given promotion id returns id of another promotion which replaced the given one in build queue.- Specified by:
getReplacementId
in interfaceBuildPromotionReplacement
- Parameters:
originalPromotionId
- id of queued build promotion- Returns:
- id of replacement or null if promotion was not replaced or information about replacement is not available anymore
-
getOriginalPromotionIds
@NotNull public Collection<Long> getOriginalPromotionIds(long replacementId)
- Specified by:
getOriginalPromotionIds
in interfaceBuildPromotionReplacement
- Parameters:
replacementId
- id of replacement promotion- Returns:
- collection of original promotion ids replaced by promotion with specified id
-
getStatistics
@NotNull public BuildPromotionReplacement.ReplacementStatistics getStatistics()
- Specified by:
getStatistics
in interfaceBuildPromotionReplacement
- Returns:
- current replacement statistics
-
-