public class SimpleBatchManager extends java.lang.Object implements BatchManager
Constructor and Description |
---|
SimpleBatchManager(java.lang.String filename,
int skip,
int whichBatch,
int totalBatches)
Constructs a SimpleBatchManager object.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getFilename()
Returns the name of the file
|
BatchItem |
getNextItem()
Gets the next available batch item or null if no more are available
|
void |
start()
Starts processing the batch
|
void |
stop()
Stops processing the batch
|
public SimpleBatchManager(java.lang.String filename, int skip, int whichBatch, int totalBatches)
filename
- the name of the batch fileskip
- number of records to skip between itemswhichBatch
- which chunk of the batch should we processtotalBatches
- the total number of chuncks that the batch is divided into.public void start() throws java.io.IOException
start
in interface BatchManager
java.io.IOException
- if an error occurs while processing the batch filepublic BatchItem getNextItem() throws java.io.IOException
getNextItem
in interface BatchManager
java.io.IOException
- if an I/O error occurs while getting the next item from the batch file.public void stop() throws java.io.IOException
stop
in interface BatchManager
java.io.IOException
- if an error occurs while processing the batch filepublic java.lang.String getFilename()
getFilename
in interface BatchManager