Class TimeGrouper

java.lang.Object
com.nt.udc.aggregator.AggregatorModule
com.nt.udc.aggregator.util.TimeGrouper

public class TimeGrouper extends AggregatorModule
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.
  • Constructor Details

    • TimeGrouper

      public TimeGrouper(ConfigIfc config, LoggerIfc logger)
      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 class AggregatorModule
    • recordInitFields

      public int[] recordInitFields()
      Returns those fields needed by a newly created record
      Specified by:
      recordInitFields in class AggregatorModule
      Returns:
      field ids to include in the new record
    • shutdown

      public void shutdown()
      Performs shutdown-related procedures
      Specified by:
      shutdown in class AggregatorModule
    • setMinutesPerGroup

      public void setMinutesPerGroup(int m)
      Sets the minutes per time group to the given setting.
      Parameters:
      m - new minutes-per-group setting
    • groupRecord

      public boolean groupRecord(NAR nar)
      Groups the given NAR's time field.
      Parameters:
      nar - NAR to group
      Returns:
      true, if grouping was successful
    • groupRecord

      public boolean groupRecord(NAR nar, int ID)
      Groups the given NAR's time field.
      Parameters:
      nar - NAR to group
      ID - time field ID to group
      Returns:
      true, if grouping was successful