Package com.nt.udc.aggregator.util
Class TimeGrouper
java.lang.Object
com.nt.udc.aggregator.AggregatorModule
com.nt.udc.aggregator.util.TimeGrouper
This class is responsible for grouping time fields in a record.
Essentially, this means that a configured time field is
rounded to a configured time period.
For example, if the time period is 30 minutes, then the configured
time field will be rounded to the nearest 30 minute interval.
This allows for better time-based aggregation.
-
Field Summary
Fields inherited from class com.nt.udc.aggregator.AggregatorModule
config, logger
-
Constructor Summary
ConstructorsConstructorDescriptionTimeGrouper
(ConfigIfc config, LoggerIfc logger) Creates the object with the node configuration and logger objects -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Retrieves time grouper related configuration settingsboolean
groupRecord
(NAR nar) Groups the given NAR's time field.boolean
groupRecord
(NAR nar, int ID) Groups the given NAR's time field.int[]
Returns those fields needed by a newly created recordvoid
setMinutesPerGroup
(int m) Sets the minutes per time group to the given setting.void
shutdown()
Performs shutdown-related procedures
-
Constructor Details
-
TimeGrouper
Creates the object with the node configuration and logger objects
-
-
Method Details
-
getConfigData
protected void getConfigData()Retrieves time grouper related configuration settings- Specified by:
getConfigData
in classAggregatorModule
-
recordInitFields
public int[] recordInitFields()Returns those fields needed by a newly created record- Specified by:
recordInitFields
in classAggregatorModule
- Returns:
- field ids to include in the new record
-
shutdown
public void shutdown()Performs shutdown-related procedures- Specified by:
shutdown
in classAggregatorModule
-
setMinutesPerGroup
public void setMinutesPerGroup(int m) Sets the minutes per time group to the given setting.- Parameters:
m
- new minutes-per-group setting
-
groupRecord
Groups the given NAR's time field.- Parameters:
nar
- NAR to group- Returns:
- true, if grouping was successful
-
groupRecord
Groups the given NAR's time field.- Parameters:
nar
- NAR to groupID
- time field ID to group- Returns:
- true, if grouping was successful
-