Class HsFileDataIndexImpl.HsFileDataIndexRegionHelper
- java.lang.Object
-
- org.apache.flink.runtime.io.network.partition.hybrid.HsFileDataIndexImpl.HsFileDataIndexRegionHelper
-
- All Implemented Interfaces:
FileDataIndexRegionHelper<HsFileDataIndexImpl.InternalRegion>
- Enclosing class:
- HsFileDataIndexImpl
public static class HsFileDataIndexImpl.HsFileDataIndexRegionHelper extends Object implements FileDataIndexRegionHelper<HsFileDataIndexImpl.InternalRegion>
The implementation ofFileDataIndexRegionHelperto writing a region to the file or reading a region from the file.Note that this type of region's length may be variable because it contains an array to indicate each buffer's release state.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.runtime.io.network.partition.hybrid.index.FileDataIndexRegionHelper
FileDataIndexRegionHelper.Region
-
-
Field Summary
Fields Modifier and Type Field Description static HsFileDataIndexImpl.HsFileDataIndexRegionHelperINSTANCE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HsFileDataIndexImpl.InternalRegionreadRegionFromFile(FileChannel channel, long fileOffset)Read a region from the file.voidwriteRegionToFile(FileChannel channel, HsFileDataIndexImpl.InternalRegion region)Write the region to the file.
-
-
-
Field Detail
-
INSTANCE
public static final HsFileDataIndexImpl.HsFileDataIndexRegionHelper INSTANCE
-
-
Method Detail
-
writeRegionToFile
public void writeRegionToFile(FileChannel channel, HsFileDataIndexImpl.InternalRegion region) throws IOException
Description copied from interface:FileDataIndexRegionHelperWrite the region to the file.- Specified by:
writeRegionToFilein interfaceFileDataIndexRegionHelper<HsFileDataIndexImpl.InternalRegion>- Parameters:
channel- the file channel to write the regionregion- the region to be written to the file- Throws:
IOException
-
readRegionFromFile
public HsFileDataIndexImpl.InternalRegion readRegionFromFile(FileChannel channel, long fileOffset) throws IOException
Description copied from interface:FileDataIndexRegionHelperRead a region from the file.- Specified by:
readRegionFromFilein interfaceFileDataIndexRegionHelper<HsFileDataIndexImpl.InternalRegion>- Parameters:
channel- the file channel to read the regionfileOffset- the current region data is from this file offset, so start reading the file from the offset when reading the region- Returns:
- the region read from the file
- Throws:
IOException
-
-