Class Page

java.lang.Object
org.elasticsearch.nio.Page
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable

public class Page
extends java.lang.Object
implements java.io.Closeable
  • Constructor Summary

    Constructors 
    Constructor Description
    Page​(java.nio.ByteBuffer byteBuffer)  
    Page​(java.nio.ByteBuffer byteBuffer, java.lang.Runnable closeable)  
  • Method Summary

    Modifier and Type Method Description
    java.nio.ByteBuffer byteBuffer()
    Returns the ByteBuffer for this page.
    void close()  
    Page duplicate()
    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)
    • Page

      public Page​(java.nio.ByteBuffer byteBuffer, java.lang.Runnable closeable)
  • Method Details

    • duplicate

      public Page 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 the ByteBuffer for this page. Modifications to the limits, positions, etc of the buffer will also mutate this page. Call ByteBuffer.duplicate() to avoid mutating the page.
      Returns:
      the byte buffer
    • close

      public void close()
      Specified by:
      close in interface java.lang.AutoCloseable
      Specified by:
      close in interface java.io.Closeable