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:
AutoCloseable,SharedCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intIn a perfect world, MAX_SEGMENT_SIZE would be final, but we need to test with a smaller size -
Method Summary
Modifier and TypeMethodDescriptionvoidstatic MmappedRegionsempty(ChannelProxy channel) booleanextend(long length, int chunkSize) Extends this collection of mmapped regions up to the provided total length.booleanextend(CompressionMetadata compressionMetadata, int chunkSize) Extends this collection of mmapped regions up to the length of the compressed file described by the provided metadata.floor(long position) booleanisEmpty()booleanisValid(ChannelProxy channel) static MmappedRegionsmap(ChannelProxy channel, long length, int chunkSize) static MmappedRegionsmap(ChannelProxy channel, CompressionMetadata metadata) Methods inherited from class org.apache.cassandra.utils.concurrent.SharedCloseableImpl
addTo, close, close, isCleanedUp
-
Field Details
-
MAX_SEGMENT_SIZE
public static int MAX_SEGMENT_SIZEIn a perfect world, MAX_SEGMENT_SIZE would be final, but we need to test with a smaller size
-
-
Method Details
-
empty
-
map
- Parameters:
channel- file to map. the MmappedRegions instance will hold shared copy of given channel.metadata-- Returns:
- new instance
-
map
-
extend
public boolean extend(long length, int chunkSize) Extends this collection of mmapped regions up to the provided total length.- Returns:
trueif new regions have been created
-
extend
Extends this collection of mmapped regions up to the length of the compressed file described by the provided metadata.- Returns:
trueif new regions have been created
-
isValid
-
isEmpty
public boolean isEmpty() -
floor
-
closeQuietly
public void closeQuietly()
-