@Override public synchronized CategoryGraph getGraph(Language language) throws DaoException { if (graphs.containsKey(language)) { return graphs.get(language); } String key = "cat-graph-" + language.getLangCode(); if (cache != null) { CategoryGraph graph = (CategoryGraph) cache.get(key, LocalPage.class, LocalCategoryMember.class); if (graph != null) { graphs.put(language, graph); return graph; } } LocalCategoryGraphBuilder builder = new LocalCategoryGraphBuilder(localPageDao, this); CategoryGraph graph = builder.build(language); cache.put(key, graph); graphs.put(language, graph); return graph; }
cache.put(LOADED_CACHE_KEY, loaded);
cache.put(LOADED_CACHE_KEY, loaded);
cache.put(LOADED_CACHE_KEY, loaded); return loaded; } finally {
cache.put(LOADED_CACHE_KEY, loaded); return loaded; } finally {
cache.put("wikidata-properties", properties);
cache.put("wikidata-properties", properties);
@Override public void endLoad() throws DaoException { if (labelLoader != null) labelLoader.endLoad(); if (descLoader != null) descLoader.endLoad(); if (aliasLoader != null) aliasLoader.endLoad(); labelLoader = null; descLoader = null; aliasLoader = null; super.endLoad(); if (cache != null) { cache.put("wikidata-properties", properties); } wpDs.optimize(WIKIDATA_ENTITY_LABELS); wpDs.optimize(WIKIDATA_ENTITY_ALIASES); wpDs.optimize(WIKIDATA_ENTITY_DESCRIPTIONS); wpDs.optimize(WIKIDATA_STATEMENT); }
@Override public void endLoad() throws DaoException { if (labelLoader != null) labelLoader.endLoad(); if (descLoader != null) descLoader.endLoad(); if (aliasLoader != null) aliasLoader.endLoad(); labelLoader = null; descLoader = null; aliasLoader = null; super.endLoad(); if (cache != null) { cache.put("wikidata-properties", properties); } wpDs.optimize(WIKIDATA_ENTITY_LABELS); wpDs.optimize(WIKIDATA_ENTITY_ALIASES); wpDs.optimize(WIKIDATA_ENTITY_DESCRIPTIONS); wpDs.optimize(WIKIDATA_STATEMENT); }
LOG.info("resolved " + numResolved + " of " + numRedirects + " redirects."); if (cache!=null){ cache.put(key, map);