java.lang.Object
org.apache.drill.exec.physical.resultSet.model.ReaderIndex
All Implemented Interfaces:
ColumnReaderIndex
Direct Known Subclasses:
DirectRowIndex, HyperRowIndex, IndirectRowIndex

public abstract class ReaderIndex extends Object implements ColumnReaderIndex
Row set index base class used when indexing rows within a row set for a row set reader. Keeps track of the current position, which starts before the first row, meaning that the client must call next() to advance to the first row.
  • Field Details

    • position

      protected int position
    • rowCount

      protected final Supplier<Integer> rowCount
  • Constructor Details

  • Method Details

    • set

      public void set(int index)
    • logicalIndex

      public int logicalIndex()
      Description copied from interface: ColumnReaderIndex
      Ordinal index within the batch or array. Increments from -1. (The position before the first item.) Identifies the logical row number of top-level records, or the array element for arrays. Actual physical index may be different if an indirection layer is in use.
      Specified by:
      logicalIndex in interface ColumnReaderIndex
      Returns:
      logical read index
    • size

      public int size()
      Description copied from interface: ColumnReaderIndex
      Return the number of items that this index indexes: top-level record count for the root index; total element count for nested arrays.
      Specified by:
      size in interface ColumnReaderIndex
      Returns:
      element count at this index level
    • next

      public boolean next()
      Description copied from interface: ColumnReaderIndex
      Advances the index to the next position. Used:
      • At the top level for normal readers or
      • <liAt a nested level for implicit join readers, and
      • An each array level to iterate over arrays.
      Specified by:
      next in interface ColumnReaderIndex
      Returns:
      true if another value is available, false if EOF
    • hasNext

      public boolean hasNext()
      Description copied from interface: ColumnReaderIndex
      Reports if the index has another item.
      Specified by:
      hasNext in interface ColumnReaderIndex
      Returns:
      if more rows remain. That is, if a call to ColumnReaderIndex.next() would return true.