public static class HsFileDataIndexImpl.InternalRegion extends Object implements FileDataIndexRegionHelper.Region
HsFileDataIndexImpl.InternalRegion
is an implementation of FileDataIndexRegionHelper.Region
.
Note that this class introduced a new field to indicate whether each buffer in the region is
released.Modifier and Type | Field and Description |
---|---|
static int |
HEADER_SIZE
HsFileDataIndexImpl.InternalRegion is consists of header and payload. |
Constructor and Description |
---|
InternalRegion(int firstBufferIndex,
long regionFileOffset,
int numBuffers,
boolean[] released) |
Modifier and Type | Method and Description |
---|---|
boolean |
containBuffer(int bufferIndex)
Whether the current region contain the buffer.
|
int |
getFirstBufferIndex()
Get the first buffer index of this region.
|
int |
getNumBuffers()
Get the number of buffers in this region.
|
long |
getRegionEndOffset()
Get the file end offset of the region.
|
long |
getRegionStartOffset()
Get the file start offset of this region.
|
boolean[] |
getReleased() |
int |
getSize()
Get the total size in bytes of this region, including the fields and the buffers.
|
public static final int HEADER_SIZE
HsFileDataIndexImpl.InternalRegion
is consists of header and payload. (firstBufferIndex,
firstBufferOffset, numBuffer) are immutable header part that have fixed size. The array
of released is variable payload. This field represents the size of header.public InternalRegion(int firstBufferIndex, long regionFileOffset, int numBuffers, boolean[] released)
public boolean containBuffer(int bufferIndex)
FileDataIndexRegionHelper.Region
containBuffer
in interface FileDataIndexRegionHelper.Region
bufferIndex
- the specific buffer indexpublic int getSize()
FileDataIndexRegionHelper.Region
getSize
in interface FileDataIndexRegionHelper.Region
public int getFirstBufferIndex()
FileDataIndexRegionHelper.Region
getFirstBufferIndex
in interface FileDataIndexRegionHelper.Region
public long getRegionStartOffset()
FileDataIndexRegionHelper.Region
getRegionStartOffset
in interface FileDataIndexRegionHelper.Region
public long getRegionEndOffset()
FileDataIndexRegionHelper.Region
getRegionEndOffset
in interface FileDataIndexRegionHelper.Region
public int getNumBuffers()
FileDataIndexRegionHelper.Region
getNumBuffers
in interface FileDataIndexRegionHelper.Region
public boolean[] getReleased()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.