BytesRefHash
BytesRefHash is a special purpose hash-map like data-structure optimized for [ ] instances. BytesRefHash maintains mappings of byte arrays to ids (Map
Note: The maximum capacity BytesRef instance passed to .add must not be longer than ByteBlockPool.BYTE_BLOCK_SIZE-2. The internal storage is limited to 2GB total byte storage.
Constructors
Creates a new BytesRefHash with a ByteBlockPool using a [ ].
Types
Manages allocation of the per-term addresses.
A simple BytesStartArray that tracks memory allocation using a private Counter instance.
Thrown if a BytesRef exceeds the BytesRefHash limit of -2.
Properties
Functions
Adds a "arbitrary" int offset instead of a BytesRef term. This is used in the indexer to hold the hash for term vectors, because they do not redundantly store the byte[] term directly and instead reference the byte[] term already stored by the postings BytesRefHash. See add(int textStart) in TermsHashPerField.
Returns the bytesStart offset into the internally used ByteBlockPool for the given bytesID
Return the memory usage of this object in bytes. Negative values are illegal.
reinitializes the BytesRefHash after a previous .clear call. If .clear has not been called previously this method has no effect.
Returns the number of BytesRef values in this BytesRefHash.