Package org.apache.nifi.cdc.event.io
Class AbstractEventWriter<T extends EventInfo>
java.lang.Object
org.apache.nifi.cdc.event.io.AbstractEventWriter<T>
- All Implemented Interfaces:
EventWriter<T>
public abstract class AbstractEventWriter<T extends EventInfo>
extends Object
implements EventWriter<T>
An abstract class that outputs common information (event type, timestamp, e.g.) about CDC events.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.fasterxml.jackson.core.JsonFactoryprotected com.fasterxml.jackson.core.JsonGeneratorFields inherited from interface org.apache.nifi.cdc.event.io.EventWriter
APPLICATION_JSON, CDC_EVENT_TYPE_ATTRIBUTE, SEQUENCE_ID_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected com.fasterxml.jackson.core.JsonGeneratorprotected voidendFile()protected voidendJson()protected voidstartJson(OutputStream outputStream, T event) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.nifi.cdc.event.io.EventWriter
writeEvent
-
Field Details
-
JSON_FACTORY
private final com.fasterxml.jackson.core.JsonFactory JSON_FACTORY -
jsonGenerator
protected com.fasterxml.jackson.core.JsonGenerator jsonGenerator
-
-
Constructor Details
-
AbstractEventWriter
public AbstractEventWriter()
-
-
Method Details
-
startJson
- Throws:
IOException
-
endJson
- Throws:
IOException
-
endFile
- Throws:
IOException
-
createJsonGenerator
protected com.fasterxml.jackson.core.JsonGenerator createJsonGenerator(OutputStream out) throws IOException - Throws:
IOException
-