public class WriteAvroResultWithExternalSchema extends AbstractRecordSetWriter
Modifier and Type | Field and Description |
---|---|
private org.apache.avro.Schema |
avroSchema |
private OutputStream |
buffered |
private boolean |
closed |
private org.apache.avro.io.DatumWriter<org.apache.avro.generic.GenericRecord> |
datumWriter |
private org.apache.avro.io.BinaryEncoder |
encoder |
private RecordSchema |
recordSchema |
private BlockingQueue<org.apache.avro.io.BinaryEncoder> |
recycleQueue |
private SchemaAccessWriter |
schemaAccessWriter |
Constructor and Description |
---|
WriteAvroResultWithExternalSchema(org.apache.avro.Schema avroSchema,
RecordSchema recordSchema,
SchemaAccessWriter schemaAccessWriter,
OutputStream out,
BlockingQueue<org.apache.avro.io.BinaryEncoder> recycleQueue,
ComponentLog logger) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
String |
getMimeType() |
protected void |
onBeginRecordSet() |
protected Map<String,String> |
onFinishRecordSet() |
Map<String,String> |
writeRecord(Record record) |
beginRecordSet, finishRecordSet, getOutputStream, getRecordCount, incrementRecordCount, isActiveRecordSet, write, write
private final SchemaAccessWriter schemaAccessWriter
private final RecordSchema recordSchema
private final org.apache.avro.Schema avroSchema
private final org.apache.avro.io.BinaryEncoder encoder
private final OutputStream buffered
private final org.apache.avro.io.DatumWriter<org.apache.avro.generic.GenericRecord> datumWriter
private final BlockingQueue<org.apache.avro.io.BinaryEncoder> recycleQueue
private boolean closed
public WriteAvroResultWithExternalSchema(org.apache.avro.Schema avroSchema, RecordSchema recordSchema, SchemaAccessWriter schemaAccessWriter, OutputStream out, BlockingQueue<org.apache.avro.io.BinaryEncoder> recycleQueue, ComponentLog logger)
protected void onBeginRecordSet() throws IOException
onBeginRecordSet
in class AbstractRecordSetWriter
IOException
protected Map<String,String> onFinishRecordSet() throws IOException
onFinishRecordSet
in class AbstractRecordSetWriter
IOException
public Map<String,String> writeRecord(Record record) throws IOException
writeRecord
in class AbstractRecordSetWriter
IOException
public void flush() throws IOException
flush
in interface RecordWriter
flush
in class AbstractRecordSetWriter
IOException
public String getMimeType()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class AbstractRecordSetWriter
IOException
Copyright © 2023 Apache NiFi Project. All rights reserved.