public static class HsFileDataIndexImpl.HsFileDataIndexRegionHelper extends Object implements FileDataIndexRegionHelper<HsFileDataIndexImpl.InternalRegion>
FileDataIndexRegionHelper
to 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.
FileDataIndexRegionHelper.Region
Modifier and Type | Field and Description |
---|---|
static HsFileDataIndexImpl.HsFileDataIndexRegionHelper |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
HsFileDataIndexImpl.InternalRegion |
readRegionFromFile(FileChannel channel,
long fileOffset)
Read a region from the file.
|
void |
writeRegionToFile(FileChannel channel,
HsFileDataIndexImpl.InternalRegion region)
Write the region to the file.
|
public static final HsFileDataIndexImpl.HsFileDataIndexRegionHelper INSTANCE
public void writeRegionToFile(FileChannel channel, HsFileDataIndexImpl.InternalRegion region) throws IOException
FileDataIndexRegionHelper
writeRegionToFile
in interface FileDataIndexRegionHelper<HsFileDataIndexImpl.InternalRegion>
channel
- the file channel to write the regionregion
- the region to be written to the fileIOException
public HsFileDataIndexImpl.InternalRegion readRegionFromFile(FileChannel channel, long fileOffset) throws IOException
FileDataIndexRegionHelper
readRegionFromFile
in interface FileDataIndexRegionHelper<HsFileDataIndexImpl.InternalRegion>
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 regionIOException
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.