Interface TableWriter<R extends Row>
- All Known Implementing Classes:
AbstractBinaryStoreWriter
,ArrayBackedTableWriter
,BinaryStoreAggregatorWriterMultiPartition
,BinaryStoreAggregatorWriterStandard
,BinaryStoreWriterV2
,DiskTableWriter
,DynamicTableWriter
,HybridWriter
,InMemoryTableWriter
,InMemoryTableWriter
,LocalTableWriter
,RowOrientedArrayBackedTableWriter
,StreamTableWriter
public interface TableWriter<R extends Row> extends Entry
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.binarystore.Record
Record.RecordSetter<T extends RecordData>
-
Field Summary
Fields Modifier and Type Field Description static RowSetter
NULL_SETTER
-
Method Summary
Modifier and Type Method Description void
close()
Closes the writer.void
flush()
Flushes data out.default void
flushDeferredRows()
Write any rows buffered bywriteDeferredRow(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>
Record.RecordSetter<T>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).Methods inherited from interface com.illumon.iris.binarystore.Row
getColumnPartitionValue, setColumnPartitionValue
-
Field Details
-
Method Details
-
getSetter
Gets a setter for a column.The implementation is likely to delegate to
Row.getSetter(String)
in a default Row instance. -
getSetter
Gets a typed setter for a column.The implementation is likely to delegate to
Row.getSetter(String, Class)
in a default Row instance. -
setFlags
The implementation is likely to delegate to
Row.setFlags(Flags)
in a default Row instance. -
getRowWriter
R getRowWriter()Get a writer for a Row entries. This is likely to be newly created, so callers should cache this value. In practice, TableWriter implementations generally cache the result of the first call to this method as a primary writer.- Returns:
- a Row, likely newly created
-
writeRow
Writes out a new row (values set using setters).The implementation is likely to delegate to
Row.writeRow()
in a default Row instance.- Specified by:
writeRow
in interfaceRow
- Throws:
IOException
- problem writing the row- ImplNote:
- This method is used as part of the import portion of the table recording process in TableListeners
-
writeDeferredRow
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
flushDeferredRows()
to tell the implementation to write any buffered rows.- Parameters:
row
- The row to write (or potentially buffer)- Throws:
IOException
- if an error occurs during write.
-
flushDeferredRows
Write any rows buffered bywriteDeferredRow(WritableRowContainer)
to storage.- Throws:
IOException
- if an error occurs during write. Implementations that may write to more than one channel will write through to each channel and throw aMultiException
wrapped in anIOException
that contains the details on errors that occurred per channel.
-
getRecordWriter
Get new writer for Record entries. This is likely to be newly created, so callers should cache this value. In practice, implementers generally cache the result of the first call to this method as a primary writer.- Returns:
- a Record, likely newly created
-
getRecordSetter
Gets a record setter for an entry.The implementation is likely to delegate to
Record.getRecordSetter()
in a default Record instance.- Specified by:
getRecordSetter
in interfaceRecord
- Returns:
- setter for the record.
-
getRecordSetter
Gets a typed record setter for an entry.The implementation is likely to delegate to
Record.getRecordSetter(Class)
in a default Record instance.- Specified by:
getRecordSetter
in interfaceRecord
- Returns:
- setter for the record.
-
writeRecord
Write a record entry to the provided output channel. The implementor is responsible for providing the data buffer.The
TableWriter
implementation is likely to delegate toRecord.writeRecord(WritableByteChannel)
in a default Record instance.- Specified by:
writeRecord
in interfaceRecord
- Throws:
IOException
-
close
Closes the writer.- Throws:
IOException
- problem closing the writer.
-
getColumnTypes
Class[] getColumnTypes()Gets the column types for the table.- Returns:
- column types for the table.
-
getColumnNames
String[] getColumnNames()Gets the column names for the table.- Returns:
- column names for the table.
-
flush
Flushes data out.- Throws:
IOException
- problem flushing data out.
-
supportAllTypes
boolean supportAllTypes()True if all data types can be written out; false otherwise.- Returns:
- true if all data types can be written out; false otherwise.
-