use of com.codecademy.eventhub.list.DummyIdList in project EventHub by Codecademy.
the class EventHub method getUserIdsSets.
private List<Set<Integer>> getUserIdsSets(String groupByEventType, DateTime startDate, Filter eventFilter, int numDaysPerCohort, int numCohorts) {
List<Set<Integer>> rows = Lists.newArrayListWithCapacity(numCohorts);
for (int i = 0; i < numCohorts; i++) {
DateTime currentStartDate = startDate.plusDays(i * numDaysPerCohort);
DateTime currentEndDate = startDate.plusDays((i + 1) * numDaysPerCohort);
List<Integer> userIdsList = Lists.newArrayList();
Set<Integer> userIdsSet = Sets.newHashSet();
EventIndex.Callback aggregateUserIdsCallback = new AggregateUserIds(eventStorage, userStorage, new DummyIdList(), eventFilter, TrueFilter.INSTANCE, userIdsList, userIdsSet);
shardedEventIndex.enumerateEventIds(groupByEventType, currentStartDate.toString(DATE_TIME_FORMATTER), currentEndDate.toString(DATE_TIME_FORMATTER), aggregateUserIdsCallback);
rows.add(userIdsSet);
}
return rows;
}
Aggregations