Package com.illumon.iris.db.tables.utils
Class InMemoryTableWriter
java.lang.Object
com.illumon.iris.db.tables.utils.InMemoryTableWriter
- All Implemented Interfaces:
Entry,Record,Row,TableWriter
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.binarystore.Record
Record.RecordSetter<T extends RecordData> -
Field Summary
FieldsFields inherited from interface com.illumon.iris.binarystore.TableWriter
NULL_SETTER -
Constructor Summary
ConstructorsConstructorDescriptionInMemoryTableWriter(TableDefinition definition, Map<String, Object> constantValues) InMemoryTableWriter(TableDefinition definition, Map<String, Object> constantValues, int initialCapacity) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the writer.voidflush()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.getTable()voidvoidsetRowLimit(int rowLimit) booleanTrue if all data types can be written out; false otherwise.voidwriteRow()Writes out a new row (values set using setters).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.illumon.iris.binarystore.Row
getColumnPartitionValue, setColumnPartitionValueMethods inherited from interface com.illumon.iris.binarystore.TableWriter
flushDeferredRows, getRecordSetter, getRecordSetter, getRecordWriter, getSetter, writeDeferredRow, writeRecord
-
Field Details
-
definition
-
initialCapacity
protected final int initialCapacity -
data
-
-
Constructor Details
-
InMemoryTableWriter
public InMemoryTableWriter(TableDefinition definition, Map<String, Object> constantValues) throws IOException- Throws:
IOException
-
InMemoryTableWriter
public InMemoryTableWriter(TableDefinition definition, Map<String, Object> constantValues, int initialCapacity) throws IOException- Throws:
IOException
-
-
Method Details
-
setRowLimit
public void setRowLimit(int rowLimit) -
getTable
-
getSetter
Description copied from interface:TableWriterGets a setter for a column.The implementation is likely to delegate to
Row.getSetter(String)in a default Row instance.- Specified by:
getSetterin interfaceRow- Specified by:
getSetterin interfaceTableWriter- Parameters:
name- column name- Returns:
- setter for the column.
-
setFlags
Description copied from interface:TableWriterThe implementation is likely to delegate to
Row.setFlags(Flags)in a default Row instance.- Specified by:
setFlagsin interfaceRow- Specified by:
setFlagsin interfaceTableWriter
-
getRowWriter
Description copied from interface:TableWriterGet 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:
getRowWriterin interfaceTableWriter- Returns:
- a Row, likely newly created
-
writeRow
Description copied from interface:TableWriterWrites 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- Specified by:
writeRowin interfaceTableWriter- Throws:
IOException- problem writing the row
-
close
Description copied from interface:TableWriterCloses the writer.- Specified by:
closein interfaceTableWriter- Throws:
IOException- problem closing the writer.
-
getColumnTypes
Description copied from interface:TableWriterGets the column types for the table.- Specified by:
getColumnTypesin interfaceTableWriter- Returns:
- column types for the table.
-
getColumnNames
Description copied from interface:TableWriterGets the column names for the table.- Specified by:
getColumnNamesin interfaceTableWriter- Returns:
- column names for the table.
-
flush
Description copied from interface:TableWriterFlushes data out.- Specified by:
flushin interfaceTableWriter- Throws:
IOException- problem flushing data out.
-
supportAllTypes
public boolean supportAllTypes()Description copied from interface:TableWriterTrue if all data types can be written out; false otherwise.- Specified by:
supportAllTypesin interfaceTableWriter- Returns:
- true if all data types can be written out; false otherwise.
-