public abstract class ArrowWriter extends Object implements AutoCloseable
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
LOGGER |
protected IpcOption |
option |
protected WriteChannel |
out |
protected Schema |
schema |
| Modifier | Constructor and Description |
|---|---|
protected |
ArrowWriter(VectorSchemaRoot root,
DictionaryProvider provider,
WritableByteChannel out) |
protected |
ArrowWriter(VectorSchemaRoot root,
DictionaryProvider provider,
WritableByteChannel out,
IpcOption option) |
protected |
ArrowWriter(VectorSchemaRoot root,
DictionaryProvider provider,
WritableByteChannel out,
IpcOption option,
CompressionCodec.Factory compressionFactory,
CompressionUtil.CodecType codecType,
Optional<Integer> compressionLevel)
Note: fields are not closed when the writer is closed.
|
| Modifier and Type | Method and Description |
|---|---|
long |
bytesWritten() |
void |
close() |
void |
end() |
protected void |
endInternal(WriteChannel out) |
protected abstract void |
ensureDictionariesWritten(DictionaryProvider provider,
Set<Long> dictionaryIdsUsed)
Write dictionaries after schema and before recordBatches, dictionaries won't be
written if empty stream (only has schema data in IPC).
|
void |
start() |
protected void |
startInternal(WriteChannel out) |
void |
writeBatch()
Writes the record batch currently loaded in this instance's VectorSchemaRoot.
|
protected ArrowBlock |
writeDictionaryBatch(ArrowDictionaryBatch batch) |
protected void |
writeDictionaryBatch(Dictionary dictionary) |
protected ArrowBlock |
writeRecordBatch(ArrowRecordBatch batch) |
protected static final org.slf4j.Logger LOGGER
protected final Schema schema
protected final WriteChannel out
protected IpcOption option
protected ArrowWriter(VectorSchemaRoot root, DictionaryProvider provider, WritableByteChannel out)
protected ArrowWriter(VectorSchemaRoot root, DictionaryProvider provider, WritableByteChannel out, IpcOption option)
protected ArrowWriter(VectorSchemaRoot root, DictionaryProvider provider, WritableByteChannel out, IpcOption option, CompressionCodec.Factory compressionFactory, CompressionUtil.CodecType codecType, Optional<Integer> compressionLevel)
root - the vectors to write to the outputprovider - where to find the dictionariesout - the output where to writeoption - IPC write optionscompressionFactory - Compression codec factorycodecType - Compression codeccompressionLevel - Compression levelpublic void start()
throws IOException
IOExceptionpublic void writeBatch()
throws IOException
IOExceptionprotected void writeDictionaryBatch(Dictionary dictionary) throws IOException
IOExceptionprotected ArrowBlock writeDictionaryBatch(ArrowDictionaryBatch batch) throws IOException
IOExceptionprotected ArrowBlock writeRecordBatch(ArrowRecordBatch batch) throws IOException
IOExceptionpublic void end()
throws IOException
IOExceptionpublic long bytesWritten()
protected abstract void ensureDictionariesWritten(DictionaryProvider provider, Set<Long> dictionaryIdsUsed) throws IOException
IOExceptionprotected void startInternal(WriteChannel out) throws IOException
IOExceptionprotected void endInternal(WriteChannel out) throws IOException
IOExceptionpublic void close()
close in interface AutoCloseableCopyright © 2024 The Apache Software Foundation. All rights reserved.