Class ColumnIndexDirectory
- java.lang.Object
-
- org.apache.pinot.segment.spi.store.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 Summary
Constructors Constructor Description ColumnIndexDirectory()
-
Method Summary
Modifier and Type Method Description voidacquireBuffer(FetchContext fetchContext)An instruction to fetch the buffers for columns in the context, in order to operate on the segment.protected StringallocationContext(File f, String context)Allocation context for tracking memoryabstract PinotDataBuffergetBuffer(String column, ColumnIndexType type)Get data buffer of a specified indexType for a columnabstract Set<String>getColumnsWithIndex(ColumnIndexType type)Get the columns with specific index type, loaded by column index directory.PinotDataBuffergetStarTreeIndex()InputStreamgetStarTreeIndexMap()The caller should close the input stream.abstract booleanhasIndexFor(String column, ColumnIndexType type)Check if an index exists for a columnabstract PinotDataBuffernewBuffer(String column, ColumnIndexType type, long sizeBytes)Allocate a new data buffer of specified sizeBytes in the columnar index directoryvoidprefetchBuffer(FetchContext fetchContext)A hint to prefetch the buffers for columns in the context, in preparation for operating on the segment.voidreleaseBuffer(FetchContext fetchContext)An instruction to release the fetched buffers for columns in this context, after operating on this segment.abstract voidremoveIndex(String columnName, ColumnIndexType indexType)Remove the specified indexabstract voidsetSegmentMetadata(SegmentMetadataImpl segmentMetadata)
-
-
-
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 allocatedxcontext- additional context string- Returns:
- formatted string for memory tracking
-
getBuffer
public abstract PinotDataBuffer getBuffer(String column, ColumnIndexType type) throws IOException
Get data buffer of a specified indexType for a column- Parameters:
column- column nametype- index type- Returns:
- ByteBuffer like buffer for data
- Throws:
IOException
-
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 nametype- index typesizeBytes- 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 nametype- 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 nameindexType- 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.
-
getStarTreeIndex
public PinotDataBuffer getStarTreeIndex() throws IOException
- Throws:
IOException
-
getStarTreeIndexMap
public InputStream getStarTreeIndexMap() throws IOException
The caller should close the input stream.- Throws:
IOException
-
-