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.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.recycler.Recycler
Recycler.C<T>, Recycler.Factory<T>, Recycler.V<T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintvoidclose()Recycler.V<org.apache.lucene.util.BytesRef> obtain()protected voidonClose(org.apache.lucene.util.BytesRef bytesRef) intpageSize()
-
Constructor Details
-
MockBytesRefRecycler
public MockBytesRefRecycler()
-
-
Method Details
-
obtain
-
pageSize
public int pageSize() -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.elasticsearch.core.Releasable
-
onClose
protected void onClose(org.apache.lucene.util.BytesRef bytesRef) -
activePageCount
public int activePageCount()- Returns:
- number of currently-active pages
-