Class ColumnIndexDirectory

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public abstract class ColumnIndexDirectory
    extends Object
    implements Closeable
    Abstract class to map the columnar indices to their buffers
    • Constructor Detail

      • ColumnIndexDirectory

        public ColumnIndexDirectory()
    • Method Detail

      • setSegmentMetadata

        public abstract void setSegmentMetadata​(SegmentMetadataImpl segmentMetadata)
      • allocationContext

        protected String allocationContext​(File f,
                                           String context)
        Allocation context for tracking memory
        Parameters:
        f - file for which memory is allocatedx
        context - additional context string
        Returns:
        formatted string for memory tracking
      • newBuffer

        public abstract PinotDataBuffer newBuffer​(String column,
                                                  ColumnIndexType type,
                                                  long sizeBytes)
                                           throws IOException
        Allocate a new data buffer of specified sizeBytes in the columnar index directory
        Parameters:
        column - column name
        type - index type
        sizeBytes - sizeBytes for the buffer allocation
        Returns:
        ByteBuffer like buffer for data
        Throws:
        IOException
      • hasIndexFor

        public abstract boolean hasIndexFor​(String column,
                                            ColumnIndexType type)
        Check if an index exists for a column
        Parameters:
        column - column name
        type - index type
        Returns:
        true if the index exists; false otherwise
      • removeIndex

        public abstract void removeIndex​(String columnName,
                                         ColumnIndexType indexType)
        Remove the specified index
        Parameters:
        columnName - column name
        indexType - index type
      • getColumnsWithIndex

        public abstract Set<String> getColumnsWithIndex​(ColumnIndexType type)
        Get the columns with specific index type, loaded by column index directory.
        Returns:
        a set of columns with such index type.
      • prefetchBuffer

        public void prefetchBuffer​(FetchContext fetchContext)
        A hint to prefetch the buffers for columns in the context, in preparation for operating on the segment.
      • acquireBuffer

        public void acquireBuffer​(FetchContext fetchContext)
        An instruction to fetch the buffers for columns in the context, in order to operate on the segment.
      • releaseBuffer

        public void releaseBuffer​(FetchContext fetchContext)
        An instruction to release the fetched buffers for columns in this context, after operating on this segment.