public class WriteCSVResult extends AbstractRecordSetWriter implements RecordSetWriter, RawRecordWriter
Modifier and Type | Field and Description |
---|---|
private String |
dateFormat |
private String[] |
fieldNames |
private Object[] |
fieldValues |
private boolean |
headerWritten |
private boolean |
includeHeaderLine |
private org.apache.commons.csv.CSVPrinter |
printer |
private RecordSchema |
recordSchema |
private SchemaAccessWriter |
schemaWriter |
private String |
timeFormat |
private String |
timestampFormat |
Constructor and Description |
---|
WriteCSVResult(org.apache.commons.csv.CSVFormat csvFormat,
RecordSchema recordSchema,
SchemaAccessWriter schemaWriter,
OutputStream out,
String dateFormat,
String timeFormat,
String timestampFormat,
boolean includeHeaderLine,
String charSet) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
private String[] |
getFieldNames(Record record) |
private String |
getFormat(RecordField field) |
String |
getMimeType() |
private void |
includeHeaderIfNecessary(Record record,
boolean includeOnlySchemaFields) |
protected void |
onBeginRecordSet() |
protected Map<String,String> |
onFinishRecordSet() |
WriteResult |
writeRawRecord(Record record) |
Map<String,String> |
writeRecord(Record record) |
beginRecordSet, finishRecordSet, getOutputStream, getRecordCount, incrementRecordCount, isActiveRecordSet, write, write
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
beginRecordSet, finishRecordSet, write
write
private final RecordSchema recordSchema
private final SchemaAccessWriter schemaWriter
private final String dateFormat
private final String timeFormat
private final String timestampFormat
private final org.apache.commons.csv.CSVPrinter printer
private final Object[] fieldValues
private final boolean includeHeaderLine
private boolean headerWritten
private String[] fieldNames
public WriteCSVResult(org.apache.commons.csv.CSVFormat csvFormat, RecordSchema recordSchema, SchemaAccessWriter schemaWriter, OutputStream out, String dateFormat, String timeFormat, String timestampFormat, boolean includeHeaderLine, String charSet) throws IOException
IOException
private String getFormat(RecordField field)
protected void onBeginRecordSet() throws IOException
onBeginRecordSet
in class AbstractRecordSetWriter
IOException
protected Map<String,String> onFinishRecordSet() throws IOException
onFinishRecordSet
in class AbstractRecordSetWriter
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class AbstractRecordSetWriter
IOException
public void flush() throws IOException
flush
in interface RecordWriter
flush
in class AbstractRecordSetWriter
IOException
private void includeHeaderIfNecessary(Record record, boolean includeOnlySchemaFields) throws IOException
IOException
public Map<String,String> writeRecord(Record record) throws IOException
writeRecord
in class AbstractRecordSetWriter
IOException
public WriteResult writeRawRecord(Record record) throws IOException
writeRawRecord
in interface RawRecordWriter
IOException
public String getMimeType()
getMimeType
in interface RecordWriter
Copyright © 2018 Apache NiFi Project. All rights reserved.