Package tilda.db.processors
Class ExporterRecordProcessor
- java.lang.Object
-
- tilda.db.processors.ExporterRecordProcessor
-
- All Implemented Interfaces:
RecordProcessor
- Direct Known Subclasses:
ExporterObjectProcessor
,ExporterRecordProcessorCSVJSON
public abstract class ExporterRecordProcessor extends java.lang.Object implements RecordProcessor
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
_cleanWriter
protected long
_endTs
protected long
_logFreq
protected java.io.Writer
_out
protected java.lang.String
_outName
protected long
_startTs
protected long
_totalCount
protected static org.apache.logging.log4j.Logger
LOG
-
Constructor Summary
Constructors Constructor Description ExporterRecordProcessor(java.io.Writer out, java.lang.String outName, long logFreq)
ExporterRecordProcessor(java.lang.String outFile, long logFreq)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
end(boolean hasMore, int maxCount)
Called after the last record has been processed successfullylong
getEndTimeStamp()
long
getStartTimeStamp()
long
getTotalCount()
boolean
process(int count)
void
start()
Called before the first record is processed-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface tilda.db.processors.RecordProcessor
process
-
-
-
-
Field Detail
-
LOG
protected static final org.apache.logging.log4j.Logger LOG
-
_out
protected java.io.Writer _out
-
_outName
protected java.lang.String _outName
-
_cleanWriter
protected boolean _cleanWriter
-
_totalCount
protected long _totalCount
-
_startTs
protected long _startTs
-
_endTs
protected long _endTs
-
_logFreq
protected long _logFreq
-
-
Constructor Detail
-
ExporterRecordProcessor
public ExporterRecordProcessor(java.io.Writer out, java.lang.String outName, long logFreq)
- Parameters:
out
-outName
- The name of the WriterlogFreq
-
-
ExporterRecordProcessor
public ExporterRecordProcessor(java.lang.String outFile, long logFreq) throws java.io.FileNotFoundException
- Parameters:
outFile
-logFreq
-- Throws:
java.io.FileNotFoundException
-
-
Method Detail
-
start
public void start() throws java.lang.Exception
Description copied from interface:RecordProcessor
Called before the first record is processed- Specified by:
start
in interfaceRecordProcessor
- Throws:
java.lang.Exception
-
process
public boolean process(int count) throws java.lang.Exception
- Throws:
java.lang.Exception
-
end
public void end(boolean hasMore, int maxCount) throws java.lang.Exception
Description copied from interface:RecordProcessor
Called after the last record has been processed successfully- Specified by:
end
in interfaceRecordProcessor
- Parameters:
hasMore
- whether there are more records to be processedmaxCount
- the max count originally supplied to the query handler- Throws:
java.lang.Exception
-
getTotalCount
public long getTotalCount()
-
getStartTimeStamp
public long getStartTimeStamp()
-
getEndTimeStamp
public long getEndTimeStamp()
-
-