public interface FrameWriter extends Closeable
Frame. See that class for format information.
Generally obtained through a FrameWriters.makeFrameWriterFactory(org.apache.druid.frame.FrameType, org.apache.druid.frame.allocation.MemoryAllocatorFactory, org.apache.druid.segment.column.RowSignature, java.util.List<org.apache.druid.frame.key.KeyColumn>).| Modifier and Type | Method and Description |
|---|---|
boolean |
addSelection()
Write the current row to the frame that is under construction, if there is enough space to do so.
|
void |
close() |
int |
getNumRows()
Returns the number of rows written so far.
|
long |
getTotalSize()
Returns the number of bytes that would be written by
writeTo(org.apache.datasketches.memory.WritableMemory, long) if called now. |
default byte[] |
toByteArray()
Returns a frame as a newly-allocated byte array.
|
long |
writeTo(org.apache.datasketches.memory.WritableMemory memory,
long position)
Writes the frame to the provided memory location, which must have at least
getTotalSize() bytes available. |
boolean addSelection()
If this method returns false on an empty frame, or in a situation where starting a new frame is impractical,
it is conventional (although not required) for the caller to throw FrameRowTooLargeException.
int getNumRows()
long getTotalSize()
writeTo(org.apache.datasketches.memory.WritableMemory, long) if called now.long writeTo(org.apache.datasketches.memory.WritableMemory memory,
long position)
getTotalSize() bytes available.
Once this method is called, the frame writer is no longer usable and must be closed.
Returns the number of bytes written, which will equal getTotalSize().IllegalStateException - if the provided memory does not have sufficient space to write this frame.default byte[] toByteArray()
void close()
close in interface AutoCloseableclose in interface CloseableCopyright © 2011–2023 The Apache Software Foundation. All rights reserved.