pool = MergePool.create();
@Override protected DAGNode<Component, Dependency> buildRecommenderGraph(DataAccessObject dao) { DAGNode<Component, Dependency> graph = super.buildRecommenderGraph(dao); if (mergePool != null) { logger.debug("deduplicating configuration graph"); synchronized (mergePool) { graph = mergePool.merge(graph); } } return graph; }
/** * Create a merge pool that checks node labels for equality. * * @param <V> The node label type. * @param <E> The edge label type. * @return A new merge pool. */ public static <V,E> MergePool<V,E> create() { return new MergePool<V, E>(); }
logger.debug("deduplicating configuration graph"); synchronized (mergePool) { cfgGraph = mergePool.merge(cfgGraph);
/** * Create a DependencySolver that uses the given functions, and max * depth of the dependency graph. * * @param bindFunctions The binding functions that control desire bindings * @param maxDepth A maximum depth of the graph before it's determined that * a cycle exists * @throws IllegalArgumentException if maxDepth is less than 1 * @throws NullPointerException if bindFunctions is null */ DependencySolver(List<BindingFunction> bindFunctions, List<BindingFunction> triggers, CachePolicy defaultPolicy, int maxDepth) { Preconditions.notNull("bindFunctions", bindFunctions); Preconditions.notNull("defaultPolicy", defaultPolicy); if (maxDepth <= 0) { throw new IllegalArgumentException("Max depth must be at least 1"); } this.functions = new ArrayList<BindingFunction>(bindFunctions); this.triggerFunctions = new ArrayList<BindingFunction>(triggers); this.maxDepth = maxDepth; this.defaultPolicy = defaultPolicy; graph = DAGNode.singleton(ROOT_SATISFACTION); backEdges = HashMultimap.create(); mergePool = MergePool.create(); logger.info("DependencySolver created, max depth: {}", maxDepth); }
MergePool<Component,Dependency> pool = null; if (cache != null) { pool = MergePool.create();