Class FlexibleTableFlush

java.lang.Object
com.nt.udc.flexibleAggregator.table.FlexibleTableFlush

public class FlexibleTableFlush extends Object
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

    • shutdown

      public void shutdown()
    • 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, FlexibleNARKey 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(FlexibleNARKey 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
    • removeTableRecord

      public void removeTableRecord(FlexibleNARKey key)
      Flushed out the record by removing it. Nothing gets written to the output in this case.
    • flushTableRecords

      public void flushTableRecords(FlexibleNARKey[] 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.