Interface IndexSegment

    • Method Detail

      • getSegmentName

        String getSegmentName()
        Returns the name of the segment.
        Returns:
        Segment name
      • getColumnNames

        Set<String> getColumnNames()
        Returns all the columns inside the segment.
        Returns:
        Set of column names
      • getPhysicalColumnNames

        Set<String> getPhysicalColumnNames()
        Returns all of the columns in the segment that are not provided by a virtual column provider.
        Returns:
        Set of column names
      • getDataSource

        DataSource getDataSource​(String columnName)
        Returns the DataSource for the given column.
        Parameters:
        columnName - Column name
        Returns:
        Data source for the given column
      • getStarTrees

        List<StarTreeV2> getStarTrees()
        Returns a list of star-trees (V2), or null if there is no star-tree (V2) in the segment.
      • getRecord

        GenericRow getRecord​(int docId,
                             GenericRow reuse)
        Returns the record for the given document id. Virtual column values are not returned.

        NOTE: don't use this method for high performance code. Use PinotSegmentRecordReader when reading multiple records from the same segment.

        Parameters:
        docId - Document id
        reuse - Reusable buffer for the record
        Returns:
        Record for the given document id
      • getValue

        Object getValue​(int docId,
                        String column)
        Returns the value for the column at the document id. Returns byte[] for BYTES data type.

        NOTE: don't use this method for high performance code. Use PinotSegmentColumnReader when reading multiple values from the same segment.

      • prefetch

        default void prefetch​(FetchContext fetchContext)
        Hints the segment to begin prefetching buffers for specified columns. Typically, this should be an async call made before operating on the segment.
        Parameters:
        fetchContext - context for this segment's fetch
      • acquire

        default void acquire​(FetchContext fetchContext)
        Instructs the segment to fetch buffers for specified columns. When enabled, this should be a blocking call made before operating on the segment.
        Parameters:
        fetchContext - context for this segment's fetch
      • release

        default void release​(FetchContext fetchContext)
        Instructs the segment to release buffers for specified columns. When enabled, this should be a call made after operating on the segment. It is possible that this called multiple times.
        Parameters:
        fetchContext - context for this segment's fetch
      • destroy

        void destroy()
        Destroys segment in memory and closes file handlers if in MMAP mode.