Interface HsFileDataIndex
-
- All Known Implementing Classes:
HsFileDataIndexImpl
public interface HsFileDataIndexIndex of spilled data. For each spilled data buffer, this maintains the subpartition it belongs to, the buffer index within the subpartition, the offset in file it begin with, and its readability.Note: Buffers added to this index should not be read until being explicitly marked READABLE.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classHsFileDataIndex.ReadableRegionRepresents a series of physically continuous buffers in the file, which are readable, from the same subpartition, and has sequential buffer index.static classHsFileDataIndex.SpilledBufferRepresents a spilled buffer.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddBuffers(List<HsFileDataIndex.SpilledBuffer> spilledBuffers)Add buffers to the index.voidclose()Close this file data index.Optional<HsFileDataIndex.ReadableRegion>getReadableRegion(int subpartitionId, int bufferIndex, int consumingOffset)Get aHsFileDataIndex.ReadableRegionfor the given subpartition that starts with the given buffer index, if existed.voidmarkBufferReleased(int subpartitionId, int bufferIndex)Mark a buffer as RELEASED.
-
-
-
Method Detail
-
getReadableRegion
Optional<HsFileDataIndex.ReadableRegion> getReadableRegion(int subpartitionId, int bufferIndex, int consumingOffset)
Get aHsFileDataIndex.ReadableRegionfor 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.
- Parameters:
subpartitionId- that the readable region belongs tobufferIndex- that the readable region starts withconsumingOffset- of the downstream- Returns:
- a
HsFileDataIndex.ReadableRegionfor the given subpartition that starts with the given buffer index, if exist; otherwise,Optional.empty().
-
addBuffers
void addBuffers(List<HsFileDataIndex.SpilledBuffer> spilledBuffers)
Add buffers to the index.Attention: this method only called by spilling thread.
- Parameters:
spilledBuffers- to be added. The buffers in the list are expected in the same order as in the spilled file.
-
markBufferReleased
void markBufferReleased(int subpartitionId, int bufferIndex)Mark a buffer as RELEASED.- Parameters:
subpartitionId- that the buffer belongs tobufferIndex- of the buffer within the subpartition
-
close
void close()
Close this file data index.
-
-