java.lang.Object
org.elasticsearch.core.AbstractRefCounted
org.elasticsearch.common.util.BytesRefArray
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.lucene.util.Accountable,Writeable,RefCounted,Releasable
public final class BytesRefArray
extends AbstractRefCounted
implements org.apache.lucene.util.Accountable, Releasable, Writeable
Compact serializable container for ByteRefs
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields inherited from class org.elasticsearch.core.AbstractRefCounted
ALREADY_CLOSED_MESSAGE, INVALID_DECREF_MESSAGEFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLEFields inherited from interface org.elasticsearch.core.RefCounted
ALWAYS_REFERENCED -
Constructor Summary
ConstructorsConstructorDescriptionBytesRefArray(long capacity, BigArrays bigArrays) BytesRefArray(StreamInput in, BigArrays bigArrays) BytesRefArray(LongArray startOffsets, ByteArray bytes, long size, BigArrays bigArrays) -
Method Summary
Modifier and TypeMethodDescriptionvoidappend(org.apache.lucene.util.BytesRef key) longMemory used by theBigArraysportion of thisBytesRefArray.voidclose()protected voidorg.apache.lucene.util.BytesRefget(long id, org.apache.lucene.util.BytesRef dest) Return the key at0 <= index <= capacity().longlongsize()voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.core.AbstractRefCounted
alreadyClosed, decRef, hasReferences, incRef, mustIncRef, of, refCount, touch, tryIncRefMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Constructor Details
-
BytesRefArray
-
BytesRefArray
- Throws:
IOException
-
BytesRefArray
-
-
Method Details
-
append
public void append(org.apache.lucene.util.BytesRef key) -
get
public org.apache.lucene.util.BytesRef get(long id, org.apache.lucene.util.BytesRef dest) Return the key at0 <= index <= capacity(). The result is undefined if the slot is unused.Beware that the content of the
BytesRefmay become invalid as soon asclose()is called -
size
public long size() -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceReleasable
-
closeInternal
protected void closeInternal()- Specified by:
closeInternalin classAbstractRefCounted
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
ramBytesUsed
public long ramBytesUsed()- Specified by:
ramBytesUsedin interfaceorg.apache.lucene.util.Accountable
-
bigArraysRamBytesUsed
public long bigArraysRamBytesUsed()Memory used by theBigArraysportion of thisBytesRefArray.
-