java.lang.Object
org.apache.lucene.util.LongValues
org.apache.lucene.util.packed.PackedLongValues
- All Implemented Interfaces:
Accountable
- Direct Known Subclasses:
DeltaPackedLongValues
Utility class to compress integers into a
LongValues
instance.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A Builder for aPackedLongValues
instance.final class
An iterator over long values. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
static final int
(package private) static final int
(package private) static final int
(package private) final int
(package private) final int
private final long
private final long
(package private) final PackedInts.Reader[]
Fields inherited from class org.apache.lucene.util.LongValues
IDENTITY, ZEROES
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
Constructor Summary
ConstructorsConstructorDescriptionPackedLongValues
(int pageShift, int pageMask, PackedInts.Reader[] values, long size, long ramBytesUsed) -
Method Summary
Modifier and TypeMethodDescription(package private) int
decodeBlock
(int block, long[] dest) static PackedLongValues.Builder
deltaPackedBuilder
(float acceptableOverheadRatio) static PackedLongValues.Builder
deltaPackedBuilder
(int pageSize, float acceptableOverheadRatio) Return a newPackedLongValues.Builder
that will compress efficiently integers that are close to each other.(package private) long
get
(int block, int element) final long
get
(long index) Get value atindex
.iterator()
Return an iterator over the values of this array.static PackedLongValues.Builder
monotonicBuilder
(float acceptableOverheadRatio) static PackedLongValues.Builder
monotonicBuilder
(int pageSize, float acceptableOverheadRatio) Return a newPackedLongValues.Builder
that will compress efficiently integers that would be a monotonic function of their index.static PackedLongValues.Builder
packedBuilder
(float acceptableOverheadRatio) static PackedLongValues.Builder
packedBuilder
(int pageSize, float acceptableOverheadRatio) Return a newPackedLongValues.Builder
that will compress efficiently positive integers.long
Return the memory usage of this object in bytes.final long
size()
Get the number of values in this array.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 Details
-
BASE_RAM_BYTES_USED
private static final long BASE_RAM_BYTES_USED -
DEFAULT_PAGE_SIZE
public static final int DEFAULT_PAGE_SIZE- See Also:
-
MIN_PAGE_SIZE
static final int MIN_PAGE_SIZE- See Also:
-
MAX_PAGE_SIZE
static final int MAX_PAGE_SIZE- See Also:
-
values
-
pageShift
final int pageShift -
pageMask
final int pageMask -
size
private final long size -
ramBytesUsed
private final long ramBytesUsed
-
-
Constructor Details
-
PackedLongValues
PackedLongValues(int pageShift, int pageMask, PackedInts.Reader[] values, long size, long ramBytesUsed)
-
-
Method Details
-
packedBuilder
Return a newPackedLongValues.Builder
that will compress efficiently positive integers. -
packedBuilder
- See Also:
-
deltaPackedBuilder
public static PackedLongValues.Builder deltaPackedBuilder(int pageSize, float acceptableOverheadRatio) Return a newPackedLongValues.Builder
that will compress efficiently integers that are close to each other. -
deltaPackedBuilder
- See Also:
-
monotonicBuilder
public static PackedLongValues.Builder monotonicBuilder(int pageSize, float acceptableOverheadRatio) Return a newPackedLongValues.Builder
that will compress efficiently integers that would be a monotonic function of their index. -
monotonicBuilder
- See Also:
-
size
public final long size()Get the number of values in this array. -
decodeBlock
int decodeBlock(int block, long[] dest) -
get
long get(int block, int element) -
get
public final long get(long index) Description copied from class:LongValues
Get value atindex
.- Specified by:
get
in classLongValues
-
ramBytesUsed
public 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
-
iterator
Return an iterator over the values of this array.
-