Class CreateWindowStrategy
java.lang.Object
com.northconcepts.datapipeline.group.CreateWindowStrategy
Determines when
GroupByReader opens a new sliding window.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CreateWindowStrategyand(CreateWindowStrategy... strategies) Opens a new window if all of the supplied strategies request it.booleanstatic CreateWindowStrategylimitOpened(int maxOpenedWindows) Opens a new window if there are less currently open than the specified number.static CreateWindowStrategyor(CreateWindowStrategy... strategies) Opens a new window if any of the supplied strategies request it.static CreateWindowStrategyrecordPeriod(int recordPeriod) Opens a new window at set record count intervals or on the first record.abstract booleanshouldCreate(GroupByReader groupByReader, Record record) Returns true if a new window should be opened beforerecordis added (null when polling); called repeatedly until it returns false.static CreateWindowStrategystartInterval(long intervalMilliseconds) Opens a new window at set time intervals.
-
Constructor Details
-
CreateWindowStrategy
public CreateWindowStrategy()
-
-
Method Details
-
shouldCreate
Returns true if a new window should be opened beforerecordis added (null when polling); called repeatedly until it returns false. -
isPollingRequired
public boolean isPollingRequired() -
limitOpened
Opens a new window if there are less currently open than the specified number.- Parameters:
maxOpenedWindows- the number of widows that should be open at any time.
-
recordPeriod
Opens a new window at set record count intervals or on the first record.- Parameters:
recordPeriod- the number of records to wait for before opening a new window.
-
startInterval
Opens a new window at set time intervals.- Parameters:
intervalMilliseconds- the number of milliseconds wait before opening a new window.
-
or
Opens a new window if any of the supplied strategies request it. -
and
Opens a new window if all of the supplied strategies request it.
-