Package com.nt.udc.util.table
Class TimerFlush
java.lang.Object
com.nt.udc.util.table.TimerFlush
- All Implemented Interfaces:
ActionListener
,EventListener
This class handles all timer related flushing functionality.
Currently, this timer flushing class supports the following:
- starting/stopping the timer
- adding new elements to be flushed by the timer
- updating elements' flush time
- removing elements that would be flushed by the timer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method is called when the flush timer expires.void
Adds a record to the flush timer's list of records to flush.void
addRecords
(Object[] objects) Adds a list of records to the flush list.protected void
boolean
Added for Node Health support.void
resetFlushTimer
(Object key) Reset the flush timer for a given entry in the table, as determined by the "FlushTimerSet" configuration setting.void
shutdown()
Shuts down the flushing capabilities, including the flush timer.void
Starts the flush timer thread.
-
Constructor Details
-
TimerFlush
-
-
Method Details
-
startFlushTimer
public void startFlushTimer()Starts the flush timer thread. -
actionPerformed
This method is called when the flush timer expires. This method will remove all of the expired records and write them out.- Specified by:
actionPerformed
in interfaceActionListener
-
shutdown
public void shutdown()Shuts down the flushing capabilities, including the flush timer. -
addRecords
Adds a list of records to the flush list.- Parameters:
objects
- Array of objects to manage.
-
resetFlushTimer
Reset the flush timer for a given entry in the table, as determined by the "FlushTimerSet" configuration setting. -
addRecord
Adds a record to the flush timer's list of records to flush. The flush time of the given record is based off: flush time = current time + flush interval- Parameters:
key
- Key of the record to be flushed at a later time.
-
isHealthy
public boolean isHealthy()Added for Node Health support. Only checks the internal timer to see if it is healthy. -
getConfigData
protected void getConfigData()
-