Class MmappedRegions

    • Field Detail

      • 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 Detail

      • 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
      • 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)
        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)
        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()
      • closeQuietly

        public void closeQuietly()