Class GraphOptimizer
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.dependency.GraphOptimizer
-
public class GraphOptimizer extends Object
Performs build chain optimization: substitutes not yet started build nodes in the build chain graph with an equivalent running or finished build.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
GraphOptimizer.GraphNode
static class
GraphOptimizer.ReplacementBuildsType
-
Field Summary
Fields Modifier and Type Field Description static String
BUILD_CHAINS_OPTIMIZATION_IGNORE_OPTIONAL_ARTIFACT_DEPS
-
Constructor Summary
Constructors Constructor Description GraphOptimizer(Collection<BuildPromotionEx> rootNodes, BuildPromotionReplacementLog promotionReplacementLog, Function<Collection<Long>,Collection<SBuild>> startedBuildsSupplier, Function<String,List<BuildPromotionEx>> notStartedBuildsSupplier, Set<BuildPromotionEx> excludedFromReplacementCandidates)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dryRunOptimization(OptimizationListener listener)
Performs optimization dry-run: computes build promotions which can be replaced but does not perform replacement itself, i.e.boolean
isEquivalentPartOf(BuildPromotionEx otherNode)
Computes graph equivalence for current build promotion and specified one.Collection<BuildPromotionEx>
optimize(OptimizationListener listener, boolean reuseQueuedBuilds)
Performs optimization on the current build chain.
-
-
-
Field Detail
-
BUILD_CHAINS_OPTIMIZATION_IGNORE_OPTIONAL_ARTIFACT_DEPS
public static final String BUILD_CHAINS_OPTIMIZATION_IGNORE_OPTIONAL_ARTIFACT_DEPS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GraphOptimizer
public GraphOptimizer(@NotNull Collection<BuildPromotionEx> rootNodes, @NotNull BuildPromotionReplacementLog promotionReplacementLog, @NotNull Function<Collection<Long>,Collection<SBuild>> startedBuildsSupplier, @NotNull Function<String,List<BuildPromotionEx>> notStartedBuildsSupplier, @NotNull Set<BuildPromotionEx> excludedFromReplacementCandidates)
-
-
Method Detail
-
isEquivalentPartOf
public boolean isEquivalentPartOf(@NotNull BuildPromotionEx otherNode)
Computes graph equivalence for current build promotion and specified one.- Parameters:
otherNode
- other build promotion- Returns:
- true if graph of the current build promotion is fully equivalent to graph of specified build promotion, in other words equivalence check is passed for all common nodes of these two graphs.
-
optimize
@NotNull public Collection<BuildPromotionEx> optimize(@Nullable OptimizationListener listener, boolean reuseQueuedBuilds)
Performs optimization on the current build chain. During the optimization, not yet started build promotions can be replaced with already started ones.- Returns:
- replaced build promotions which now can be safely deleted because there are no links to the from the original build chain
-
dryRunOptimization
public void dryRunOptimization(@NotNull OptimizationListener listener)
Performs optimization dry-run: computes build promotions which can be replaced but does not perform replacement itself, i.e. leaves build chain intact- Parameters:
listener
- listener to listen for optimization events- Since:
- 2017.1
-
-