Class TableFlush

java.lang.Object
com.nt.udc.aggregator.AggregatorModule
com.nt.udc.aggregator.table.TableFlush

public class TableFlush extends AggregatorModule
This class handles basic flushing-related functionality. Complicated flushing procedures should go in separate classes that are specifically written for their needs. All and any flushing-related capabilities do not necessarily belong in here.
  • Constructor Details

  • Method Details

    • recordInitFields

      public int[] recordInitFields()
      Returns the fields that should be stored in a newly created record entry. The fields returned are those that this object uses/knows about.
      Specified by:
      recordInitFields in class AggregatorModule
      Returns:
      Array of integers, representing the fields to initialize.
    • shutdown

      public void shutdown()
      Description copied from class: AggregatorModule
      This method should handle shutting down the routines that have been started by this class.
      Specified by:
      shutdown in class AggregatorModule
    • flushRecord

      public void flushRecord(NAR nar)
      Flushes the given record to the next node.
      Parameters:
      nar - NAR to flush to the next node
    • flushRecordAndRemove

      public void flushRecordAndRemove(NAR nar, NARKey key)
      Flushes the given record to the next node, and removes all traces of it from the table. Note that this method exists because of the side effect of using a disk-based table. It is possible to have a different record in memory than on disk, even if the records have the same key. Therefore, if you have a record in memory that you want flushed, but also want it removed from the table (and NOT have that version flushed), use this method. This method is equivalent to: - table.remove(key); - flushRecord(nar);
      Parameters:
      nar - Record to flush to next node
      key - Key of element to remove from table (but NOT flush to next node)
    • flushRecords

      public void flushRecords(NAR[] nars)
      Flushes the given set of records to the next node.
      Parameters:
      nars - NARs to flush to the next node
    • flushTableRecord

      public void flushTableRecord(NARKey key)
      Flushes the given record to the next node, after removing it from the table. If the record doesn't exist in the table, nothing happens.
      Parameters:
      key - key of the NAR in the table
    • flushTableRecords

      public void flushTableRecords(NARKey[] keys)
      Flushes the set of records to the next node, after removing it from the table. If the record doesn't exist in the table, nothing happens.
      Parameters:
      keys - keys of the NARs in the table
    • initialFlush

      public void initialFlush()
      Flushes the table based on whether the "FlushOnStartup" configuration setting is set to true.
    • completeFlush

      public void completeFlush()
      Flushes the complete table.
    • getConfigData

      protected void getConfigData()
      Description copied from class: AggregatorModule
      This method should obtain the necessary information from the config class, in order to configure the module.
      Specified by:
      getConfigData in class AggregatorModule