Interface IndexCache


  • public interface IndexCache
    A cache for caching indexes(including: ColumnIndex, OffsetIndex and BloomFilter)
    • Method Detail

      • create

        static IndexCache create​(ParquetFileReader fileReader,
                                 Set<ColumnPath> columns,
                                 IndexCache.CacheStrategy cacheStrategy,
                                 boolean freeCacheAfterGet)
        Create an index cache for the given file reader
        Parameters:
        fileReader - the file reader
        columns - the columns that need to do cache
        cacheStrategy - the cache strategy, supports NONE and PREFETCH_BLOCK
        freeCacheAfterGet - whether free the given index cache after calling the given get method
        Returns:
        the index cache
      • getColumnIndex

        ColumnIndex getColumnIndex​(ColumnChunkMetaData chunk)
                            throws IOException
        Get the ColumnIndex for the given column in the set row group.
        Parameters:
        chunk - the given column chunk
        Returns:
        the ColumnIndex for the given column
        Throws:
        IOException - if any I/O error occurs during get the ColumnIndex
      • getOffsetIndex

        OffsetIndex getOffsetIndex​(ColumnChunkMetaData chunk)
                            throws IOException
        Get the OffsetIndex for the given column in the set row group.
        Parameters:
        chunk - the given column chunk
        Returns:
        the OffsetIndex for the given column
        Throws:
        IOException - if any I/O error occurs during get the OffsetIndex
      • getBloomFilter

        BloomFilter getBloomFilter​(ColumnChunkMetaData chunk)
                            throws IOException
        Get the BloomFilter for the given column in the set row group.
        Parameters:
        chunk - the given column chunk
        Returns:
        the BloomFilter for the given column
        Throws:
        IOException - if any I/O error occurs during get the BloomFilter
      • clean

        void clean()
        Clean the cache