Class MmappedRegions

All Implemented Interfaces:
AutoCloseable, SharedCloseable

public class MmappedRegions extends SharedCloseableImpl
  • Field Details

    • MAX_SEGMENT_SIZE

      public static int MAX_SEGMENT_SIZE
      In a perfect world, MAX_SEGMENT_SIZE would be final, but we need to test with a smaller size
  • Method Details

    • empty

      public static MmappedRegions empty(ChannelProxy channel)
    • map

      public static MmappedRegions map(ChannelProxy channel, CompressionMetadata metadata)
      Parameters:
      channel - file to map. the MmappedRegions instance will hold shared copy of given channel.
      metadata -
      Returns:
      new instance
    • map

      public static MmappedRegions map(ChannelProxy channel, long length, int chunkSize)
    • sharedCopy

      public MmappedRegions sharedCopy()
      Returns:
      a snapshot of the memory mapped regions. The snapshot can only use existing regions, it cannot create new ones.
    • extend

      public boolean extend(long length, int chunkSize)
      Extends this collection of mmapped regions up to the provided total length.
      Returns:
      true if new regions have been created
    • extend

      public boolean extend(CompressionMetadata compressionMetadata, int chunkSize)
      Extends this collection of mmapped regions up to the length of the compressed file described by the provided metadata.
      Returns:
      true if new regions have been created
    • isValid

      public boolean isValid(ChannelProxy channel)
    • isEmpty

      public boolean isEmpty()
    • floor

      public MmappedRegions.Region floor(long position)
    • closeQuietly

      public void closeQuietly()