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
public class InMemoryTableWriter extends Object implements TableWriter
-
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 protected List<List>
data
protected TableDefinition
definition
protected int
initialCapacity
-
Constructor Summary
Constructors Constructor Description InMemoryTableWriter(TableDefinition definition, Map<String,Object> constantValues)
InMemoryTableWriter(TableDefinition definition, Map<String,Object> constantValues, int initialCapacity)
-
Method Summary
Modifier and Type Method Description void
close()
Closes the writer.void
flush()
Flushes data out.String[]
getColumnNames()
Gets the column names for the table.Class[]
getColumnTypes()
Gets the column types for the table.Row
getRowWriter()
Get a writer for a Row entries.RowSetter
getSetter(String name)
Gets a setter for a column.InMemoryTable
getTable()
void
setFlags(Row.Flags flags)
void
setRowLimit(int rowLimit)
boolean
supportAllTypes()
True if all data types can be written out; false otherwise.void
writeRow()
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, 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
-
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: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
-
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.
-
flush
Description copied from interface:TableWriter
Flushes data out.- Specified by:
flush
in interfaceTableWriter
- Throws:
IOException
- problem flushing data out.
-
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.
-