Interface IndexCollection

All Superinterfaces:
Iterable<IndexDescriptor>
All Known Implementing Classes:
AbstractIndexCollection, DrillIndexCollection

public interface IndexCollection extends Iterable<IndexDescriptor>
Interface used to describe an index collection
  • Method Details

    • addIndex

      boolean addIndex(IndexDescriptor index)
      Add a new index to the collection. Return True if index was successfully added; False otherwise
    • removeIndex

      boolean removeIndex(IndexDescriptor index)
      Remove an index (identified by table name and index name) from the collection. Return True if index was successfully removed; False otherwise
    • clearAll

      void clearAll()
      Clears all entries from this index collection
    • getIndexCollectionType

      IndexCollection.IndexCollectionType getIndexCollectionType()
      Get the type of this index based on IndexCollection.IndexCollectionType
      Returns:
      one of the values in IndexCollection.IndexCollectionType
    • supportsIndexSelection

      boolean supportsIndexSelection()
      Whether or not this index collection supports index selection (selecting an appropriate index out of multiple candidates). Typically, external index collections such as Elasticsearch already have this capability while native secondary index collection may not have - in such cases, Drill needs to do the index selection.
    • getRows

      double getRows(org.apache.calcite.rex.RexNode indexCondition)
      Get the estimated row count for a single index condition
      Parameters:
      indexCondition - The index condition (e.g index_col1 < 10 AND index_col2 = 'abc')
      Returns:
      The estimated row count
    • supportsRowCountStats

      boolean supportsRowCountStats()
      Whether or not the index supports getting row count statistics
      Returns:
      True if index supports getting row count, False otherwise
    • supportsFullTextSearch

      boolean supportsFullTextSearch()
      Whether or not the index supports full-text search (to allow pushing down such filters)
      Returns:
      True if index supports full-text search, False otherwise
    • getGroupScan

      IndexGroupScan getGroupScan()
      If this IndexCollection exposes a single GroupScan, return the GroupScan instance. For external indexes such as Elasticsearch, we may have a single GroupScan representing all the indexes contained within that collection. On the other hand, for native indexes, each separate index would have its own GroupScan.
      Returns:
      GroupScan for this IndexCollection if available, otherwise null
    • isColumnIndexed

      boolean isColumnIndexed(SchemaPath path)
      Check if the field name is the leading key of any of the indexes in this collection
      Parameters:
      path -
      Returns:
      True if an appropriate index is found, False otherwise