Interface TableWriter<R extends Row>
- All Known Implementing Classes:
AbstractBinaryStoreWriter,ArrayBackedTableWriter,BinaryStoreAggregatorWriterBase,BinaryStoreAggregatorWriterMultiPartition,BinaryStoreAggregatorWriterStandard,BinaryStoreWriterV2,DiskTableWriter,DynamicTableWriter,HybridWriter,InMemoryTableWriter,InMemoryTableWriter,LocalTableWriter,RowOrientedArrayBackedTableWriter,StreamTableWriter
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.binarystore.Record
Record.RecordSetter<T extends RecordData> -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the writer.voidflush()Flushes data out.default voidWrite any rows buffered bywriteDeferredRow(WritableRowContainer)to storage.String[]Gets the column names for the table.Class[]Gets the column types for the table.default Record.RecordSetter<RecordData>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 RecordGet new writer for Record entries.Get a writer for a Row entries.Gets a setter for a column.default <T> RowSetter<T>Gets a typed setter for a column.voidbooleanTrue if all data types can be written out; false otherwise.default voidWrite the row to disk.default voidwriteRecord(WritableByteChannel channel) Write a record entry to the provided output channel.voidwriteRow()Writes out a new row (values set using setters).Methods inherited from interface com.illumon.iris.binarystore.Row
getColumnPartitionValue, setColumnPartitionValue
-
Field Details
-
NULL_SETTER
-
-
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:
writeRowin 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 aMultiExceptionwrapped in anIOExceptionthat 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:
getRecordSetterin 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:
getRecordSetterin 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
TableWriterimplementation is likely to delegate toRecord.writeRecord(WritableByteChannel)in a default Record instance.- Specified by:
writeRecordin 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.
-