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 ClassesModifier and TypeInterfaceDescriptionstatic interfaceFactory ofFileDataIndexSpilledRegionManager. -
Method Summary
Modifier and TypeMethodDescriptionvoidappendOrOverwriteRegion(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 Details
-
appendOrOverwriteRegion
Write 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
Close this spilled region manager.- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-