@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; }
/** * Build the recommender directly, skipping an engine. This does not separate the recommender from * the DAO, it just directly builds it. * * @param dao The data access object to use. Can be `null` to build without a DAO, but this is only useful in * special cases. * @return The built recommender engine, with {@linkplain ModelDisposition#EXCLUDED excluded} * components removed. * @throws RecommenderBuildException if there is an error building the engine. */ public LenskitRecommender buildRecommender(DataAccessObject dao) throws RecommenderBuildException { DAGNode<Component, Dependency> graph = buildRecommenderGraph(dao); graph = instantiateGraph(graph); return new LenskitRecommender(graph); }
/** * Build the recommender engine. * * @param dao The data access object to use. Can be `null` to build without a DAO, but this is only useful in * special cases. * @return The built recommender engine, with {@linkplain ModelDisposition#EXCLUDED excluded} * components removed. * @throws RecommenderBuildException if there is an error building the engine. */ public LenskitRecommenderEngine build(DataAccessObject dao) throws RecommenderBuildException { DAGNode<Component, Dependency> graph = buildRecommenderGraph(dao); graph = instantiateGraph(graph); graph = rewriteExcludedComponents(graph, dao); boolean instantiable = GraphtUtils.getPlaceholderNodes(graph).isEmpty(); return new LenskitRecommenderEngine(graph, instantiable); }
/** * Build the recommender directly, skipping an engine. This does not separate the recommender from * the DAO, it just directly builds it. * * @param dao The data access object to use. Can be `null` to build without a DAO, but this is only useful in * special cases. * @return The built recommender engine, with {@linkplain ModelDisposition#EXCLUDED excluded} * components removed. * @throws RecommenderBuildException if there is an error building the engine. */ public LenskitRecommender buildRecommender(DataAccessObject dao) throws RecommenderBuildException { DAGNode<Component, Dependency> graph = buildRecommenderGraph(dao); graph = instantiateGraph(graph); return new LenskitRecommender(graph); }
/** * Build the recommender engine. * * @param dao The data access object to use. Can be `null` to build without a DAO, but this is only useful in * special cases. * @return The built recommender engine, with {@linkplain ModelDisposition#EXCLUDED excluded} * components removed. * @throws RecommenderBuildException if there is an error building the engine. */ public LenskitRecommenderEngine build(DataAccessObject dao) throws RecommenderBuildException { DAGNode<Component, Dependency> graph = buildRecommenderGraph(dao); graph = instantiateGraph(graph); graph = rewriteExcludedComponents(graph, dao); boolean instantiable = GraphtUtils.getPlaceholderNodes(graph).isEmpty(); return new LenskitRecommenderEngine(graph, instantiable); }