Package org.elasticsearch.nio
Class Page
java.lang.Object
org.elasticsearch.nio.Page
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,org.elasticsearch.common.lease.Releasable
public class Page
extends java.lang.Object
implements org.elasticsearch.common.lease.Releasable
-
Constructor Summary
Constructors Constructor Description Page(java.nio.ByteBuffer byteBuffer, org.elasticsearch.common.lease.Releasable closeable) -
Method Summary
Modifier and Type Method Description java.nio.ByteBufferbyteBuffer()Returns theByteBufferfor this page.voidclose()Pageduplicate()Duplicates this page and increments the reference count.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Page
public Page(java.nio.ByteBuffer byteBuffer, org.elasticsearch.common.lease.Releasable closeable)
-
-
Method Details
-
duplicate
Duplicates this page and increments the reference count. The new page must be closed independently of the original page.- Returns:
- the new page
-
byteBuffer
public java.nio.ByteBuffer byteBuffer()Returns theByteBufferfor this page. Modifications to the limits, positions, etc of the buffer will also mutate this page. CallByteBuffer.duplicate()to avoid mutating the page.- Returns:
- the byte buffer
-
close
public void close()- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceorg.elasticsearch.common.lease.Releasable
-