- All Superinterfaces:
org.apache.lucene.util.Accountable,AutoCloseable,Closeable,Releasable
- All Known Implementing Classes:
BytesRefHash
A hash table mapping keys (of type BytesRef) to values to ids, of
primitive long type. The id's start at 0, and increment monotonically
as unique keys are added.
-
Field Summary
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Method Summary
Modifier and TypeMethodDescriptionlongadd(org.apache.lucene.util.BytesRef key) Adds the given key to the table.longfind(org.apache.lucene.util.BytesRef key) Finds the id associated with the given key, or -1 is the key is not contained in the hash.org.apache.lucene.util.BytesRefget(long id, org.apache.lucene.util.BytesRef dest) Gets the key at the given id value.Gets the backing bytes ref array.longsize()Returns the size (number of key/value pairs) in the table.Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources, ramBytesUsedMethods inherited from interface org.elasticsearch.core.Releasable
close
-
Method Details
-
get
org.apache.lucene.util.BytesRef get(long id, org.apache.lucene.util.BytesRef dest) Gets the key at the given id value. -
find
long find(org.apache.lucene.util.BytesRef key) Finds the id associated with the given key, or -1 is the key is not contained in the hash. -
add
long add(org.apache.lucene.util.BytesRef key) Adds the given key to the table. Return its newly allocated id if it wasn't in the table yet, or-1-idif it was already present in the table. -
size
long size()Returns the size (number of key/value pairs) in the table. -
getBytesRefs
BytesRefArray getBytesRefs()Gets the backing bytes ref array.
-