Class StreamTableWriter
java.lang.Object
com.illumon.iris.db.tables.dataimport.StreamTableWriter
- All Implemented Interfaces:
Entry
,Record
,Row
,TableWriter
A "stream" table writer that outputs to a single byte buffer sink.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.binarystore.Record
Record.RecordSetter<T extends RecordData>
-
Field Summary
Fields inherited from interface com.illumon.iris.binarystore.TableWriter
NULL_SETTER
-
Constructor Summary
ConstructorsConstructorDescriptionStreamTableWriter
(TableDefinition definition, com.fishlib.io.streams.CurrentByteBufferSink byteBufferSink) Create a stream table writer that writes to the supplied sink. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the writer.void
flush()
Flushes data out.String[]
Gets the column names for the table.Class[]
Gets the column types for the table.Get a writer for a Row entries.Gets a setter for a column.void
boolean
True if all data types can be written out; false otherwise.void
writeRow()
Writes out a new row (values set using setters).void
writeTable
(Table t, long offset, long length) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.illumon.iris.binarystore.Row
getColumnPartitionValue, setColumnPartitionValue
Methods inherited from interface com.illumon.iris.binarystore.TableWriter
flushDeferredRows, getRecordSetter, getRecordSetter, getRecordWriter, getSetter, writeDeferredRow, writeRecord
-
Constructor Details
-
StreamTableWriter
public StreamTableWriter(@NotNull TableDefinition definition, @NotNull com.fishlib.io.streams.CurrentByteBufferSink byteBufferSink) Create a stream table writer that writes to the supplied sink.- Parameters:
definition
- The table definitionbyteBufferSink
- The sink
-
-
Method Details
-
getSetter
Description copied from interface:TableWriter
Gets a setter for a column.The implementation is likely to delegate to
Row.getSetter(String)
in a default Row instance.- Specified by:
getSetter
in interfaceRow
- Specified by:
getSetter
in interfaceTableWriter
- Parameters:
name
- column name- Returns:
- setter for the column.
-
setFlags
Description copied from interface:TableWriter
The implementation is likely to delegate to
Row.setFlags(Flags)
in a default Row instance.- Specified by:
setFlags
in interfaceRow
- Specified by:
setFlags
in interfaceTableWriter
-
getRowWriter
Description copied from interface:TableWriter
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.- Specified by:
getRowWriter
in interfaceTableWriter
- Returns:
- a Row, likely newly created
-
writeRow
Description copied from interface:TableWriter
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
- Specified by:
writeRow
in interfaceTableWriter
- Throws:
IOException
- problem writing the row
-
flush
public void flush()Description copied from interface:TableWriter
Flushes data out.- Specified by:
flush
in interfaceTableWriter
-
supportAllTypes
public boolean supportAllTypes()Description copied from interface:TableWriter
True if all data types can be written out; false otherwise.- Specified by:
supportAllTypes
in interfaceTableWriter
- Returns:
- true if all data types can be written out; false otherwise.
-
close
Description copied from interface:TableWriter
Closes the writer.- Specified by:
close
in interfaceTableWriter
- Throws:
IOException
- problem closing the writer.
-
getColumnTypes
Description copied from interface:TableWriter
Gets the column types for the table.- Specified by:
getColumnTypes
in interfaceTableWriter
- Returns:
- column types for the table.
-
getColumnNames
Description copied from interface:TableWriter
Gets the column names for the table.- Specified by:
getColumnNames
in interfaceTableWriter
- Returns:
- column names for the table.
-
writeTable
- Throws:
IOException
-