Package 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 Modifier and Type Class Description static class
MmappedRegions.Region
static class
MmappedRegions.Tidier
-
Field Summary
Fields Modifier and Type Field Description 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 Modifier and Type Method Description void
closeQuietly()
static MmappedRegions
empty(ChannelProxy channel)
boolean
extend(long length)
Extends this collection of mmapped regions up to the provided total length.boolean
extend(CompressionMetadata compressionMetadata)
Extends this collection of mmapped regions up to the length of the compressed file described by the provided metadata.MmappedRegions.Region
floor(long position)
boolean
isEmpty()
boolean
isValid(ChannelProxy channel)
static MmappedRegions
map(ChannelProxy channel, long length)
static MmappedRegions
map(ChannelProxy channel, CompressionMetadata metadata)
MmappedRegions
sharedCopy()
-
Methods inherited from class org.apache.cassandra.utils.concurrent.SharedCloseableImpl
addTo, close, close, isCleanedUp
-
-
-
-
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 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()
-
floor
public MmappedRegions.Region floor(long position)
-
closeQuietly
public void closeQuietly()
-
-