Package com.nt.udc.ndk.util
Class OIFileWriter
java.lang.Object
com.nt.udc.ndk.util.OIFileWriter
- All Implemented Interfaces:
StateBufferSaveable
- Direct Known Subclasses:
NARXMLOIFileWriter
This class is intended to be used as a 'plug-in' module for OI Transports
to handle file output and the rotation of those files. The files will be
cycled based upon the configured time parameters and/or the maximum records
per file parameter of the OI node.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FileWriterprotected StateManagementIfcstatic final StringName (key) for the maximum records per file configuration item.static final intDefault value for the maximum records per file configuration item.static final intMaximum allowable value for the maximum records per file configuration item.static final intMinimum allowable value for the maximum records per file configuration item. -
Constructor Summary
ConstructorsConstructorDescriptionOIFileWriter(LoggerIfc lgr, String filedir, String filename, String currext, String doneext, String timeper) Construct a newOIFileWriterto be used within anOITransportobject.OIFileWriter(LoggerIfc lgr, String filedir, String filename, String currext, String doneext, String timeper, boolean strData) Construct a newOIFileWriterto be used within anOITransportobject.OIFileWriter(LoggerIfc lgr, String filedir, String filename, String currext, String doneext, String timeper, boolean strData, StateManagementIfc stateMgr) Construct a newOIFileWriterto be used within anOITransportobject.OIFileWriter(LoggerIfc lgr, String filedir, String filename, String currext, String doneext, String timeper, boolean strData, StateManagementIfc stateMgr, int maxrecs) Construct a newOIFileWriterto be used within anOITransportobject.OIFileWriter(LoggerIfc lgr, String filedir, String filename, String currext, String doneext, String timeper, boolean strData, StateManagementIfc stateMgr, int maxrecs, boolean isMtCheck, int tId, boolean isOrderingCheck) Construct a newOIFileWriterto be used within anOITransportobject.OIFileWriter(LoggerIfc lgr, String filedir, String filename, String currext, String doneext, String timeper, boolean strData, StateManagementIfc stateMgr, int maxrecs, boolean isMtCheck, int tId, boolean isOrderingCheck, String nodeid) Construct a newOIFileWriterto be used within anOITransportobject.OIFileWriter(LoggerIfc lgr, String filedir, String filename, String currext, String doneext, String timeper, boolean strData, StateManagementIfc stateMgr, int maxrecs, FileRetentionThread fRThread) Construct a newOIFileWriterto be used within anOITransportobject.OIFileWriter(LoggerIfc lgr, String filedir, String filename, String currext, String doneext, String timeper, boolean strData, StateManagementIfc stateMgr, int maxrecs, FileRetentionThread fRThread, boolean isMtCheck, int tId, boolean isOrderingCheck) Construct a newOIFileWriterto be used within anOITransportobject.OIFileWriter(LoggerIfc lgr, String filedir, String filename, String currext, String doneext, String timeper, boolean strData, StateManagementIfc stateMgr, int maxrecs, FileRetentionThread fRThread, boolean isMtCheck, int tId, boolean isOrderingCheck, String nodeid) Construct a newOIFileWriterto be used within anOITransportobject.OIFileWriter(LoggerIfc lgr, String filedir, String filename, String currext, String doneext, String timeper, boolean strData, StateManagementIfc stateMgr, int maxrecs, FileRetentionThread fRThread, String nodeid) Construct a newOIFileWriterto be used within anOITransportobject.OIFileWriter(LoggerIfc lgr, String filedir, String filename, String currext, String doneext, String timeper, boolean strData, StateManagementIfc stateMgr, int maxrecs, String nodeid) Construct a newOIFileWriterto be used within anOITransportobject.OIFileWriter(LoggerIfc lgr, String filedir, String filename, String currext, String doneext, String timeper, boolean strData, StateManagementIfc stateMgr, FileRetentionThread fRThread) Construct a newOIFileWriterto be used within anOITransportobject. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the output file.Cycle the output files, as configured by the node.voidflush()Flush the contents of the output stream buffer to the file.Return the extension used for the active file.intReturn the size of the OutputStream's buffer.Return the extension used for completed files.longReturn the cycle time period.booleanReturns the name of the currently opened file.Return the file name prefix.protected LoggerIfcintReturns the maximum number of records per file.protected Stringprotected longprotected Fileprotected FileReturn the location of the local output directory.longintprotected Stringprotected intvoidIncrements the record counter.booleanThis function is used to check if the writer is functionalbooleanisOpen()Indicates whether a file is opened for output.voidRename all active file to rCycle filesbooleanopen()Open the output file, creating it if necessary.booleanDetermine if we're ready to cycle the files.booleanprotected StringrenameActiveFile(String actvName) voidvoidrestoreState(StateBuffer buffer) This function is used to restore the writer's state based on information read from a StateBuffer.voidsaveState(StateBuffer buffer) This function is used to store state (recovery) information into a buffer managed by the caller.voidvoidsetActiveExtension(String ext) Sets the active file extension.voidsetBufferSize(int bufsize) Sets the size of the buffer within the OutputStream.voidSets the completed file extension.voidsetCycleTime(String period) Sets the cycle time period.voidsetFileLevelTransactionConfig(boolean fileLevelTransaction) voidsetFilePrefix(String prefix) Sets the file name prefix.voidsetMaxRecsPerFile(int maxRecsPerFile) Sets the maximum number of records per file.voidsetMultiThreadConfiguration(boolean mtChecked, boolean mtOrderChecked) Sets multi threaded valuesprotected voidsetNextCycle(long nextCycle) protected longprotected voidsetOpened(boolean opened) voidsetOriginalFileName(String filename) protected voidsetOutFile(File outFile) voidsetOutputDirectory(String dir) Sets the location of the local output directory.voidIndicate that the files should be cycled.voidshutdown()Shutdown the 'cycle check' threadvoidwrite(byte[] bytes) Write the given bytes to the active file.voidvoidWrite the given string to the active file.
-
Field Details
-
MAXRECSPERFILE
Name (key) for the maximum records per file configuration item.- See Also:
-
MAXRECSPERFILE_MIN
public static final int MAXRECSPERFILE_MINMinimum allowable value for the maximum records per file configuration item.- See Also:
-
MAXRECSPERFILE_MAX
public static final int MAXRECSPERFILE_MAXMaximum allowable value for the maximum records per file configuration item.- See Also:
-
MAXRECSPERFILE_DEFAULT
public static final int MAXRECSPERFILE_DEFAULTDefault value for the maximum records per file configuration item.- See Also:
-
fileWriter
-
m_stateManagementIfc
-
-
Constructor Details
-
OIFileWriter
public OIFileWriter(LoggerIfc lgr, String filedir, String filename, String currext, String doneext, String timeper) throws NodeStartException Construct a newOIFileWriterto be used within anOITransportobject. Files will be created based upon the provided configuration parameters. Additionally, a simple Thread() is started to periodically check the time period to determine if the output file is ready to be cycled. When the OITransport() is being shutdown, the shutdown() method of this file writer should be called to stop this thread.- Parameters:
lgr- Reference to the log methods of the nodefiledir- Name of the output directory in which to write filesfilename- File name prefix, to be combined with a timestamp to create a unique file namecurrext- File name extension which indicates the active filedoneext- File name extension which indicates files that have been completedtimeper- Period of time a file remains active until it is cycled out- Throws:
NodeStartException
-
OIFileWriter
public OIFileWriter(LoggerIfc lgr, String filedir, String filename, String currext, String doneext, String timeper, boolean strData) throws NodeStartException Construct a newOIFileWriterto be used within anOITransportobject. Files will be created based upon the provided configuration parameters. The writer can be configured to write the incoming data as Strings or as an array of bytes. Additionally, a simple Thread() is started to periodically check the time period to determine if the output file is ready to be cycled. When the OITransport() is being shutdown, the shutdown() method of this file writer should be called to stop this thread.- Parameters:
lgr- Reference to the log methods of the nodefiledir- Name of the output directory in which to write filesfilename- File name prefix, to be combined with a timestamp to create a unique file namecurrext- File name extension which indicates the active filedoneext- File name extension which indicates files that have been completedtimeper- Period of time a file remains active until it is cycled outstrData- A value of true indicates this file writer will write the incoming data to the file as Strings. The default is to write the data as an array of bytes.- Throws:
NodeStartException
-
OIFileWriter
public OIFileWriter(LoggerIfc lgr, String filedir, String filename, String currext, String doneext, String timeper, boolean strData, StateManagementIfc stateMgr) throws NodeStartException Construct a newOIFileWriterto be used within anOITransportobject. Files will be created based upon the provided configuration parameters. The writer can be configured to write the incoming data as Strings or as an array of bytes. Additionally, a simple Thread() is started to periodically check the time period to determine if the output file is ready to be cycled. When the OITransport() is being shutdown, the shutdown() method of this file writer should be called to stop this thread.- Parameters:
lgr- Reference to the log methods of the nodefiledir- Name of the output directory in which to write filesfilename- File name prefix, to be combined with a timestamp to create a unique file namecurrext- File name extension which indicates the active filedoneext- File name extension which indicates files that have been completedtimeper- Period of time a file remains active until it is cycled outstrData- A value of true indicates this file writer will write the incoming data to the file as Strings. The default is to write the data as an array of bytes.stateMgr- An interface used to manage state recovery- Throws:
NodeStartException
-
OIFileWriter
public OIFileWriter(LoggerIfc lgr, String filedir, String filename, String currext, String doneext, String timeper, boolean strData, StateManagementIfc stateMgr, FileRetentionThread fRThread) throws NodeStartException Construct a newOIFileWriterto be used within anOITransportobject. Files will be created based upon the provided configuration parameters. The writer can be configured to write the incoming data as Strings or as an array of bytes. Additionally, a simple Thread() is started to periodically check the time period to determine if the output file is ready to be cycled. When the OITransport() is being shutdown, the shutdown() method of this file writer should be called to stop this thread.- Parameters:
lgr- Reference to the log methods of the nodefiledir- Name of the output directory in which to write filesfilename- File name prefix, to be combined with a timestamp to create a unique file namecurrext- File name extension which indicates the active filedoneext- File name extension which indicates files that have been completedtimeper- Period of time a file remains active until it is cycled outstrData- A value of true indicates this file writer will write the incoming data to the file as Strings. The default is to write the data as an array of bytes.stateMgr- An interface used to manage state recoveryfRThread- FileRetentionThread which is used to delete/archive older files after retention period.- Throws:
NodeStartException
-
OIFileWriter
public OIFileWriter(LoggerIfc lgr, String filedir, String filename, String currext, String doneext, String timeper, boolean strData, StateManagementIfc stateMgr, int maxrecs) throws NodeStartException Construct a newOIFileWriterto be used within anOITransportobject. Files will be created based upon the provided configuration parameters. The writer can be configured to write the incoming data as Strings or as an array of bytes. Additionally, a simple Thread() is started to periodically check the time period to determine if the output file is ready to be cycled. When the OITransport() is being shutdown, the shutdown() method of this file writer should be called to stop this thread.- Parameters:
lgr- Reference to the log methods of the nodefiledir- Name of the output directory in which to write filesfilename- File name prefix, to be combined with a timestamp to create a unique file namecurrext- File name extension which indicates the active filedoneext- File name extension which indicates files that have been completedtimeper- Period of time a file remains active until it is cycled outstrData- A value of true indicates this file writer will write the incoming data to the file as Strings. The default is to write the data as an array of bytes.stateMgr- An interface used to manage state recoverymaxrecs- Maximum number of records per file.- Throws:
NodeStartException
-
OIFileWriter
public OIFileWriter(LoggerIfc lgr, String filedir, String filename, String currext, String doneext, String timeper, boolean strData, StateManagementIfc stateMgr, int maxrecs, String nodeid) throws NodeStartException Construct a newOIFileWriterto be used within anOITransportobject. Files will be created based upon the provided configuration parameters. The writer can be configured to write the incoming data as Strings or as an array of bytes. Additionally, a simple Thread() is started to periodically check the time period to determine if the output file is ready to be cycled. When the OITransport() is being shutdown, the shutdown() method of this file writer should be called to stop this thread.- Parameters:
lgr- Reference to the log methods of the nodefiledir- Name of the output directory in which to write filesfilename- File name prefix, to be combined with a timestamp to create a unique file namecurrext- File name extension which indicates the active filedoneext- File name extension which indicates files that have been completedtimeper- Period of time a file remains active until it is cycled outstrData- A value of true indicates this file writer will write the incoming data to the file as Strings. The default is to write the data as an array of bytes.stateMgr- An interface used to manage state recoverymaxrecs- Maximum number of records per file.nodeId- current node id.- Throws:
NodeStartException
-
OIFileWriter
public OIFileWriter(LoggerIfc lgr, String filedir, String filename, String currext, String doneext, String timeper, boolean strData, StateManagementIfc stateMgr, int maxrecs, boolean isMtCheck, int tId, boolean isOrderingCheck, String nodeid) throws NodeStartException Construct a newOIFileWriterto be used within anOITransportobject. Files will be created based upon the provided configuration parameters. The writer can be configured to write the incoming data as Strings or as an array of bytes. Additionally, a simple Thread() is started to periodically check the time period to determine if the output file is ready to be cycled. When the OITransport() is being shutdown, the shutdown() method of this file writer should be called to stop this thread.- Parameters:
lgr- Reference to the log methods of the nodefiledir- Name of the output directory in which to write filesfilename- File name prefix, to be combined with a timestamp to create a unique file namecurrext- File name extension which indicates the active filedoneext- File name extension which indicates files that have been completedtimeper- Period of time a file remains active until it is cycled outstrData- A value of true indicates this file writer will write the incoming data to the file as Strings. The default is to write the data as an array of bytes.stateMgr- An interface used to manage state recoverymaxrecs- Maximum number of records per file.isMtCheck- Indicates multi threaded OIFileWritertId- Current thread numberisOrderingCheck- Indicates order required or notnodeId- current node id- Throws:
NodeStartException
-
OIFileWriter
public OIFileWriter(LoggerIfc lgr, String filedir, String filename, String currext, String doneext, String timeper, boolean strData, StateManagementIfc stateMgr, int maxrecs, boolean isMtCheck, int tId, boolean isOrderingCheck) throws NodeStartException Construct a newOIFileWriterto be used within anOITransportobject. Files will be created based upon the provided configuration parameters. The writer can be configured to write the incoming data as Strings or as an array of bytes. Additionally, a simple Thread() is started to periodically check the time period to determine if the output file is ready to be cycled. When the OITransport() is being shutdown, the shutdown() method of this file writer should be called to stop this thread.- Parameters:
lgr- Reference to the log methods of the nodefiledir- Name of the output directory in which to write filesfilename- File name prefix, to be combined with a timestamp to create a unique file namecurrext- File name extension which indicates the active filedoneext- File name extension which indicates files that have been completedtimeper- Period of time a file remains active until it is cycled outstrData- A value of true indicates this file writer will write the incoming data to the file as Strings. The default is to write the data as an array of bytes.stateMgr- An interface used to manage state recoverymaxrecs- Maximum number of records per file.isMtCheck- Indicates multi threaded OIFileWritertId- Current thread numberisOrderingCheck- Indicates order required or not- Throws:
NodeStartException
-
OIFileWriter
public OIFileWriter(LoggerIfc lgr, String filedir, String filename, String currext, String doneext, String timeper, boolean strData, StateManagementIfc stateMgr, int maxrecs, FileRetentionThread fRThread) throws NodeStartException Construct a newOIFileWriterto be used within anOITransportobject. Files will be created based upon the provided configuration parameters. The writer can be configured to write the incoming data as Strings or as an array of bytes. Additionally, a simple Thread() is started to periodically check the time period to determine if the output file is ready to be cycled. When the OITransport() is being shutdown, the shutdown() method of this file writer should be called to stop this thread.- Parameters:
lgr- Reference to the log methods of the nodefiledir- Name of the output directory in which to write filesfilename- File name prefix, to be combined with a timestamp to create a unique file namecurrext- File name extension which indicates the active filedoneext- File name extension which indicates files that have been completedtimeper- Period of time a file remains active until it is cycled outstrData- A value of true indicates this file writer will write the incoming data to the file as Strings. The default is to write the data as an array of bytes.stateMgr- An interface used to manage state recoverymaxrecs- Maximum number of records per file.fRThread- FileRetentionThread which is used to delete/archive older files after retention period.- Throws:
NodeStartException
-
OIFileWriter
public OIFileWriter(LoggerIfc lgr, String filedir, String filename, String currext, String doneext, String timeper, boolean strData, StateManagementIfc stateMgr, int maxrecs, FileRetentionThread fRThread, String nodeid) throws NodeStartException Construct a newOIFileWriterto be used within anOITransportobject. Files will be created based upon the provided configuration parameters. The writer can be configured to write the incoming data as Strings or as an array of bytes. Additionally, a simple Thread() is started to periodically check the time period to determine if the output file is ready to be cycled. When the OITransport() is being shutdown, the shutdown() method of this file writer should be called to stop this thread.- Parameters:
lgr- Reference to the log methods of the nodefiledir- Name of the output directory in which to write filesfilename- File name prefix, to be combined with a timestamp to create a unique file namecurrext- File name extension which indicates the active filedoneext- File name extension which indicates files that have been completedtimeper- Period of time a file remains active until it is cycled outstrData- A value of true indicates this file writer will write the incoming data to the file as Strings. The default is to write the data as an array of bytes.stateMgr- An interface used to manage state recoverymaxrecs- Maximum number of records per file.fRThread- FileRetentionThread which is used to delete/archive older files after retention period.nodeId- NodeId from which the function is called.- Throws:
NodeStartException
-
OIFileWriter
public OIFileWriter(LoggerIfc lgr, String filedir, String filename, String currext, String doneext, String timeper, boolean strData, StateManagementIfc stateMgr, int maxrecs, FileRetentionThread fRThread, boolean isMtCheck, int tId, boolean isOrderingCheck, String nodeid) throws NodeStartException Construct a newOIFileWriterto be used within anOITransportobject. Files will be created based upon the provided configuration parameters. The writer can be configured to write the incoming data as Strings or as an array of bytes. Additionally, a simple Thread() is started to periodically check the time period to determine if the output file is ready to be cycled. When the OITransport() is being shutdown, the shutdown() method of this file writer should be called to stop this thread.- Parameters:
lgr- Reference to the log methods of the nodefiledir- Name of the output directory in which to write filesfilename- File name prefix, to be combined with a timestamp to create a unique file namecurrext- File name extension which indicates the active filedoneext- File name extension which indicates files that have been completedtimeper- Period of time a file remains active until it is cycled outstrData- A value of true indicates this file writer will write the incoming data to the file as Strings. The default is to write the data as an array of bytes.stateMgr- An interface used to manage state recoverymaxrecs- Maximum number of records per file.fRThread- FileRetentionThread which is used to delete/archive olderisMtCheck- Multi thread check varibletId- Current thread number files after retention period.isOrderingCheck- Indicates order required or notnodeid- current nodeid- Throws:
NodeStartException
-
OIFileWriter
public OIFileWriter(LoggerIfc lgr, String filedir, String filename, String currext, String doneext, String timeper, boolean strData, StateManagementIfc stateMgr, int maxrecs, FileRetentionThread fRThread, boolean isMtCheck, int tId, boolean isOrderingCheck) throws NodeStartException Construct a newOIFileWriterto be used within anOITransportobject. Files will be created based upon the provided configuration parameters. The writer can be configured to write the incoming data as Strings or as an array of bytes. Additionally, a simple Thread() is started to periodically check the time period to determine if the output file is ready to be cycled. When the OITransport() is being shutdown, the shutdown() method of this file writer should be called to stop this thread.- Parameters:
lgr- Reference to the log methods of the nodefiledir- Name of the output directory in which to write filesfilename- File name prefix, to be combined with a timestamp to create a unique file namecurrext- File name extension which indicates the active filedoneext- File name extension which indicates files that have been completedtimeper- Period of time a file remains active until it is cycled outstrData- A value of true indicates this file writer will write the incoming data to the file as Strings. The default is to write the data as an array of bytes.stateMgr- An interface used to manage state recoverymaxrecs- Maximum number of records per file.fRThread- FileRetentionThread which is used to delete/archive olderisMtCheck- Multi thread check varibletId- Current thread number files after retention period.isOrderingCheck- Indicates order required or not- Throws:
NodeStartException
-
-
Method Details
-
getOutFile
-
setOutFile
-
getOutDir
-
getNextCycle
protected long getNextCycle() -
setNextCycle
protected void setNextCycle(long nextCycle) -
getLogger
-
getSystemTime
-
renameActiveFile
-
getNewFilename
-
setOriginalFileName
-
setNextCycleTime
protected long setNextCycleTime() -
getTimeAmt
protected int getTimeAmt() -
setBufferSize
public void setBufferSize(int bufsize) Sets the size of the buffer within the OutputStream.- Parameters:
bufsize- Size of the OutputStream buffer.
-
getBufferSize
public int getBufferSize()Return the size of the OutputStream's buffer.- Returns:
- Returns the size of the buffer within the OutputStream.
-
setOutputDirectory
Sets the location of the local output directory.- Parameters:
dir- The path to the local output directory.
-
getOutputDirectory
Return the location of the local output directory.- Returns:
- Returns the path to the local output directory.
-
setFilePrefix
Sets the file name prefix.- Parameters:
prefix- The string to be prepended to the file name.
-
getFilePrefix
Return the file name prefix.- Returns:
- Returns the string which is prepended to the file name.
-
setActiveExtension
Sets the active file extension.- Parameters:
ext- The string used for the extension of the active file.
-
getActiveExtension
Return the extension used for the active file.- Returns:
- Returns the string used as the extension of the active file.
-
setCompletedExtension
Sets the completed file extension.- Parameters:
ext- The string used for the extension of completed files.
-
getCompletedExtension
Return the extension used for completed files.- Returns:
- Returns the string used for the extension of completed files.
-
setCycleTime
Sets the cycle time period.- Parameters:
period- The period between cycled files.
-
getCycleTime
Return the cycle time period.- Returns:
- Returns the period between cycled files.
-
setMaxRecsPerFile
public void setMaxRecsPerFile(int maxRecsPerFile) Sets the maximum number of records per file. This value should be in the range fromMAXRECSPERFILE_MINtoMAXRECSPERFILE_MAXinclusive.- Parameters:
maxRecsPerFile- The maximum number of records per file.
-
getMaxRecsPerFile
public int getMaxRecsPerFile()Returns the maximum number of records per file.- Returns:
- Returns the maximum number of records per file.
-
incrementRecordCount
public void incrementRecordCount()Increments the record counter. If the maximum number of records per file has been reached, the state is set such that the file will be cycled. TheOIFileFormatterinitiates the file cycle the next time it checks if this writer is ready to cycle a file. -
getRecordCount
public int getRecordCount() -
resetRecordCount
public void resetRecordCount() -
isOpen
public boolean isOpen()Indicates whether a file is opened for output.- Returns:
true, if the file is opened for output.
-
setOpened
protected void setOpened(boolean opened) -
getFilename
Returns the name of the currently opened file.- Returns:
- String Name of the currently opened file. Returns null if no file is opened.
-
open
Open the output file, creating it if necessary. The name and location of the file is determined thru configuration parameters at the time of the creation of the OINode.- Returns:
true, if it was necessary to create the file.- Throws:
IOException
-
write
Write the given string to the active file.- Throws:
IOException
-
write
- Throws:
IOException
-
write
Write the given bytes to the active file.- Throws:
IOException
-
flush
Flush the contents of the output stream buffer to the file.- Throws:
IOException
-
close
Close the output file.- Throws:
IOException
-
readyToCycle
public boolean readyToCycle()Determine if we're ready to cycle the files.- Returns:
- Return
trueif the files should be cycled.
-
setReadyToCycle
public void setReadyToCycle()Indicate that the files should be cycled. This provides another way to have the files cycled, not solely depending on the timer. Note that this does not cycle the files immediately, but simply changes the state of the writer. -
cycleOldFiles
-
cycleFile
Cycle the output files, as configured by the node. Locate any files in the output directory which conform to the configured naming scheme for theOINodeand tag them as having been processed.- Returns:
- Returns a vector of string(s) representing the filename(s) that have been renamed. If more than one filename is returned, the previous file push was not successful or did not occur due to an improper shutdown.
- Throws:
IOException
-
removeOutFile
public boolean removeOutFile() -
moveToReadyToCycle
Rename all active file to rCycle files- Throws:
IOException
-
setMultiThreadConfiguration
public void setMultiThreadConfiguration(boolean mtChecked, boolean mtOrderChecked) Sets multi threaded values- Parameters:
mtChecked- is multiThreading enabled or notmtOrderChecked- is ordering enabled or not
-
setFileLevelTransactionConfig
public void setFileLevelTransactionConfig(boolean fileLevelTransaction) -
getFileLevelTransactionConfig
public boolean getFileLevelTransactionConfig() -
shutdown
public void shutdown()Shutdown the 'cycle check' thread -
isHealthy
public boolean isHealthy()This function is used to check if the writer is functional -
saveState
This function is used to store state (recovery) information into a buffer managed by the caller.Context information saved:
- current output file name
- current output file length
- time left in cycle
- Specified by:
saveStatein interfaceStateBufferSaveable- Parameters:
buffer- Buffer used to store recovery information
-
restoreState
This function is used to restore the writer's state based on information read from a StateBuffer.- Specified by:
restoreStatein interfaceStateBufferSaveable- Parameters:
buffer- Buffer to read recovery information from- Throws:
StateException
-
saveStateNotification
public void saveStateNotification() -
getPosition
public long getPosition() -
getCurrentFileExpiryTime
public long getCurrentFileExpiryTime() -
getFullFilename
-