private void loadCategories(CategoryGraph graph) throws DaoException { LOG.info("loading categories..."); graph.catIndexes = new TIntIntHashMap(); List<String> catList = new ArrayList<String>(); Iterable<LocalPage> catIter = pageDao.get(new DaoFilter().setNameSpaces(NameSpace.CATEGORY).setLanguages(graph.language)); TIntList catIds = new TIntArrayList(); for (LocalPage cat : catIter) { if (cat != null) { if (graph.catIndexes.containsKey(cat.getLocalId())) { continue; } assert (catList.size() == graph.catIndexes.size()); assert (catIds.size() == graph.catIndexes.size()); int ci = graph.catIndexes.size(); graph.catIndexes.put(cat.getLocalId(), ci); catList.add(cat.getTitle().getCanonicalTitle()); catIds.add(cat.getLocalId()); } } graph.cats = catList.toArray(new String[0]); graph.catIds = catIds.toArray(); LOG.info("finished loading " + graph.cats.length + " categories"); }