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.
  • Field Details

  • Method Details

    • readHeader

      public void readHeader​(ByteBuffer theBuffer) throws IOException, EofException
      This implementation calls AbstractBinaryStoreReader.readIntoByteBuffer(int, ByteBuffer) and AbstractBinaryStoreReader.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

      public boolean readEntry() throws IOException
      Read data into the internal dataBuffer in order to populate the entire row. This implementation calls AbstractBinaryStoreReader.readIntoByteBuffer(int, ByteBuffer) and AbstractBinaryStoreReader.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 public boolean readRow() throws IOException
      Deprecated.
      use readEntry() and handle record entries appropriately.
      Read data into the internal dataBuffer in order to populate the entire row. This implementation calls AbstractBinaryStoreReader.readIntoByteBuffer(int, ByteBuffer) and AbstractBinaryStoreReader.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

      public <T> RowGetter<T> getPropertyGetter​(String property)
      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

      public RowGetter<Row.Flags> getFlagGetter()
      Description copied from interface: TableReader
      Retrieve the getter for the row flags.
      Returns:
      a getter that returns the flags for each row.
    • getRecordDataGetter

      public Supplier<RecordData> 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