Package org.apache.cassandra.io.util
Class SafeMemory
- java.lang.Object
-
- org.apache.cassandra.io.util.Memory
-
- org.apache.cassandra.io.util.SafeMemory
-
- All Implemented Interfaces:
java.lang.AutoCloseable,ReadableMemory,SharedCloseable
public class SafeMemory extends Memory implements SharedCloseable
-
-
Field Summary
-
Fields inherited from class org.apache.cassandra.io.util.Memory
NO_BYTE_BUFFERS, peer, size
-
-
Constructor Summary
Constructors Constructor Description SafeMemory(long size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTo(Ref.IdentityCollection identities)protected voidcheckBounds(long start, long end)voidclose()java.lang.Throwableclose(java.lang.Throwable accumulate)SafeMemorycopy(long newSize)voidfree()SafeMemorysharedCopy()
-
-
-
Method Detail
-
sharedCopy
public SafeMemory sharedCopy()
- Specified by:
sharedCopyin interfaceSharedCloseable- Returns:
- a new instance of the object representing the same state and backed by the same underlying resources. Coordinates with the original (and other instances) when the underlying resource should be closed. Throws an exception if the shared resource has already been closed.
-
close
public void close()
-
close
public java.lang.Throwable close(java.lang.Throwable accumulate)
- Specified by:
closein interfaceSharedCloseable
-
copy
public SafeMemory copy(long newSize)
-
checkBounds
@Inline protected void checkBounds(long start, long end)- Overrides:
checkBoundsin classMemory
-
addTo
public void addTo(Ref.IdentityCollection identities)
- Specified by:
addToin interfaceSharedCloseable
-
-