Package org.apache.lucene.util.packed
Class PackedLongValues
- java.lang.Object
-
- org.apache.lucene.util.LongValues
-
- org.apache.lucene.util.packed.PackedLongValues
-
- All Implemented Interfaces:
Accountable
- Direct Known Subclasses:
DeltaPackedLongValues
public class PackedLongValues extends LongValues implements Accountable
Utility class to compress integers into aLongValuesinstance.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPackedLongValues.BuilderA Builder for aPackedLongValuesinstance.classPackedLongValues.IteratorAn iterator over long values.
-
Field Summary
Fields Modifier and Type Field Description private static longBASE_RAM_BYTES_USED(package private) static intDEFAULT_PAGE_SIZE(package private) static intMAX_PAGE_SIZE(package private) static intMIN_PAGE_SIZE(package private) intpageMask(package private) intpageShiftprivate longramBytesUsedprivate longsize(package private) PackedInts.Reader[]values-
Fields inherited from class org.apache.lucene.util.LongValues
IDENTITY, ZEROES
-
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
-
Constructor Summary
Constructors Constructor Description PackedLongValues(int pageShift, int pageMask, PackedInts.Reader[] values, long size, long ramBytesUsed)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) intdecodeBlock(int block, long[] dest)static PackedLongValues.BuilderdeltaPackedBuilder(float acceptableOverheadRatio)static PackedLongValues.BuilderdeltaPackedBuilder(int pageSize, float acceptableOverheadRatio)Return a newPackedLongValues.Builderthat will compress efficiently integers that are close to each other.(package private) longget(int block, int element)longget(long index)Get value atindex.PackedLongValues.Iteratoriterator()Return an iterator over the values of this array.static PackedLongValues.BuildermonotonicBuilder(float acceptableOverheadRatio)static PackedLongValues.BuildermonotonicBuilder(int pageSize, float acceptableOverheadRatio)Return a newPackedLongValues.Builderthat will compress efficiently integers that would be a monotonic function of their index.static PackedLongValues.BuilderpackedBuilder(float acceptableOverheadRatio)static PackedLongValues.BuilderpackedBuilder(int pageSize, float acceptableOverheadRatio)Return a newPackedLongValues.Builderthat will compress efficiently positive integers.longramBytesUsed()Return the memory usage of this object in bytes.longsize()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 Detail
-
BASE_RAM_BYTES_USED
private static final long BASE_RAM_BYTES_USED
-
DEFAULT_PAGE_SIZE
static final int DEFAULT_PAGE_SIZE
- See Also:
- Constant Field Values
-
MIN_PAGE_SIZE
static final int MIN_PAGE_SIZE
- See Also:
- Constant Field Values
-
MAX_PAGE_SIZE
static final int MAX_PAGE_SIZE
- See Also:
- Constant Field Values
-
values
final PackedInts.Reader[] values
-
pageShift
final int pageShift
-
pageMask
final int pageMask
-
size
private final long size
-
ramBytesUsed
private final long ramBytesUsed
-
-
Constructor Detail
-
PackedLongValues
PackedLongValues(int pageShift, int pageMask, PackedInts.Reader[] values, long size, long ramBytesUsed)
-
-
Method Detail
-
packedBuilder
public static PackedLongValues.Builder packedBuilder(int pageSize, float acceptableOverheadRatio)
Return a newPackedLongValues.Builderthat will compress efficiently positive integers.
-
packedBuilder
public static PackedLongValues.Builder packedBuilder(float acceptableOverheadRatio)
- See Also:
packedBuilder(int, float)
-
deltaPackedBuilder
public static PackedLongValues.Builder deltaPackedBuilder(int pageSize, float acceptableOverheadRatio)
Return a newPackedLongValues.Builderthat will compress efficiently integers that are close to each other.
-
deltaPackedBuilder
public static PackedLongValues.Builder deltaPackedBuilder(float acceptableOverheadRatio)
- See Also:
deltaPackedBuilder(int, float)
-
monotonicBuilder
public static PackedLongValues.Builder monotonicBuilder(int pageSize, float acceptableOverheadRatio)
Return a newPackedLongValues.Builderthat will compress efficiently integers that would be a monotonic function of their index.
-
monotonicBuilder
public static PackedLongValues.Builder monotonicBuilder(float acceptableOverheadRatio)
- See Also:
monotonicBuilder(int, float)
-
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:LongValuesGet value atindex.- Specified by:
getin classLongValues
-
ramBytesUsed
public long ramBytesUsed()
Description copied from interface:AccountableReturn the memory usage of this object in bytes. Negative values are illegal.- Specified by:
ramBytesUsedin interfaceAccountable
-
iterator
public PackedLongValues.Iterator iterator()
Return an iterator over the values of this array.
-
-