Package org.apache.hadoop.util
Class CleanerUtil
java.lang.Object
org.apache.hadoop.util.CleanerUtil
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 inspired by LUCENE-6989.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacePass in an implementation of this interface to cleanup ByteBuffers. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringifUNMAP_SUPPORTEDisfalse, this contains the reason why unmapping is not supported.static final booleantrue, if this platform supports unmapping mmapped files. -
Method Summary
Modifier and TypeMethodDescriptionstatic CleanerUtil.BufferCleanerReference to a BufferCleaner that does unmapping.
-
Field Details
-
UNMAP_SUPPORTED
public static final boolean UNMAP_SUPPORTEDtrue, if this platform supports unmapping mmapped files. -
UNMAP_NOT_SUPPORTED_REASON
ifUNMAP_SUPPORTEDisfalse, this contains the reason why unmapping is not supported.
-
-
Method Details
-
getCleaner
Reference to a BufferCleaner that does unmapping.- Returns:
nullif not supported.
-