Package org.apache.lucene.util
Class BytesRefHash.TrackingDirectBytesStartArray
- java.lang.Object
-
- org.apache.lucene.util.BytesRefHash.BytesStartArray
-
- org.apache.lucene.util.BytesRefHash.TrackingDirectBytesStartArray
-
- Enclosing class:
- BytesRefHash
public static class BytesRefHash.TrackingDirectBytesStartArray extends BytesRefHash.BytesStartArray
A simpleBytesRefHash.BytesStartArraythat tracks all memory allocation using a sharedAtomicLonginstance.
-
-
Field Summary
Fields Modifier and Type Field Description protected AtomicLongbytesUsedprotected intinitSize
-
Constructor Summary
Constructors Constructor Description TrackingDirectBytesStartArray(int initSize, AtomicLong bytesUsed)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AtomicLongbytesUsed()AAtomicLongreference holding the number of bytes used by thisBytesRefHash.BytesStartArray.int[]clear()clears theBytesRefHash.BytesStartArrayand returns the cleared instance.int[]grow()Grows theBytesRefHash.BytesStartArrayint[]init()Initializes the BytesStartArray.
-
-
-
Field Detail
-
initSize
protected final int initSize
-
bytesUsed
protected final AtomicLong bytesUsed
-
-
Constructor Detail
-
TrackingDirectBytesStartArray
public TrackingDirectBytesStartArray(int initSize, AtomicLong bytesUsed)
-
-
Method Detail
-
clear
public int[] clear()
Description copied from class:BytesRefHash.BytesStartArrayclears theBytesRefHash.BytesStartArrayand returns the cleared instance.- Specified by:
clearin classBytesRefHash.BytesStartArray- Returns:
- the cleared instance, this might be
null
-
grow
public int[] grow()
Description copied from class:BytesRefHash.BytesStartArrayGrows theBytesRefHash.BytesStartArray- Specified by:
growin classBytesRefHash.BytesStartArray- Returns:
- the grown array
-
init
public int[] init()
Description copied from class:BytesRefHash.BytesStartArrayInitializes the BytesStartArray. This call will allocate memory- Specified by:
initin classBytesRefHash.BytesStartArray- Returns:
- the initialized bytes start array
-
bytesUsed
public AtomicLong bytesUsed()
Description copied from class:BytesRefHash.BytesStartArrayAAtomicLongreference holding the number of bytes used by thisBytesRefHash.BytesStartArray. TheBytesRefHashuses this reference to track it memory usage- Specified by:
bytesUsedin classBytesRefHash.BytesStartArray- Returns:
- a
AtomicLongreference holding the number of bytes used by thisBytesRefHash.BytesStartArray.
-
-