Class WriterRunnable
java.lang.Object
org.epics.archiverappliance.engine.writer.WriterRunnable
- All Implemented Interfaces:
Runnable
WriterRunnable is scheduled by the executor in the engine context every writing period.
- Author:
- Luofeng Li
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChannel(ArchiveChannel channel) Add a channel's buffer that this thread readsvoidflush out the sample buffer to the short term storage before shutting down the enginevoidremoveChannel(String channelName) remove one sample buffer from the buffer hash map.voidrun()doublesetWritingPeriod(double write_period) set the writing period.
-
Constructor Details
-
WriterRunnable
the constructor- Parameters:
configservice- the configservice used by this WriterRunnable
-
-
Method Details
-
addChannel
Add a channel's buffer that this thread reads- Parameters:
channel- ArchiveChannel
-
removeChannel
remove one sample buffer from the buffer hash map. At the same time. it also removes the channel from the channel hash map in the engine context- Parameters:
channelName- the name of the channel who and whose sample buffer are removed
-
setWritingPeriod
public double setWritingPeriod(double write_period) set the writing period. when the writing period is at least 10 seonds. When write_period < 10 , the writing period is 10 seconds actually.- Parameters:
write_period- the writing period in second- Returns:
- the actual writing period in second
-
run
public void run() -
flushBuffer
flush out the sample buffer to the short term storage before shutting down the engine- Throws:
Exception- error occurs during writing the sample buffer to the short term storage
-