Package tilda.db.processors
Class ExporterObjectProcessorJSON<T extends JSONable>
- java.lang.Object
-
- tilda.db.processors.ExporterRecordProcessor
-
- tilda.db.processors.ExporterObjectProcessor<T>
-
- tilda.db.processors.ExporterObjectProcessorJSON<T>
-
- All Implemented Interfaces:
ObjectProcessor<T>,RecordProcessor
public class ExporterObjectProcessorJSON<T extends JSONable> extends ExporterObjectProcessor<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean_jsonLinesprotected static org.apache.logging.log4j.LoggerLOG-
Fields inherited from class tilda.db.processors.ExporterRecordProcessor
_cleanWriter, _endTs, _logFreq, _out, _outName, _startTs, _totalCount
-
-
Constructor Summary
Constructors Constructor Description ExporterObjectProcessorJSON(java.io.Writer out, java.lang.String outName, long logFreq, boolean jsonLines)ExporterObjectProcessorJSON(java.lang.String outFile, long logFreq, boolean jsonLines)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidend(boolean hasMore, int maxCount)Called after the last record has been processed successfullybooleanprocess(int count, T obj)Called for each recordvoidstart()Called before the first record is processed-
Methods inherited from class tilda.db.processors.ExporterObjectProcessor
process
-
Methods inherited from class tilda.db.processors.ExporterRecordProcessor
getEndTimeStamp, getStartTimeStamp, getTotalCount, process
-
-
-
-
Constructor Detail
-
ExporterObjectProcessorJSON
public ExporterObjectProcessorJSON(java.io.Writer out, java.lang.String outName, long logFreq, boolean jsonLines)
-
ExporterObjectProcessorJSON
public ExporterObjectProcessorJSON(java.lang.String outFile, long logFreq, boolean jsonLines) throws java.io.FileNotFoundException- Throws:
java.io.FileNotFoundException
-
-
Method Detail
-
start
public void start() throws java.lang.ExceptionDescription copied from interface:RecordProcessorCalled before the first record is processed- Specified by:
startin interfaceObjectProcessor<T extends JSONable>- Specified by:
startin interfaceRecordProcessor- Overrides:
startin classExporterRecordProcessor- Throws:
java.lang.Exception
-
process
public boolean process(int count, T obj) throws java.lang.ExceptionDescription copied from interface:ObjectProcessorCalled for each record- Parameters:
count- the count of the object processed, starting at 0 for the first object processed.obj- the object processed.- Returns:
- true if processing was successful and should continue, or false if processing was unsuccessful and should be aborted.
- Throws:
java.lang.Exception
-
end
public void end(boolean hasMore, int maxCount) throws java.lang.ExceptionDescription copied from interface:RecordProcessorCalled after the last record has been processed successfully- Specified by:
endin interfaceObjectProcessor<T extends JSONable>- Specified by:
endin interfaceRecordProcessor- Overrides:
endin classExporterRecordProcessor- Parameters:
hasMore- whether there are more records to be processedmaxCount- the max count originally supplied to the query handler- Throws:
java.lang.Exception
-
-