public class FileDataIndexSpilledRegionManagerImpl<T extends FileDataIndexRegionHelper.Region> extends Object implements FileDataIndexSpilledRegionManager<T>
FileDataIndexSpilledRegionManager. This manager will handle and
spill regions in the following way:
The relationships between index file and region group are shown below.
- - - - - - - - - Index File - - — - - - - - - - - -
| |
| - - — -RegionGroup1 - - - - RegionGroup2- - - - |
||SP1 R1||SP1 R2| Free | |SP2 R3| SP2 R1| SP2 R2 | |
| - - - - - - - - - - - - - - - - - - - - - - - - |
| |
| - - - - - - - -RegionGroup3 - - - - - |
|| Big Region | |
| - - - - - - - - - - - - - - - - - - - |
- - - - - - - - - - - - - - - - - - - - - -- - - - -
| Modifier and Type | Class and Description |
|---|---|
static class |
FileDataIndexSpilledRegionManagerImpl.Factory<T extends FileDataIndexRegionHelper.Region>
Factory of
FileDataIndexSpilledRegionManager. |
| Constructor and Description |
|---|
FileDataIndexSpilledRegionManagerImpl(int numSubpartitions,
Path indexFilePath,
int regionGroupSizeInBytes,
long maxCacheCapacity,
int regionHeaderSize,
BiConsumer<Integer,T> cacheRegionConsumer,
FileDataIndexRegionHelper<T> fileDataIndexRegionHelper) |
| Modifier and Type | Method and Description |
|---|---|
void |
appendOrOverwriteRegion(int subpartition,
T 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 FileDataIndexSpilledRegionManagerImpl(int numSubpartitions,
Path indexFilePath,
int regionGroupSizeInBytes,
long maxCacheCapacity,
int regionHeaderSize,
BiConsumer<Integer,T> cacheRegionConsumer,
FileDataIndexRegionHelper<T> fileDataIndexRegionHelper)
public long findRegion(int subpartition,
int bufferIndex,
boolean loadToCache)
FileDataIndexSpilledRegionManagerfindRegion in interface FileDataIndexSpilledRegionManager<T extends FileDataIndexRegionHelper.Region>subpartition - 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,
T newRegion)
throws IOException
FileDataIndexSpilledRegionManagerappendOrOverwriteRegion in interface FileDataIndexSpilledRegionManager<T extends FileDataIndexRegionHelper.Region>subpartition - the subpartition id of this region.newRegion - the region to be spilled to index file.IOExceptionpublic void close()
throws IOException
FileDataIndexSpilledRegionManagerclose in interface AutoCloseableclose in interface FileDataIndexSpilledRegionManager<T extends FileDataIndexRegionHelper.Region>IOExceptionCopyright © 2014–2025 The Apache Software Foundation. All rights reserved.