Class ReferenceCountedIndexedTableProvider

java.lang.Object
org.apache.druid.segment.ReferenceCountingCloseableObject<IndexedTable>
org.apache.druid.segment.join.table.ReferenceCountedIndexedTableProvider
All Implemented Interfaces:
Closeable, AutoCloseable, IndexedTable, ReferenceCountedObjectProvider<Closeable>

public class ReferenceCountedIndexedTableProvider extends ReferenceCountingCloseableObject<IndexedTable> implements IndexedTable
  • Constructor Details

    • ReferenceCountedIndexedTableProvider

      public ReferenceCountedIndexedTableProvider(IndexedTable indexedTable)
  • Method Details

    • version

      public String version()
      Description copied from interface: IndexedTable
      Returns the version of this table, used to compare against when loading a new version of the table
      Specified by:
      version in interface IndexedTable
    • keyColumns

      public Set<String> keyColumns()
      Description copied from interface: IndexedTable
      Returns the columns of this table that have indexes.
      Specified by:
      keyColumns in interface IndexedTable
    • rowSignature

      public RowSignature rowSignature()
      Description copied from interface: IndexedTable
      Returns the signature of this table, which includes all key columns (as well as other columns that can be selected, but are not keys).
      Specified by:
      rowSignature in interface IndexedTable
    • numRows

      public int numRows()
      Description copied from interface: IndexedTable
      Returns the number of rows in this table. It must not change over time, since it is used for things like algorithm selection and reporting of cardinality metadata.
      Specified by:
      numRows in interface IndexedTable
    • columnIndex

      public IndexedTable.Index columnIndex(int column)
      Description copied from interface: IndexedTable
      Returns the index for a particular column. The provided column number must be that column's position in IndexedTable.rowSignature().
      Specified by:
      columnIndex in interface IndexedTable
    • columnReader

      public IndexedTable.Reader columnReader(int column)
      Description copied from interface: IndexedTable
      Returns a reader for a particular column. The provided column number must be that column's position in IndexedTable.rowSignature(). Don't forget to close your IndexedTable.Reader when finished reading, to clean up any resources.
      Specified by:
      columnReader in interface IndexedTable
    • acquireReference

      public Optional<Closeable> acquireReference()
      Description copied from interface: ReferenceCountedObjectProvider
      This method increments a reference count and provides a Closeable that decrements the reference count when closed. The object returned by this method may or may not be thread-safe, it is best to check with the implementation.

      IMPORTANT NOTE: to fulfill the contract of this method, implementors must return a closeable to indicate that the reference can be acquired, even if there is nothing to close. Implementors should ideally avoid allowing this method to throw exceptions, but callers are responsible for closing the returned object should any operations on it throw exceptions.

      For callers: if this method returns non-empty, IT MUST BE CLOSED, else reference counts can potentially leak.

      Specified by:
      acquireReference in interface ReferenceCountedObjectProvider<Closeable>
    • computeCacheKey

      public byte[] computeCacheKey()
      Description copied from interface: IndexedTable
      Computes a byte[] key for the table that can be used for computing cache keys for join operations. see JoinableFactory.computeJoinCacheKey(org.apache.druid.query.DataSource, org.apache.druid.segment.join.JoinConditionAnalysis)
      Specified by:
      computeCacheKey in interface IndexedTable
      Returns:
      the byte array for cache key
    • isCacheable

      public boolean isCacheable()
      Description copied from interface: IndexedTable
      Returns whether this indexed table can be cached for the join operations
      Specified by:
      isCacheable in interface IndexedTable