@ThreadSafe public class HsFileDataIndexImpl extends Object implements HsFileDataIndex
HsFileDataIndex.| Modifier and Type | Class and Description |
|---|---|
static class |
HsFileDataIndexImpl.HsFileDataIndexRegionHelper
The implementation of
FileDataIndexRegionHelper to writing a region to the file or
reading a region from the file. |
static class |
HsFileDataIndexImpl.InternalRegion
A
HsFileDataIndexImpl.InternalRegion is an implementation of FileDataIndexRegionHelper.Region. |
HsFileDataIndex.ReadableRegion, HsFileDataIndex.SpilledBuffer| Constructor and Description |
|---|
HsFileDataIndexImpl(int numSubpartitions,
Path indexFilePath,
int regionGroupSizeInBytes,
long numRetainedInMemoryRegionsMax) |
| Modifier and Type | Method and Description |
|---|---|
void |
addBuffers(List<HsFileDataIndex.SpilledBuffer> spilledBuffers)
Add buffers to the index.
|
void |
close()
Close this file data index.
|
Optional<HsFileDataIndex.ReadableRegion> |
getReadableRegion(int subpartitionId,
int bufferIndex,
int consumingOffset)
Get a
HsFileDataIndex.ReadableRegion for the given subpartition that starts with the given buffer
index, if existed. |
void |
markBufferReleased(int subpartitionId,
int bufferIndex)
Mark a buffer as RELEASED.
|
public HsFileDataIndexImpl(int numSubpartitions,
Path indexFilePath,
int regionGroupSizeInBytes,
long numRetainedInMemoryRegionsMax)
public void close()
HsFileDataIndexclose in interface HsFileDataIndexpublic Optional<HsFileDataIndex.ReadableRegion> getReadableRegion(int subpartitionId, int bufferIndex, int consumingOffset)
HsFileDataIndexHsFileDataIndex.ReadableRegion for the given subpartition that starts with the given buffer
index, if existed.
Note: Depending on the implementation, this method does not guarantee to always return the longest possible readable region.
getReadableRegion in interface HsFileDataIndexsubpartitionId - that the readable region belongs tobufferIndex - that the readable region starts withconsumingOffset - of the downstreamHsFileDataIndex.ReadableRegion for the given subpartition that starts with the given buffer
index, if exist; otherwise, Optional.empty().public void addBuffers(List<HsFileDataIndex.SpilledBuffer> spilledBuffers)
HsFileDataIndexAttention: this method only called by spilling thread.
addBuffers in interface HsFileDataIndexspilledBuffers - to be added. The buffers in the list are expected in the same order as
in the spilled file.public void markBufferReleased(int subpartitionId,
int bufferIndex)
HsFileDataIndexmarkBufferReleased in interface HsFileDataIndexsubpartitionId - that the buffer belongs tobufferIndex - of the buffer within the subpartitionCopyright © 2014–2025 The Apache Software Foundation. All rights reserved.