Package org.apache.parquet.hadoop
Interface IndexCache
public interface IndexCache
A cache for caching indexes(including: ColumnIndex, OffsetIndex and BloomFilter)
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidclean()Clean the cachestatic IndexCachecreate(ParquetFileReader fileReader, Set<org.apache.parquet.hadoop.metadata.ColumnPath> columns, IndexCache.CacheStrategy cacheStrategy, boolean freeCacheAfterGet) Create an index cache for the given file readerorg.apache.parquet.column.values.bloomfilter.BloomFilterGet the BloomFilter for the given column in the set row group.org.apache.parquet.internal.column.columnindex.ColumnIndexGet the ColumnIndex for the given column in the set row group.org.apache.parquet.internal.column.columnindex.OffsetIndexGet the OffsetIndex for the given column in the set row group.voidsetBlockMetadata(BlockMetaData currentBlockMetadata) Set the current BlockMetadata
-
Method Details
-
create
static IndexCache create(ParquetFileReader fileReader, Set<org.apache.parquet.hadoop.metadata.ColumnPath> columns, IndexCache.CacheStrategy cacheStrategy, boolean freeCacheAfterGet) Create an index cache for the given file reader- Parameters:
fileReader- the file readercolumns- the columns that need to do cachecacheStrategy- the cache strategy, supports NONE and PREFETCH_BLOCKfreeCacheAfterGet- whether free the given index cache after calling the given get method- Returns:
- the index cache
-
setBlockMetadata
Set the current BlockMetadata- Throws:
IOException
-
getColumnIndex
org.apache.parquet.internal.column.columnindex.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
org.apache.parquet.internal.column.columnindex.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
org.apache.parquet.column.values.bloomfilter.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
-