@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()
HsFileDataIndex
close
in interface HsFileDataIndex
public Optional<HsFileDataIndex.ReadableRegion> getReadableRegion(int subpartitionId, int bufferIndex, int consumingOffset)
HsFileDataIndex
HsFileDataIndex.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 HsFileDataIndex
subpartitionId
- 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)
HsFileDataIndex
Attention: this method only called by spilling thread.
addBuffers
in interface HsFileDataIndex
spilledBuffers
- 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)
HsFileDataIndex
markBufferReleased
in interface HsFileDataIndex
subpartitionId
- that the buffer belongs tobufferIndex
- of the buffer within the subpartitionCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.