Package org.apache.lucene.util
Class BytesRefHash.DirectBytesStartArray
- java.lang.Object
-
- org.apache.lucene.util.BytesRefHash.BytesStartArray
-
- org.apache.lucene.util.BytesRefHash.DirectBytesStartArray
-
- Enclosing class:
- BytesRefHash
public static class BytesRefHash.DirectBytesStartArray extends BytesRefHash.BytesStartArray
A simpleBytesRefHash.BytesStartArray
that tracks memory allocation using a privateCounter
instance.
-
-
Constructor Summary
Constructors Constructor Description DirectBytesStartArray(int initSize)
DirectBytesStartArray(int initSize, Counter counter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Counter
bytesUsed()
ACounter
reference holding the number of bytes used by thisBytesRefHash.BytesStartArray
.int[]
clear()
clears theBytesRefHash.BytesStartArray
and returns the cleared instance.int[]
grow()
Grows theBytesRefHash.BytesStartArray
int[]
init()
Initializes the BytesStartArray.
-
-
-
Constructor Detail
-
DirectBytesStartArray
public DirectBytesStartArray(int initSize, Counter counter)
-
DirectBytesStartArray
public DirectBytesStartArray(int initSize)
-
-
Method Detail
-
clear
public int[] clear()
Description copied from class:BytesRefHash.BytesStartArray
clears theBytesRefHash.BytesStartArray
and returns the cleared instance.- Specified by:
clear
in classBytesRefHash.BytesStartArray
- Returns:
- the cleared instance, this might be
null
-
grow
public int[] grow()
Description copied from class:BytesRefHash.BytesStartArray
Grows theBytesRefHash.BytesStartArray
- Specified by:
grow
in classBytesRefHash.BytesStartArray
- Returns:
- the grown array
-
init
public int[] init()
Description copied from class:BytesRefHash.BytesStartArray
Initializes the BytesStartArray. This call will allocate memory- Specified by:
init
in classBytesRefHash.BytesStartArray
- Returns:
- the initialized bytes start array
-
bytesUsed
public Counter bytesUsed()
Description copied from class:BytesRefHash.BytesStartArray
ACounter
reference holding the number of bytes used by thisBytesRefHash.BytesStartArray
. TheBytesRefHash
uses this reference to track it memory usage- Specified by:
bytesUsed
in classBytesRefHash.BytesStartArray
- Returns:
- a
AtomicLong
reference holding the number of bytes used by thisBytesRefHash.BytesStartArray
.
-
-