Built-in Window Strategies

The following built-in strategies are used by GroupByReader to determine when it should open a new window.

Create Window Strategy Description
CreateWindowStrategy.limitOpened(int) Opens a new window if there are less currently open than the specified number.
CreateWindowStrategy.recordPeriod(int) Opens a new window at set record count intervals or on the first record.
CreateWindowStrategy.startInterval(long) Opens a new window at set time intervals.
CreateWindowStrategy.or(CreateWindowStrategy...) Opens a new window if any of the supplied strategies request it.
CreateWindowStrategy.and(CreateWindowStrategy...) Opens a new window if all of the supplied strategies request it.

The following built-in strategies are used by GroupByReader to determine when it should close open window.

Close Window Strategy Description
CloseWindowStrategy.never() Never closes open windows.
CloseWindowStrategy.limitedTime(long) Closes windows after they've been open for the specified time.
CloseWindowStrategy.limitedTime(String, long) Closes windows after the specified datetime field has increased by a set amount of time since it was first seen. This is useful for aggregating hourly logs by their timestamp field.
CloseWindowStrate@gy.limitedRecords(long) Closes the window after the specified amount of records has been collected.
CloseWindowStrategy.scheduled(Scheduler) Closes windows on a set clock schedule. For example, every 30 minutes on the hour and half hour.
CloseWindowStrategy.scheduled(String, Scheduler) Closes windows on a set clock schedule for the specified datetime field. For example, every 30 minutes at 15 and 45 past the hour. This is useful for aggregating hourly logs at set times by their timestamp field.
CloseWindowStrategy.hourlyScheduleInMinutes(int...) Closes windows at fixed minutes past each hour (for example: 0, 15, 30, and 45 minutes past each hour).
CloseWindowStrategy.hourlyScheduleInMinutes(String, int...) Closes windows at fixed minutes past each hour for the specified datetime field (for example: 0, 15, 30, and 45 minutes past each hour).
CloseWindowStrategy.or(CloseWindowStrategy...) Closes windows if any of the supplied strategies request it.
CloseWindowStrategy.and(CloseWindowStrategy...) Closes windows if all of the supplied strategies request it.
Mobile Analytics