public class WriteJsonResult extends Object implements RecordSetWriter
Modifier and Type | Class and Description |
---|---|
private static interface |
WriteJsonResult.GeneratorTask |
Modifier and Type | Field and Description |
---|---|
private DateFormat |
dateFormat |
private org.codehaus.jackson.JsonFactory |
factory |
private ComponentLog |
logger |
private boolean |
prettyPrint |
private RecordSchema |
recordSchema |
private SchemaAccessWriter |
schemaAccess |
private DateFormat |
timeFormat |
private DateFormat |
timestampFormat |
Constructor and Description |
---|
WriteJsonResult(ComponentLog logger,
RecordSchema recordSchema,
SchemaAccessWriter schemaAccess,
boolean prettyPrint,
String dateFormat,
String timeFormat,
String timestampFormat) |
Modifier and Type | Method and Description |
---|---|
String |
getMimeType() |
WriteResult |
write(Record record,
OutputStream rawOut) |
WriteResult |
write(RecordSet rs,
OutputStream rawOut) |
private void |
writeArray(Object[] values,
String fieldName,
org.codehaus.jackson.JsonGenerator generator,
DataType elementType) |
private void |
writeRecord(Record record,
RecordSchema writeSchema,
org.codehaus.jackson.JsonGenerator generator,
WriteJsonResult.GeneratorTask startTask,
WriteJsonResult.GeneratorTask endTask) |
private void |
writeValue(org.codehaus.jackson.JsonGenerator generator,
Object value,
String fieldName,
DataType dataType,
boolean moreCols) |
private final ComponentLog logger
private final boolean prettyPrint
private final SchemaAccessWriter schemaAccess
private final RecordSchema recordSchema
private final org.codehaus.jackson.JsonFactory factory
private final DateFormat dateFormat
private final DateFormat timeFormat
private final DateFormat timestampFormat
public WriteJsonResult(ComponentLog logger, RecordSchema recordSchema, SchemaAccessWriter schemaAccess, boolean prettyPrint, String dateFormat, String timeFormat, String timestampFormat)
public WriteResult write(RecordSet rs, OutputStream rawOut) throws IOException
write
in interface RecordSetWriter
IOException
public WriteResult write(Record record, OutputStream rawOut) throws IOException
write
in interface RecordWriter
IOException
private void writeRecord(Record record, RecordSchema writeSchema, org.codehaus.jackson.JsonGenerator generator, WriteJsonResult.GeneratorTask startTask, WriteJsonResult.GeneratorTask endTask) throws org.codehaus.jackson.JsonGenerationException, IOException, SQLException
org.codehaus.jackson.JsonGenerationException
IOException
SQLException
private void writeValue(org.codehaus.jackson.JsonGenerator generator, Object value, String fieldName, DataType dataType, boolean moreCols) throws org.codehaus.jackson.JsonGenerationException, IOException, SQLException
org.codehaus.jackson.JsonGenerationException
IOException
SQLException
private void writeArray(Object[] values, String fieldName, org.codehaus.jackson.JsonGenerator generator, DataType elementType) throws org.codehaus.jackson.JsonGenerationException, IOException, SQLException
org.codehaus.jackson.JsonGenerationException
IOException
SQLException
public String getMimeType()
getMimeType
in interface RecordWriter
Copyright © 2017 Apache NiFi Project. All rights reserved.