Class BytesRefArray

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
  • Constructor Details

  • 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 at 0 <= index <= capacity(). The result is undefined if the slot is unused.

      Beware that the content of the BytesRef may become invalid as soon as close() is called

    • size

      public long size()
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface Releasable
    • closeInternal

      protected void closeInternal()
      Specified by:
      closeInternal in class AbstractRefCounted
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • ramBytesUsed

      public long ramBytesUsed()
      Specified by:
      ramBytesUsed in interface org.apache.lucene.util.Accountable
    • bigArraysRamBytesUsed

      public long bigArraysRamBytesUsed()
      Memory used by the BigArrays portion of this BytesRefArray.