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
_jsonLines
protected static org.apache.logging.log4j.Logger
LOG
-
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 void
end(boolean hasMore, int maxCount)
Called after the last record has been processed successfullyboolean
process(int count, T obj)
Called for each recordvoid
start()
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.Exception
Description copied from interface:RecordProcessor
Called before the first record is processed- Specified by:
start
in interfaceObjectProcessor<T extends JSONable>
- Specified by:
start
in interfaceRecordProcessor
- Overrides:
start
in classExporterRecordProcessor
- Throws:
java.lang.Exception
-
process
public boolean process(int count, T obj) throws java.lang.Exception
Description copied from interface:ObjectProcessor
Called 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.Exception
Description copied from interface:RecordProcessor
Called after the last record has been processed successfully- Specified by:
end
in interfaceObjectProcessor<T extends JSONable>
- Specified by:
end
in interfaceRecordProcessor
- Overrides:
end
in classExporterRecordProcessor
- Parameters:
hasMore
- whether there are more records to be processedmaxCount
- the max count originally supplied to the query handler- Throws:
java.lang.Exception
-
-