public LongSet apply(@Nullable Recommender input) {
if (input == null) {
return LongSets.EMPTY_SET;
}
LenskitRecommender rec = (LenskitRecommender) input;
ItemEventDAO idao = rec.get(ItemEventDAO.class);
ScoredItemAccumulator accum = new TopNScoredItemAccumulator(count);
Cursor<ItemEventCollection<Event>> items = idao.streamEventsByItem();
try {
for (ItemEventCollection<Event> item: items) {
accum.put(item.getItemId(), item.size());
}
} finally {