Class MockBytesRefRecycler

java.lang.Object
org.elasticsearch.common.io.stream.MockBytesRefRecycler
All Implemented Interfaces:
Closeable, AutoCloseable, Recycler<org.apache.lucene.util.BytesRef>, org.elasticsearch.core.Releasable

public class MockBytesRefRecycler extends Object implements Recycler<org.apache.lucene.util.BytesRef>, org.elasticsearch.core.Releasable
A Recycler for BytesRef pages which returns pages with nontrivial offsets and verifies that the surrounding buffer pool is left untouched.
  • Constructor Details

    • MockBytesRefRecycler

      public MockBytesRefRecycler()
  • Method Details

    • obtain

      public Recycler.V<org.apache.lucene.util.BytesRef> obtain()
      Specified by:
      obtain in interface Recycler<org.apache.lucene.util.BytesRef>
    • pageSize

      public int pageSize()
      Specified by:
      pageSize in interface Recycler<org.apache.lucene.util.BytesRef>
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface org.elasticsearch.core.Releasable
    • onClose

      protected void onClose(org.apache.lucene.util.BytesRef bytesRef)
    • activePageCount

      public int activePageCount()
      Returns:
      number of currently-active pages