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 classMmappedRegions.Regionstatic classMmappedRegions.Tidier
-
Field Summary
Fields Modifier and Type Field Description static intMAX_SEGMENT_SIZEIn 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 voidcloseQuietly()static MmappedRegionsempty(ChannelProxy channel)voidextend(long length)MmappedRegions.Regionfloor(long position)booleanisEmpty()booleanisValid(ChannelProxy channel)static MmappedRegionsmap(ChannelProxy channel, long length)static MmappedRegionsmap(ChannelProxy channel, CompressionMetadata metadata)MmappedRegionssharedCopy()-
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 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()
-
-