Package org.apache.pinot.segment.spi
Interface IndexSegment
-
- All Known Subinterfaces:
ImmutableSegment,MutableSegment
@Private public interface IndexSegment
-
-
Method Summary
Modifier and Type Method Description default voidacquire(FetchContext fetchContext)Instructs the segment to fetch buffers for specified columns.voiddestroy()Destroys segment in memory and closes file handlers if in MMAP mode.Set<String>getColumnNames()Returns all the columns inside the segment.DataSourcegetDataSource(String columnName)Returns theDataSourcefor the given column.Set<String>getPhysicalColumnNames()Returns all of the columns in the segment that are not provided by a virtual column provider.GenericRowgetRecord(int docId, GenericRow reuse)Returns the record for the given document id.SegmentMetadatagetSegmentMetadata()Returns theSegmentMetadataof the segment.StringgetSegmentName()Returns the name of the segment.List<StarTreeV2>getStarTrees()Returns a list of star-trees (V2), or null if there is no star-tree (V2) in the segment.ThreadSafeMutableRoaringBitmapgetValidDocIds()ObjectgetValue(int docId, String column)Returns the value for the column at the document id.default voidprefetch(FetchContext fetchContext)Hints the segment to begin prefetching buffers for specified columns.default voidrelease(FetchContext fetchContext)Instructs the segment to release buffers for specified columns.
-
-
-
Method Detail
-
getSegmentName
String getSegmentName()
Returns the name of the segment.- Returns:
- Segment name
-
getSegmentMetadata
SegmentMetadata getSegmentMetadata()
Returns theSegmentMetadataof the segment.- Returns:
- Segment metadata
-
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 theDataSourcefor 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.
-
getValidDocIds
@Nullable ThreadSafeMutableRoaringBitmap getValidDocIds()
-
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 idreuse- 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.
-
-