Interface FileDataIndexSpilledRegionManager<T extends FileDataIndexRegionHelper.Region>
-
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
FileDataIndexSpilledRegionManagerImpl
public interface FileDataIndexSpilledRegionManager<T extends FileDataIndexRegionHelper.Region> extends AutoCloseable
This class is responsible for spilling region to disk and managing these spilled regions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceFileDataIndexSpilledRegionManager.Factory<T extends FileDataIndexRegionHelper.Region>Factory ofFileDataIndexSpilledRegionManager.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidappendOrOverwriteRegion(int subpartition, T region)Write this region to index file.voidclose()Close this spilled region manager.longfindRegion(int subpartition, int bufferIndex, boolean loadToCache)Find the region contains target bufferIndex and belong to target subpartition.
-
-
-
Method Detail
-
appendOrOverwriteRegion
void appendOrOverwriteRegion(int subpartition, T region) throws IOExceptionWrite this region to index file. If target region already spilled, overwrite it.- Parameters:
subpartition- the subpartition id of this region.region- the region to be spilled to index file.- Throws:
IOException
-
findRegion
long findRegion(int subpartition, int bufferIndex, boolean loadToCache)Find the region contains target bufferIndex and belong to target subpartition.- Parameters:
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.- Returns:
- if target region can be founded, return it's offset in index file. Otherwise, return -1.
-
close
void close() throws IOExceptionClose this spilled region manager.- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
-