Class MXNarInputTracker
java.lang.Object
com.metasolv.nm.processor.MXAggregator.MXNarInputTracker
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMXNarInputTracker
(File inputDirectory, File scratchDirectory) + To be called by MXNarFileManager.init(). -
Method Summary
Modifier and TypeMethodDescriptionvoid
Keep this recordID in the "processed list" of the filename.void
handleBadFile
(String filename, long size) The specified input record file is bad and will be deleted shortly (after this method).boolean
Check the internal list of processed records for the procssed status of this record.boolean
isTrackedFile
(String narFile) For use by MXNarReader to find out if an input file is known by this object.void
saveRecordDetails
(DCFieldContainer dcfc, String filename, int recordID) Store the filename and recordID as Fields inside the NAR, so that the information can be recovered later by other methods in this class.void
setEndOfFileReached
(String filename, long size) Tell the tracker that all records of this file has been read in.void
setRecordReader
(MXNarReader reader) The MXNarFileManager creates this object first, then gives this object to the MXNarReader's constructor.void
shutdown()
Close all open journal files.void
Add this record to the outstanding record list of the matching input file entry.void
When MXNarReader opened a new Nar file for input, it should tell me about it using this method.
-
Field Details
-
MXFieldKey_Filename
-
MXFieldKey_RecordID
-
-
Constructor Details
-
MXNarInputTracker
+ To be called by MXNarFileManager.init().- Parameters:
inputDirectory
- is where the directory that holds the input record/NAR files.scratchDirectory
- is the node's temporary directory.
-
-
Method Details
-
setRecordReader
The MXNarFileManager creates this object first, then gives this object to the MXNarReader's constructor. This method lets the MXNarFileManager set the created MXNarReader object afterwards. The MXNarRead object is needed to do the actual file removal work, since there's more than just deleting a file. + MXNarFileManager.init()- Parameters:
reader
-
-
trackFile
When MXNarReader opened a new Nar file for input, it should tell me about it using this method. This method will create a new journal file. If a matching journal file already exists, it will read the file to populate the list of processed record numbers. + MXNarReader.setupNextInputFile(), almost last line- Parameters:
newNarFile
-
-
isTrackedFile
For use by MXNarReader to find out if an input file is known by this object. Files that this object knows about will be deleted by this object.- Parameters:
narFile
-- Returns:
-
isRecordProcessed
Check the internal list of processed records for the procssed status of this record. The originating filename and record# should be embedded in the NAR already. + This method is to be used by MXNarInputProcessor.run().- Parameters:
nar
-- Returns:
-
startRecordProcessing
Add this record to the outstanding record list of the matching input file entry. + This method is to be used by MXNarInputProcessor.getData().- Parameters:
dcfc
-
-
endRecordProcessing
Keep this recordID in the "processed list" of the filename. Also write a journal entry for this file about this record. Finally, if there are no more outstanding records for this file, delete the actual input file, the matching journal file, and any hashtable/array/whatever related to tracking stuff in this file. + This method is to be called by MXNPLFieldProcessor.processData() MXNarProvider.endRecordProcessing() MXNarInputProcessor.endRecordProcessing().- Parameters:
nar
-
-
saveRecordDetails
Store the filename and recordID as Fields inside the NAR, so that the information can be recovered later by other methods in this class. + Used by MXNarReader.readNAR().- Parameters:
dcfc
-filename
-recordID
-
-
setEndOfFileReached
Tell the tracker that all records of this file has been read in. (But not all are processed yet.) + To be used by MXNarReader.handleEndOfFile().- Parameters:
filename
-
-
handleBadFile
The specified input record file is bad and will be deleted shortly (after this method). + Used by MXNarReader.handleInputFileError().- Parameters:
filename
-
-
shutdown
public void shutdown()Close all open journal files. Empty the internal file entry mappings. + This is used by MXNarFileManager.shutdownOutput(), because MXNarFileManager created this thing. It's in shutdownOutput() because both MXNarInputProcessor thread and the field processor threads are still using the entries inside the fileMap, so they have to be shutdown first.
-