public class MXNarInputTracker
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static FieldKey |
MXFieldKey_Filename |
static FieldKey |
MXFieldKey_RecordID |
Constructor and Description |
---|
MXNarInputTracker(java.io.File inputDirectory,
java.io.File scratchDirectory)
+ To be called by MXNarFileManager.init().
|
Modifier and Type | Method and Description |
---|---|
void |
endRecordProcessing(DCFieldContainer dcfc)
Keep this recordID in the "processed list" of the filename.
|
void |
handleBadFile(java.lang.String filename,
long size)
The specified input record file is bad and will be deleted shortly (after
this method).
|
boolean |
isRecordProcessed(DCFieldContainer dcfc)
Check the internal list of processed records for the procssed status
of this record.
|
boolean |
isTrackedFile(java.lang.String narFile)
For use by MXNarReader to find out if an input file is known by this object.
|
void |
saveRecordDetails(DCFieldContainer dcfc,
java.lang.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(java.lang.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 |
startRecordProcessing(DCFieldContainer dcfc)
Add this record to the outstanding record list of the matching
input file entry.
|
void |
trackFile(java.lang.String newNarFile)
When MXNarReader opened a new Nar file for input, it should tell me
about it using this method.
|
public static final FieldKey MXFieldKey_Filename
public static final FieldKey MXFieldKey_RecordID
public MXNarInputTracker(java.io.File inputDirectory, java.io.File scratchDirectory)
inputDirectory
- is where the directory that holds the input record/NAR files.scratchDirectory
- is the node's temporary directory.public void setRecordReader(MXNarReader reader)
reader
- public void trackFile(java.lang.String newNarFile)
newNarFile
- public boolean isTrackedFile(java.lang.String narFile)
narFile
- public boolean isRecordProcessed(DCFieldContainer dcfc)
nar
- public void startRecordProcessing(DCFieldContainer dcfc)
dcfc
- public void endRecordProcessing(DCFieldContainer dcfc)
nar
- public void saveRecordDetails(DCFieldContainer dcfc, java.lang.String filename, int recordID)
dcfc
- filename
- recordID
- public void setEndOfFileReached(java.lang.String filename, long size)
filename
- public void handleBadFile(java.lang.String filename, long size)
filename
- public void shutdown()