Class LegacyPacked64
java.lang.Object
org.apache.lucene.util.packed.PackedInts.Reader
org.apache.lucene.backward_codecs.packed.LegacyPacked64
- All Implemented Interfaces:
Accountable
Immutable version of
Packed64
which is constructed from am existing DataInput
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final int
bits per value.(package private) static final int
(package private) static final int
private final long[]
Values are stores contiguously in the blocks array.private final int
Optimization: Saves one lookup inget(int)
.private final long
A right-aligned mask of width BitsPerValue used byget(int)
.(package private) static final int
protected final int
number of valuesFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
Constructor Summary
ConstructorsConstructorDescriptionLegacyPacked64
(int packedIntsVersion, DataInput in, int valueCount, int bitsPerValue) Creates an array with content retrieved from the given DataInput. -
Method Summary
Modifier and TypeMethodDescriptionlong
get
(int index) Get the long at the given index.int
get
(int index, long[] arr, int off, int len) Bulk get: read at least one and at mostlen
longs starting fromindex
intoarr[off:off+len]
and return the actual number of values that have been read.long
Return the memory usage of this object in bytes.final int
size()
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Field Details
-
BLOCK_SIZE
static final int BLOCK_SIZE- See Also:
-
BLOCK_BITS
static final int BLOCK_BITS- See Also:
-
MOD_MASK
static final int MOD_MASK- See Also:
-
blocks
private final long[] blocksValues are stores contiguously in the blocks array. -
maskRight
private final long maskRightA right-aligned mask of width BitsPerValue used byget(int)
. -
bpvMinusBlockSize
private final int bpvMinusBlockSizeOptimization: Saves one lookup inget(int)
. -
valueCount
protected final int valueCountnumber of values -
bitsPerValue
protected final int bitsPerValuebits per value.
-
-
Constructor Details
-
LegacyPacked64
public LegacyPacked64(int packedIntsVersion, DataInput in, int valueCount, int bitsPerValue) throws IOException Creates an array with content retrieved from the given DataInput.- Parameters:
in
- a DataInput, positioned at the start of Packed64-content.valueCount
- the number of elements.bitsPerValue
- the number of bits available for any given value.- Throws:
IOException
- if the values for the backing array could not be retrieved.
-
-
Method Details
-
size
public final int size()- Specified by:
size
in classPackedInts.Reader
- Returns:
- the number of values.
-
get
public long get(int index) Description copied from class:PackedInts.Reader
Get the long at the given index. Behavior is undefined for out-of-range indices.- Specified by:
get
in classPackedInts.Reader
-
get
public int get(int index, long[] arr, int off, int len) Description copied from class:PackedInts.Reader
Bulk get: read at least one and at mostlen
longs starting fromindex
intoarr[off:off+len]
and return the actual number of values that have been read.- Overrides:
get
in classPackedInts.Reader
-
toString
-
ramBytesUsed
public long ramBytesUsed()Description copied from interface:Accountable
Return the memory usage of this object in bytes. Negative values are illegal.
-