Class FlexibleTableFlush
java.lang.Object
com.nt.udc.flexibleAggregator.table.FlexibleTableFlush
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 Summary
ConstructorsConstructorDescriptionFlexibleTableFlush
(LoggerIfc logger, FlexibleAggrTable table, DCStreamHandler streamHandler, String nodeID, int nodeType, boolean performInitialFlush, boolean performWriteOnFlush) FlexibleTableFlush
(LoggerIfc logger, FlexibleAggrTable table, DCStreamHandler streamHandler, String nodeID, int nodeType, boolean performInitialFlush, boolean performWriteOnFlush, File file) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Flushes the complete table.void
flushRecord
(NAR nar) Flushes the given record to the next node.void
flushRecordAndRemove
(NAR nar, FlexibleNARKey key) Flushes the given record to the next node, and removes all traces of it from the table.void
flushRecords
(NAR[] nars) Flushes the given set of records to the next node.void
Flushes the given record to the next node, after removing it from the table.void
flushTableRecords
(FlexibleNARKey[] keys) Flushes the set of records to the next node, after removing it from the table.void
Flushes the table based on whether the "FlushOnStartup" configuration setting is set to true.void
Flushed out the record by removing it.void
shutdown()
-
Constructor Details
-
FlexibleTableFlush
public FlexibleTableFlush(LoggerIfc logger, FlexibleAggrTable table, DCStreamHandler streamHandler, String nodeID, int nodeType, boolean performInitialFlush, boolean performWriteOnFlush, File file) -
FlexibleTableFlush
public FlexibleTableFlush(LoggerIfc logger, FlexibleAggrTable table, DCStreamHandler streamHandler, String nodeID, int nodeType, boolean performInitialFlush, boolean performWriteOnFlush)
-
-
Method Details
-
shutdown
public void shutdown() -
flushRecord
Flushes the given record to the next node.- Parameters:
nar
- NAR to flush to the next node
-
flushRecordAndRemove
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 nodekey
- Key of element to remove from table (but NOT flush to next node)
-
flushRecords
Flushes the given set of records to the next node.- Parameters:
nars
- NARs to flush to the next node
-
flushTableRecord
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
Flushed out the record by removing it. Nothing gets written to the output in this case. -
flushTableRecords
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.
-