Class SwitchBinaryStoreReader

java.lang.Object
com.illumon.iris.binarystore.SwitchBinaryStoreReader
All Implemented Interfaces:
SkipableTableReader, TableReader

public class SwitchBinaryStoreReader extends Object implements SkipableTableReader
Reads the magic number and selects either a V1 or V2 binary store reader as appropriate.
  • Field Details

  • Constructor Details

  • Method Details

    • getGetter

      public RowGetter getGetter(String name)
      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 interface TableReader
      Parameters:
      name - the column name
      Returns:
      a RowGetter
    • getGetter

      public <T> RowGetter<T> getGetter(String name, Class<T> tClass)
      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 interface TableReader
      Parameters:
      name - the column name
      Returns:
      a RowGetter of type tClass
    • readRow

      @Deprecated public boolean readRow() throws IOException
      Deprecated.
      Description copied from interface: TableReader
      Read a row from the source, expecting that all entries will be Rows. If a record entry is encountered, an IllegalStateException will be thrown.
      Specified by:
      readRow in interface TableReader
      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.
    • readEntry

      public boolean readEntry() throws IOException
      Description copied from interface: TableReader
      Read a record from the source, expecting that not all records will be Row records.
      Note: The default implementation delegates to the now-deprecated TableReader.readRow(), which cannot handle record entries.
      Specified by:
      readEntry in interface TableReader
      Returns:
      true if successful, false if EOF or an error is encountered.
      Throws:
      IOException - if EOF is encountered mid-entry or any invalid data is encountered.
    • close

      public void close() throws IOException
      Description copied from interface: TableReader
      Close the input source for this TableReader.
      Specified by:
      close in interface TableReader
      Throws:
      IOException
    • getColumnNames

      public String[] 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 in TableReader.getGetter(String).
      Specified by:
      getColumnNames in interface TableReader
      Returns:
      a new array of all known column names.
    • getColumnType

      public SupportedType getColumnType(String columnName)
      Description copied from interface: TableReader
      Get the SupportedType of the named column.
      Specified by:
      getColumnType in interface TableReader
      Parameters:
      columnName - the name of the column
      Returns:
      the SupportedType value for the named column
    • getFlagGetter

      public RowGetter<Row.Flags> getFlagGetter()
      Description copied from interface: TableReader
      Retrieve the getter for the row flags.
      Specified by:
      getFlagGetter in interface TableReader
      Returns:
      a getter that returns the flags for each row.
    • 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 interface TableReader
      Returns:
      the file's application version
    • getBinaryStoreFormat

      public int getBinaryStoreFormat()
    • skipToRecord

      public void skipToRecord(long recordNo) throws IOException
      Specified by:
      skipToRecord in interface SkipableTableReader
      Throws:
      IOException
    • getSize

      public long getSize() throws IOException
      Specified by:
      getSize in interface SkipableTableReader
      Throws:
      IOException
    • setBlocking

      public void setBlocking(boolean blocking)
      Description copied from interface: SkipableTableReader
      As implemented, blocking means sleep and retry.
      Specified by:
      setBlocking in interface SkipableTableReader
    • getTypeMetadataString

      public String getTypeMetadataString(String columnName)
      Return a string summary of the named column's metadata.
      Parameters:
      columnName - the column to query
      Returns:
      a summary of the metadata, augmented as possible
    • setRecordHandler

      public void setRecordHandler(Runnable handler)
    • setRowHandler

      public void setRowHandler(Runnable handler)
    • getRecordDataGetter

      public Supplier<RecordData> getRecordDataGetter()
      Description copied from interface: TableReader
      Retrieve the getter for the RecordData.
      Specified by:
      getRecordDataGetter in interface TableReader
      Returns:
      a getter that returns the data for the currently read record.