Class CleanerUtil
- java.lang.Object
-
- org.apache.pinot.segment.spi.memory.CleanerUtil
-
public final class CleanerUtil extends Object
sun.misc.Cleaner has moved in OpenJDK 9 and sun.misc.Unsafe#invokeCleaner(ByteBuffer) is the replacement. This class is a hack to use sun.misc.Cleaner in Java 8 and use the replacement in Java 9+. This implementation is shamelessly borrowed from HADOOP-12760.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceCleanerUtil.BufferCleanerPass in an implementation of this interface to cleanup ByteBuffers.
-
Field Summary
Fields Modifier and Type Field Description static StringUNMAP_NOT_SUPPORTED_REASONifUNMAP_SUPPORTEDisfalse, this contains the reason why unmapping is not supported.static booleanUNMAP_SUPPORTEDtrue, if this platform supports unmapping mmapped files.
-
Method Summary
Modifier and Type Method Description static voidcleanQuietly(ByteBuffer buffer)static CleanerUtil.BufferCleanergetCleaner()Reference to a BufferCleaner that does unmapping.
-
-
-
Field Detail
-
UNMAP_SUPPORTED
public static final boolean UNMAP_SUPPORTED
true, if this platform supports unmapping mmapped files.
-
UNMAP_NOT_SUPPORTED_REASON
public static final String UNMAP_NOT_SUPPORTED_REASON
ifUNMAP_SUPPORTEDisfalse, this contains the reason why unmapping is not supported.
-
-
Method Detail
-
getCleaner
public static CleanerUtil.BufferCleaner getCleaner()
Reference to a BufferCleaner that does unmapping.- Returns:
nullif not supported.
-
cleanQuietly
public static void cleanQuietly(ByteBuffer buffer)
-
-