Package org.apache.lucene.util.packed
Class PackedLongValues.Builder
- java.lang.Object
-
- org.apache.lucene.util.packed.PackedLongValues.Builder
-
- All Implemented Interfaces:
Accountable
- Direct Known Subclasses:
DeltaPackedLongValues.Builder
- Enclosing class:
- PackedLongValues
public static class PackedLongValues.Builder extends java.lang.Object implements Accountable
A Builder for aPackedLongValues
instance.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) float
acceptableOverheadRatio
private static long
BASE_RAM_BYTES_USED
private static int
INITIAL_PAGE_COUNT
(package private) int
pageMask
(package private) int
pageShift
(package private) long[]
pending
(package private) int
pendingOff
(package private) long
ramBytesUsed
(package private) long
size
(package private) PackedInts.Reader[]
values
(package private) int
valuesOff
-
Constructor Summary
Constructors Constructor Description Builder(int pageSize, float acceptableOverheadRatio)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PackedLongValues.Builder
add(long l)
Add a new element to this builder.(package private) long
baseRamBytesUsed()
PackedLongValues
build()
Build aPackedLongValues
instance that contains values that have been added to this builder.(package private) void
finish()
(package private) void
grow(int newBlockCount)
private void
pack()
(package private) void
pack(long[] values, int numValues, int block, float acceptableOverheadRatio)
long
ramBytesUsed()
Return the memory usage of this object in bytes.long
size()
Return the number of elements that have been added to this builder.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
-
-
-
Field Detail
-
INITIAL_PAGE_COUNT
private static final int INITIAL_PAGE_COUNT
- See Also:
- Constant Field Values
-
BASE_RAM_BYTES_USED
private static final long BASE_RAM_BYTES_USED
-
pageShift
final int pageShift
-
pageMask
final int pageMask
-
acceptableOverheadRatio
final float acceptableOverheadRatio
-
pending
long[] pending
-
size
long size
-
values
PackedInts.Reader[] values
-
ramBytesUsed
long ramBytesUsed
-
valuesOff
int valuesOff
-
pendingOff
int pendingOff
-
-
Method Detail
-
build
public PackedLongValues build()
Build aPackedLongValues
instance that contains values that have been added to this builder. This operation is destructive.
-
baseRamBytesUsed
long baseRamBytesUsed()
-
ramBytesUsed
public final long ramBytesUsed()
Description copied from interface:Accountable
Return the memory usage of this object in bytes. Negative values are illegal.- Specified by:
ramBytesUsed
in interfaceAccountable
-
size
public final long size()
Return the number of elements that have been added to this builder.
-
add
public PackedLongValues.Builder add(long l)
Add a new element to this builder.
-
finish
final void finish()
-
pack
private void pack()
-
pack
void pack(long[] values, int numValues, int block, float acceptableOverheadRatio)
-
grow
void grow(int newBlockCount)
-
-