public class HsFileDataIndexSpilledRegionManagerImpl extends Object implements HsFileDataIndexSpilledRegionManager
HsFileDataIndexSpilledRegionManager. This manager will handle
and spill regions in the following way:
The relationships between index file and segment are shown below.
- - - - - - - - - Index File - - — - - - - - - - - -
| |
| - - — -Segment1 - - - - - - - - Segment2- - - - |
||SP1 R1||SP1 R2| Free | |SP2 R3| SP2 R1| SP2 R2 | |
| - - - - - - - - - - - - - - - - - - - - - - - - |
| |
| - - - - - - - -Segment3 - - - - - - - |
|| Big Region | |
| - - - - - - - - - - - - - - - - - - - |
- - - - - - - - - - - - - - - - - - - - - -- - - - -
| 限定符和类型 | 类和说明 |
|---|---|
static class |
HsFileDataIndexSpilledRegionManagerImpl.Factory
Factory of
HsFileDataIndexSpilledRegionManager. |
| 构造器和说明 |
|---|
HsFileDataIndexSpilledRegionManagerImpl(int numSubpartitions,
Path indexFilePath,
int segmentSizeInBytes,
long maxCacheCapacity,
java.util.function.BiConsumer<Integer,org.apache.flink.runtime.io.network.partition.hybrid.HsFileDataIndexImpl.InternalRegion> cacheRegionConsumer) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
appendOrOverwriteRegion(int subpartition,
org.apache.flink.runtime.io.network.partition.hybrid.HsFileDataIndexImpl.InternalRegion newRegion)
Write this region to index file.
|
void |
close()
Close this spilled region manager.
|
long |
findRegion(int subpartition,
int bufferIndex,
boolean loadToCache)
Find the region contains target bufferIndex and belong to target subpartition.
|
public HsFileDataIndexSpilledRegionManagerImpl(int numSubpartitions,
Path indexFilePath,
int segmentSizeInBytes,
long maxCacheCapacity,
java.util.function.BiConsumer<Integer,org.apache.flink.runtime.io.network.partition.hybrid.HsFileDataIndexImpl.InternalRegion> cacheRegionConsumer)
public long findRegion(int subpartition,
int bufferIndex,
boolean loadToCache)
HsFileDataIndexSpilledRegionManagerfindRegion 在接口中 HsFileDataIndexSpilledRegionManagersubpartition - the subpartition id that target region belong to.bufferIndex - the buffer index that target region contains.loadToCache - whether to load the found region into the cache.public void appendOrOverwriteRegion(int subpartition,
org.apache.flink.runtime.io.network.partition.hybrid.HsFileDataIndexImpl.InternalRegion newRegion)
throws IOException
HsFileDataIndexSpilledRegionManagerappendOrOverwriteRegion 在接口中 HsFileDataIndexSpilledRegionManagersubpartition - the subpartition id of this region.newRegion - the region to be spilled to index file.IOExceptionpublic void close()
throws IOException
HsFileDataIndexSpilledRegionManagerclose 在接口中 AutoCloseableclose 在接口中 HsFileDataIndexSpilledRegionManagerIOExceptionCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.