public abstract class CloseWindowStrategy extends Object
GroupByReader
closes an open sliding window.Modifier and Type | Field and Description |
---|---|
static long |
CLOSE_WINDOW_MARGIN_MILLIS |
Constructor and Description |
---|
CloseWindowStrategy() |
Modifier and Type | Method and Description |
---|---|
static CloseWindowStrategy |
and(CloseWindowStrategy... strategies)
Closes windows if all of the supplied strategies request it.
|
static CloseWindowStrategy |
hourlyScheduleInMinutes(int... minutesPastHour)
Closes windows at fixed minutes past each hour (for example: 0, 15, 30, and 45 minutes past each hour).
|
static CloseWindowStrategy |
hourlyScheduleInMinutes(String fieldName,
int... minutesPastHour)
Closes windows at fixed minutes past each hour for the specified datetime field (for example: 0, 15, 30, and 45 minutes past each hour).
|
boolean |
isCloseBeforeAddingRecord()
Returns
true if the window should be closed before adding the record or false if (the default). |
boolean |
isPollingRequired()
Indicates if the {@link #shouldClose(Window, GroupByReader, Record) method should be called every second for
open windows -- even if no new data is present -- to release any data that may have been collected (passing in a
null record). |
static CloseWindowStrategy |
limitedRecords(long count)
Closes the window after the specified amount of records has been collected.
|
static CloseWindowStrategy |
limitedTime(long milliseconds)
Closes windows after they've been open for the specified time.
|
static CloseWindowStrategy |
limitedTime(String fieldName,
long milliseconds)
Closes windows after the specified datetime field has increased by a set amount of time since it was first seen.
|
static CloseWindowStrategy |
never()
Never closes open windows.
|
static CloseWindowStrategy |
or(CloseWindowStrategy... strategies)
Closes windows if any of the supplied strategies request it.
|
static CloseWindowStrategy |
scheduled(Scheduler scheduler)
Closes windows on a set clock schedule.
|
static CloseWindowStrategy |
scheduled(String fieldName,
Scheduler scheduler)
Closes windows on a set clock schedule for the specified datetime field.
|
abstract boolean |
shouldClose(Window window,
GroupByReader groupByReader,
Record record) |
public static final long CLOSE_WINDOW_MARGIN_MILLIS
public abstract boolean shouldClose(Window window, GroupByReader groupByReader, Record record)
public boolean isPollingRequired()
null
record).public boolean isCloseBeforeAddingRecord()
true
if the window should be closed before adding the record or false
if (the default).public static CloseWindowStrategy never()
public static CloseWindowStrategy limitedTime(long milliseconds)
public static CloseWindowStrategy limitedTime(String fieldName, long milliseconds)
fieldName
- the datetime field to testmilliseconds
- the amount of time the field should increase before closing the windowpublic static CloseWindowStrategy limitedRecords(long count)
public static CloseWindowStrategy scheduled(Scheduler scheduler)
PeriodicScheduler
,
HourlyScheduler
public static CloseWindowStrategy scheduled(String fieldName, Scheduler scheduler)
fieldName
- the datetime field to testscheduler
- the scheduler to usePeriodicScheduler
,
HourlyScheduler
public static CloseWindowStrategy hourlyScheduleInMinutes(int... minutesPastHour)
public static CloseWindowStrategy hourlyScheduleInMinutes(String fieldName, int... minutesPastHour)
fieldName
- the datetime field to testminutesPastHour
- public static CloseWindowStrategy or(CloseWindowStrategy... strategies)
public static CloseWindowStrategy and(CloseWindowStrategy... strategies)
Copyright (c) 2006-2024 North Concepts Inc. All Rights Reserved.