Interface TableReader

All Known Subinterfaces:
BinaryStoreBufferProcessor, SkipableTableReader
All Known Implementing Classes:
AbstractBinaryStoreReader, AbstractBinaryStoreReaderV1, AbstractBinaryStoreReaderV2, BinaryStoreBufferProcessorV1, BinaryStoreBufferProcessorV2, BinaryStoreReaderV1, BinaryStoreReaderV2, BinaryStoreSocketReaderV2, DelegatingBinaryStoreV2BufferProcessor, StreamTableReader, SwitchBinaryStoreReader

public interface TableReader
Row-oriented table reading interface.
  • Method Details

    • getGetter

      RowGetter getGetter​(String name)
      Return a raw RowGetter for the column with the given name. RowGetter.get() will return Object.
      Parameters:
      name - the column name
      Returns:
      a RowGetter
    • getGetter

      <T> RowGetter<T> getGetter​(String name, Class<T> tClass)
      Return a typed RowGetter for the column with the given name. RowGetter.get() will return type tClass.
      Parameters:
      name - the column name
      Returns:
      a RowGetter of type tClass
    • readRow

      @Deprecated boolean readRow() throws IOException
      Deprecated.
      use readEntry() and handle record entries appropriately
      Read a row from the source, expecting that all entries will be Rows. If a record entry is encountered, an IllegalStateException will be thrown.
      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.
      IllegalStateException - if a record entry is encountered.
    • close

      void close() throws IOException
      Close the input source for this TableReader.
      Throws:
      IOException
    • getColumnNames

      String[] getColumnNames()
      Get an array of all known column names. These can be used to determine valid column names for use in getGetter(String).
      Returns:
      a new array of all known column names.
    • getColumnType

      SupportedType getColumnType​(String columnName)
      Get the SupportedType of the named column.
      Parameters:
      columnName - the name of the column
      Returns:
      the SupportedType value for the named column
      Throws:
      RuntimeException - if the columnName is not a valid column
    • getFlagGetter

      RowGetter<Row.Flags> getFlagGetter()
      Retrieve the getter for the row flags.
      Returns:
      a getter that returns the flags for each row.
    • getRecordDataGetter

      default Supplier<RecordData> getRecordDataGetter()
      Retrieve the getter for the RecordData.
      Returns:
      a getter that returns the data for the currently read record.
    • getApplicationVersion

      int getApplicationVersion()
      Get the application version associated with the file being read by this TableReader.
      Returns:
      the file's application version
    • readEntry

      default boolean readEntry() throws IOException
      Read a record from the source, expecting that not all records will be Row records.
      Note: The default implementation delegates to the now-deprecated readRow(), which cannot handle record entries.
      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.
    • readAllEntries

      default void readAllEntries() throws IOException
      Call readEntry() until it returns false. This relies on the Row and Record callbacks.
      Throws:
      IOException
    • readAllEntries

      default void readAllEntries​(Supplier<Boolean> additionalCondition) throws IOException
      Call readEntry() until the additionalCondition evaluates to false, or readEntry() returns false. This relies on the Row and Record callbacks.
      Parameters:
      additionalCondition - an extra condition that might stop the loop.
      Throws:
      IOException
    • getPropertyGetter

      default <T> RowGetter<T> getPropertyGetter​(String property)
      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.
      ImplNote:
      This method is intended for use with instrumentation.