Class 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.
    • 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
    • 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