Interface FileDataIndexRegionHelper.Region
-
- All Known Implementing Classes:
ProducerMergedPartitionFileIndex.FixedSizeRegion
- Enclosing interface:
- FileDataIndexRegionHelper<T extends FileDataIndexRegionHelper.Region>
public static interface FileDataIndexRegionHelper.RegionAFileDataIndexRegionHelper.RegionRepresents a series of buffers that are:- From the same subpartition
- Logically (i.e. buffer index) consecutive
- Physically (i.e. offset in the file) consecutive
The following example illustrates some physically continuous buffers in a file and regions upon them, where `x-y` denotes buffer from subpartition x with buffer index y, and `()` denotes a region.
(1-1, 1-2), (2-1), (2-2, 2-3), (1-5, 1-6), (1-4)
Note: The file may not contain all the buffers. E.g., 1-3 is missing in the above example.
Note: Buffers in file may have different orders than their buffer index. E.g., 1-4 comes after 1-6 in the above example.
Note: This index may not always maintain the longest possible regions. E.g., 2-1, 2-2, 2-3 are in two separate regions.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancontainBuffer(int bufferIndex)Whether the current region contain the buffer.intgetFirstBufferIndex()Get the first buffer index of this region.intgetNumBuffers()Get the number of buffers in this region.longgetRegionEndOffset()Get the file end offset of the region.longgetRegionStartOffset()Get the file start offset of this region.intgetSize()Get the total size in bytes of this region, including the fields and the buffers.
-
-
-
Method Detail
-
getSize
int getSize()
Get the total size in bytes of this region, including the fields and the buffers.
-
getFirstBufferIndex
int getFirstBufferIndex()
Get the first buffer index of this region.
-
getRegionStartOffset
long getRegionStartOffset()
Get the file start offset of this region.
-
getRegionEndOffset
long getRegionEndOffset()
Get the file end offset of the region.
-
getNumBuffers
int getNumBuffers()
Get the number of buffers in this region.
-
containBuffer
boolean containBuffer(int bufferIndex)
Whether the current region contain the buffer.- Parameters:
bufferIndex- the specific buffer index
-
-