@Override public InteractionStatistics get() { Long2IntOpenHashMap counts = new Long2IntOpenHashMap(); try (ObjectStream<Entity> stream = dao.query(entityType).stream()) { for (Entity e : stream) { long item = e.getLong(CommonAttributes.ITEM_ID); counts.addTo(item, 1); } } return new InteractionStatistics(entityType, counts); } }
@Override public InteractionStatistics get() { Long2IntOpenHashMap counts = new Long2IntOpenHashMap(); try (ObjectStream<Entity> stream = dao.query(entityType).stream()) { for (Entity e : stream) { long item = e.getLong(CommonAttributes.ITEM_ID); counts.addTo(item, e.getInteger(CommonAttributes.COUNT)); } } return new InteractionStatistics(entityType, counts); } }
@Override public InteractionStatistics get() { Long2IntOpenHashMap counts = new Long2IntOpenHashMap(); try (ObjectStream<Entity> stream = dao.query(entityType).stream()) { for (Entity e : stream) { long item = e.getLong(CommonAttributes.ITEM_ID); counts.addTo(item, 1); } } return new InteractionStatistics(entityType, counts); } }
@Override public InteractionStatistics get() { Long2IntOpenHashMap counts = new Long2IntOpenHashMap(); try (ObjectStream<Entity> stream = dao.query(entityType).stream()) { for (Entity e : stream) { long item = e.getLong(CommonAttributes.ITEM_ID); counts.addTo(item, e.getInteger(CommonAttributes.COUNT)); } } return new InteractionStatistics(entityType, counts); } }