Class StreamTableReader
java.lang.Object
com.illumon.iris.db.tables.dataimport.StreamTableReader
- All Implemented Interfaces:
TableReader
public class StreamTableReader extends Object implements TableReader
A "stream" table reader that consumes from a ByteBuffer.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.binarystore.TableReader
TableReader.MissingPropertyGetterException
-
Constructor Summary
Constructors Constructor Description StreamTableReader(TableDefinition tableDefinition)
-
Method Summary
Modifier and Type Method Description void
close()
Close the input source for this TableReader.int
getApplicationVersion()
Get the application version associated with the file being read by this TableReader.String[]
getColumnNames()
Get an array of all known column names.SupportedType
getColumnType(String columnName)
Get the SupportedType of the named column.RowGetter<Row.Flags>
getFlagGetter()
Each row is independent.RowGetter
getGetter(String name)
Return a raw RowGetter for the column with the given name.<T> RowGetter<T>
getGetter(String name, Class<T> tClass)
Return a typed RowGetter for the column with the given name.boolean
readRow()
Read a row from the source, expecting that all entries will be Rows.QueryTable
readTable(long size)
void
setBuffer(ByteBuffer currentBuffer)
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.TableReader
getPropertyGetter, getRecordDataGetter, readAllEntries, readAllEntries, readEntry
-
Constructor Details
-
Method Details
-
readTable
-
getGetter
Description copied from interface:TableReader
Return a raw RowGetter for the column with the given name. RowGetter.get() will return Object.- Specified by:
getGetter
in interfaceTableReader
- Parameters:
name
- the column name- Returns:
- a RowGetter
-
getGetter
Description copied from interface:TableReader
Return a typed RowGetter for the column with the given name. RowGetter.get() will return type tClass.- Specified by:
getGetter
in interfaceTableReader
- Parameters:
name
- the column name- Returns:
- a RowGetter of type tClass
-
readRow
public boolean readRow()Description copied from interface:TableReader
Read a row from the source, expecting that all entries will be Rows. If a record entry is encountered, anIllegalStateException
will be thrown.- Specified by:
readRow
in interfaceTableReader
- Returns:
- true if successful, false if EOF or an error is encountered.
-
close
public void close()Description copied from interface:TableReader
Close the input source for this TableReader.- Specified by:
close
in interfaceTableReader
-
getColumnNames
Description copied from interface:TableReader
Get an array of all known column names. These can be used to determine valid column names for use inTableReader.getGetter(String)
.- Specified by:
getColumnNames
in interfaceTableReader
- Returns:
- a new array of all known column names.
-
getColumnType
Description copied from interface:TableReader
Get the SupportedType of the named column.- Specified by:
getColumnType
in interfaceTableReader
- Parameters:
columnName
- the name of the column- Returns:
- the SupportedType value for the named column
-
getFlagGetter
Each row is independent.- Specified by:
getFlagGetter
in interfaceTableReader
- Returns:
- a getter that returns the flags for each row.
-
setBuffer
-
getApplicationVersion
public int getApplicationVersion()Description copied from interface:TableReader
Get the application version associated with the file being read by this TableReader.- Specified by:
getApplicationVersion
in interfaceTableReader
- Returns:
- the file's application version
-