public interface WriterEvents extends WriterPosition
Most methods here represents events in a state machine. The top-level writer provides a set of public methods which trigger one or more of these internal events. The events draw some fine distinctions between top-level values and those nested within arrays. See each kind of writer for the details.
The events also ensure symmetry between top-level and nested tuples, especially those nested within an array. That is, an event cannot change meaning depending on whether the tuple is top-level or nested within an array. Instead, the order of calls, or selectively making or not making calls, can change.
Modifier and Type | Interface and Description |
---|---|
static interface |
WriterEvents.ColumnWriterListener
Listener (callback) for vector overflow events.
|
static class |
WriterEvents.State
Tracks the write state of a tuple or variant to allow applying the correct
operations to newly-added columns to synchronize them with the rest
of the writers.
|
Modifier and Type | Method and Description |
---|---|
void |
bindIndex(ColumnWriterIndex index)
Bind the writer to a writer index.
|
void |
bindListener(WriterEvents.ColumnWriterListener listener)
Bind a listener to the underlying vector writer.
|
void |
dump(HierarchicalFormatter format) |
void |
endArrayValue()
End a value.
|
void |
endWrite()
End a batch: finalize any vector values.
|
void |
postRollover()
The vectors backing this writer rolled over.
|
void |
preRollover()
The vectors backing this vector are about to roll over.
|
void |
restartRow()
During a writer to a row, rewind the the current index position to
restart the row.
|
void |
saveRow()
Saves a row.
|
void |
startRow()
Start a new row.
|
void |
startWrite()
Start a write (batch) operation.
|
lastWriteIndex, rowStartIndex, writeIndex
void bindIndex(ColumnWriterIndex index)
index
- the writer index (top level or nested for
arrays)void bindListener(WriterEvents.ColumnWriterListener listener)
listener
- the vector event listener to bindvoid startWrite()
void startRow()
restartRow()
instead.void endArrayValue()
saveRow()
, but the save of a value
is conditional on saving the row. This version is primarily of use
in tuples nested inside arrays: it saves each tuple within the array,
advancing to a new position in the array. The update of the array's
offset vector based on the cumulative value saves is done when
saving the row.void restartRow()
void saveRow()
void endWrite()
void preRollover()
void postRollover()
void dump(HierarchicalFormatter format)
Copyright © 2021 The Apache Software Foundation. All rights reserved.