public class OpticExportToWriterListener extends OpticExportListener
Modifier and Type | Class and Description |
---|---|
static interface |
OpticExportToWriterListener.OpticOutputListener
The listener interface required by onGenerateOutput.
|
exportFunction, rowManager
Constructor and Description |
---|
OpticExportToWriterListener(java.util.function.Function<QueryBatch,PlanBuilder.Plan> function,
RowManager rowManager,
java.io.Writer writer) |
Modifier and Type | Method and Description |
---|---|
OpticExportToWriterListener |
onGenerateOutput(OpticExportToWriterListener.OpticOutputListener listener)
Registers a custom listener to override the default behavior for each
record which sends the record contents in a JSON format to the writer.
|
void |
processEvent(QueryBatch batch)
This is the method QueryBatcher calls for OpticExportListener to do its
thing.
|
OpticExportToWriterListener |
withRecordPrefix(java.lang.String prefix)
Sets the string prefix to send to the writer before each record.
|
OpticExportToWriterListener |
withRecordSuffix(java.lang.String suffix)
Sets the string suffix to append to the writer after each record.
|
getFailureListeners, onBatchFailure, onRowRecordReady
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initializeListener
public OpticExportToWriterListener(java.util.function.Function<QueryBatch,PlanBuilder.Plan> function, RowManager rowManager, java.io.Writer writer)
public OpticExportToWriterListener withRecordSuffix(java.lang.String suffix)
suffix
- the string suffixpublic OpticExportToWriterListener withRecordPrefix(java.lang.String prefix)
prefix
- the string prefixpublic OpticExportToWriterListener onGenerateOutput(OpticExportToWriterListener.OpticOutputListener listener)
listener
- the custom listener (or lambda expression)public void processEvent(QueryBatch batch)
OpticExportListener
processEvent
in interface BatchListener<QueryBatch>
processEvent
in interface QueryBatchListener
processEvent
in class OpticExportListener
batch
- the batch of uris and some metadata about the current status
of the jobCopyright © 2013-2018 MarkLogic Corporation.