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.
  • Method Details

    • appendOrOverwriteRegion

      void appendOrOverwriteRegion(int subpartition, T region) throws IOException
      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

      void close() throws IOException
      Close this spilled region manager.
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException