Package com.illumon.iris.binarystore
Class AbstractBinaryStoreReaderV2
java.lang.Object
com.illumon.iris.binarystore.AbstractBinaryStoreReader
com.illumon.iris.binarystore.AbstractBinaryStoreReaderV2
- All Implemented Interfaces:
BinaryStoreReader
,TableReader
- Direct Known Subclasses:
BinaryStoreBufferProcessorV2
,BinaryStoreReaderV2
,BinaryStoreSocketReaderV2
public abstract class AbstractBinaryStoreReaderV2 extends AbstractBinaryStoreReader
Base for V2 binary store readers.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractBinaryStoreReaderV2.BinaryStoreRowGetter<T>
Nested classes/interfaces inherited from class com.illumon.iris.binarystore.AbstractBinaryStoreReader
AbstractBinaryStoreReader.MissingGetterException
Nested classes/interfaces inherited from interface com.illumon.iris.binarystore.TableReader
TableReader.MissingPropertyGetterException
-
Field Summary
Fields Modifier and Type Field Description static String
ROW_SIZE_PROP
Fields inherited from class com.illumon.iris.binarystore.AbstractBinaryStoreReader
columnNames, columnTypes, CONSUMER_BUFFER_SIZE, dataBuffer, mask, PRODUCER_BUFFER_SIZE, rowGetters, typeMetadata
-
Method Summary
Modifier and Type Method Description int
getApplicationVersion()
If there is no application version number, then we return 0, which means to use the most recent listener available.RowGetter<Row.Flags>
getFlagGetter()
Retrieve the getter for the row flags.<T> RowGetter<T>
getPropertyGetter(String property)
Retrieve a getter for the specified internal property.Supplier<RecordData>
getRecordDataGetter()
Retrieve the getter for the RecordData.protected void
parseRecord()
Parse the record entry out of the internal buffer.protected void
parseRow()
Parse the row entry out of the internal data buffer.boolean
readEntry()
Read data into the internal dataBuffer in order to populate the entire row.void
readHeader(ByteBuffer theBuffer)
This implementation callsAbstractBinaryStoreReader.readIntoByteBuffer(int, ByteBuffer)
andAbstractBinaryStoreReader.readData(int, ByteBuffer)
to add bytes to the given buffer.
The data buffer is required to be at the beginning (position==0).
Inherited doc: Read a binary header from the given buffer.boolean
readRow()
Deprecated.usereadEntry()
and handle record entries appropriately.Methods inherited from class com.illumon.iris.binarystore.AbstractBinaryStoreReader
getColumnNames, getColumnType, getGetter, getGetter, getTypeMetadataString, handleRecord, handleRow, readData, readDataBuffer, readHeader, readIntoByteBuffer, setRecordHandler, setRowHandler
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
close, readAllEntries, readAllEntries
-
Field Details
-
ROW_SIZE_PROP
- See Also:
- Constant Field Values
-
-
Method Details
-
readHeader
This implementation callsAbstractBinaryStoreReader.readIntoByteBuffer(int, ByteBuffer)
andAbstractBinaryStoreReader.readData(int, ByteBuffer)
to add bytes to the given buffer.
The data buffer is required to be at the beginning (position==0).
Inherited doc: Read a binary header from the given buffer. This interface does not dictate anything about the BinaryStore implementation in the buffer. Implementations might make implementation-dependent actions to fill the buffer if there isn't enough data. byteBuffer.position will be advanced by the size of the header.- Parameters:
theBuffer
- buffer containing the header, in reading mode- Throws:
IOException
- an exception derived from IOException may be thrown if there isn't enough data in the buffer.EofException
- may be thrown if an underlying channel (if any) ends.
-
parseRow
protected void parseRow()Parse the row entry out of the internal data buffer. It will be valid to handle the row after this finishes. This must advance the buffer position to the end of the row, leaving the checksum. -
parseRecord
protected void parseRecord()Parse the record entry out of the internal buffer. It will be valid to handle the record after this finishes. This must advance the buffer position to the end of the row, leaving the checksum. -
readEntry
Read data into the internal dataBuffer in order to populate the entire row. This implementation callsAbstractBinaryStoreReader.readIntoByteBuffer(int, ByteBuffer)
andAbstractBinaryStoreReader.readData(int, ByteBuffer)
to read more data from the implementation-defined source. RowGetters are also called, but they do not read from the source in this implementation.- Returns:
- true if successful, false if EOF or an error is encountered.
- Throws:
IOException
- if EOF is encountered mid-row or any invalid data is encountered.
-
readRow
Deprecated.usereadEntry()
and handle record entries appropriately.Read data into the internal dataBuffer in order to populate the entire row. This implementation callsAbstractBinaryStoreReader.readIntoByteBuffer(int, ByteBuffer)
andAbstractBinaryStoreReader.readData(int, ByteBuffer)
. to read more data from the implementation-defined source. RowGetters are also called, but they do not read from the source in this implementation.- Returns:
- true if successful, false if EOF or an error is encountered.
- Throws:
IOException
- if EOF is encountered mid-row or any invalid data is encountered.
-
getPropertyGetter
Description copied from interface:TableReader
Retrieve a getter for the specified internal property.- Parameters:
property
- The property to get a getter for- Returns:
- A correctly typed getter for the property.
-
getFlagGetter
Description copied from interface:TableReader
Retrieve the getter for the row flags.- Returns:
- a getter that returns the flags for each row.
-
getRecordDataGetter
Description copied from interface:TableReader
Retrieve the getter for the RecordData.- Returns:
- a getter that returns the data for the currently read record.
-
getApplicationVersion
public int getApplicationVersion()If there is no application version number, then we return 0, which means to use the most recent listener available. Otherwise, we return the application version number written in the file.- Returns:
- the file's application version
-