org.apache.cassandra.io.util

## Class MmappedRegions

- java.lang.Object
- - org.apache.cassandra.utils.concurrent.SharedCloseableImpl
  - - org.apache.cassandra.io.util.MmappedRegions

All Implemented Interfaces:
  java.lang.AutoCloseable, SharedCloseable

    public class MmappedRegions
    extends SharedCloseableImpl

### Nested Class Summary

Nested Classes
`static class` `MmappedRegions.Region`
`static class` `MmappedRegions.Tidier`

### Field Summary

Fields
`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 Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `closeQuietly()`
`static MmappedRegions` `empty(ChannelProxy channel)`
`void` `extend(long length)`
`MmappedRegions.Region` `floor(long position)`
`boolean` `isEmpty()`
`boolean` `isValid(ChannelProxy channel)`
`static MmappedRegions` `map(ChannelProxy channel, CompressionMetadata metadata)`
`static MmappedRegions` `map(ChannelProxy channel, long length)`
`MmappedRegions` `sharedCopy()`

### Methods inherited from class org.apache.cassandra.utils.concurrent.SharedCloseableImpl

`addTo, close, close, isCleanedUp`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 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

#### 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)

#### 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 void extend(long length)

#### isValid

    public boolean isValid(ChannelProxy channel)

#### isEmpty

    public boolean isEmpty()

#### floor

    public MmappedRegions.Region floor(long position)

#### closeQuietly

    public void closeQuietly()