public interface TableWriter<R extends Row> extends Entry
Record.RecordSetter<T extends RecordData>
Modifier and Type | Field and Description |
---|---|
static RowSetter |
NULL_SETTER |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the writer.
|
void |
flush()
Flushes data out.
|
default void |
flushDeferredRows()
Write any rows buffered by
TableWriter.writeDeferredRow(WritableRowContainer) to storage. |
String[] |
getColumnNames()
Gets the column names for the table.
|
Class[] |
getColumnTypes()
Gets the column types for the table.
|
default Record.RecordSetter<RecordData> |
getRecordSetter()
Gets a record setter for an entry.
|
default <T extends RecordData> |
getRecordSetter(Class<T> tClass)
Gets a typed record setter for an entry.
|
default Record |
getRecordWriter()
Get new writer for Record entries.
|
R |
getRowWriter()
Get a writer for a Row entries.
|
RowSetter |
getSetter(String name)
Gets a setter for a column.
|
default <T> RowSetter<T> |
getSetter(String name,
Class<T> tClass)
Gets a typed setter for a column.
|
void |
setFlags(Row.Flags flags) |
boolean |
supportAllTypes()
True if all data types can be written out; false otherwise.
|
default void |
writeDeferredRow(WritableRowContainer<R> row)
Write the row to disk.
|
default void |
writeRecord(WritableByteChannel channel)
Write a record entry to the provided output channel.
|
void |
writeRow()
Writes out a new row (values set using setters).
|
getColumnPartitionValue, setColumnPartitionValue, size
static final RowSetter NULL_SETTER
RowSetter getSetter(String name)
The implementation is likely to delegate to Row.getSetter(String)
in a default Row instance.
default <T> RowSetter<T> getSetter(@NotNull String name, @NotNull Class<T> tClass)
The implementation is likely to delegate to Row.getSetter(String, Class)
in a default Row instance.
void setFlags(Row.Flags flags)
The implementation is likely to delegate to Row.setFlags(Flags)
in a default Row instance.
R getRowWriter()
void writeRow() throws IOException
The implementation is likely to delegate to Row.writeRow()
in a default Row instance.
writeRow
in interface Row
IOException
- problem writing the rowdefault void writeDeferredRow(@NotNull WritableRowContainer<R> row) throws IOException
Write the row to disk.
Implementations of this method may choose to buffer rows for more efficient use of the underlying storage.
Users should invoke TableWriter.flushDeferredRows()
to tell the implementation to write any buffered rows.
row
- The row to write (or potentially buffer)IOException
- if an error occurs during write.default void flushDeferredRows() throws IOException
TableWriter.writeDeferredRow(WritableRowContainer)
to storage.IOException
- if an error occurs during write. Implementations that may write to more than one channel
will write through to each channel and throw a MultiException
wrapped in an IOException
that contains the details on errors that occurred per channel.default Record getRecordWriter()
default Record.RecordSetter<RecordData> getRecordSetter()
The implementation is likely to delegate to Record.getRecordSetter()
in a default Record instance.
getRecordSetter
in interface Record
default <T extends RecordData> Record.RecordSetter<T> getRecordSetter(Class<T> tClass)
The implementation is likely to delegate to Record.getRecordSetter(Class)
in a default Record instance.
getRecordSetter
in interface Record
default void writeRecord(WritableByteChannel channel) throws IOException
The TableWriter
implementation is likely to delegate to Record.writeRecord(WritableByteChannel)
in a default Record instance.
writeRecord
in interface Record
IOException
void close() throws IOException
IOException
- problem closing the writer.Class[] getColumnTypes()
String[] getColumnNames()
void flush() throws IOException
IOException
- problem flushing data out.boolean supportAllTypes()