Class LegacyPacked64SingleBlock
- java.lang.Object
-
- org.apache.lucene.util.packed.PackedInts.Reader
-
- org.apache.lucene.backward_codecs.packed.LegacyPacked64SingleBlock
-
- All Implemented Interfaces:
Accountable
- Direct Known Subclasses:
LegacyPacked64SingleBlock.Packed64SingleBlock1
,LegacyPacked64SingleBlock.Packed64SingleBlock10
,LegacyPacked64SingleBlock.Packed64SingleBlock12
,LegacyPacked64SingleBlock.Packed64SingleBlock16
,LegacyPacked64SingleBlock.Packed64SingleBlock2
,LegacyPacked64SingleBlock.Packed64SingleBlock21
,LegacyPacked64SingleBlock.Packed64SingleBlock3
,LegacyPacked64SingleBlock.Packed64SingleBlock32
,LegacyPacked64SingleBlock.Packed64SingleBlock4
,LegacyPacked64SingleBlock.Packed64SingleBlock5
,LegacyPacked64SingleBlock.Packed64SingleBlock6
,LegacyPacked64SingleBlock.Packed64SingleBlock7
,LegacyPacked64SingleBlock.Packed64SingleBlock8
,LegacyPacked64SingleBlock.Packed64SingleBlock9
abstract class LegacyPacked64SingleBlock extends PackedInts.Reader
This class is similar toLegacyPacked64
except that it trades space for speed by ensuring that a single block needs to be read/written in order to read/write a value.
-
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field Description protected int
bitsPerValue
(package private) long[]
blocks
static int
MAX_SUPPORTED_BITS_PER_VALUE
private static int[]
SUPPORTED_BITS_PER_VALUE
protected int
valueCount
-
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
-
Constructor Summary
Constructors Constructor Description LegacyPacked64SingleBlock(int valueCount, int bitsPerValue)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static LegacyPacked64SingleBlock
create(int valueCount, int bitsPerValue)
static LegacyPacked64SingleBlock
create(DataInput in, int valueCount, int bitsPerValue)
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.static boolean
isSupported(int bitsPerValue)
long
ramBytesUsed()
Return the memory usage of this object in bytes.private static int
requiredCapacity(int valueCount, int valuesPerBlock)
int
size()
java.lang.String
toString()
-
Methods inherited from class org.apache.lucene.util.packed.PackedInts.Reader
get
-
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 Detail
-
MAX_SUPPORTED_BITS_PER_VALUE
public static final int MAX_SUPPORTED_BITS_PER_VALUE
- See Also:
- Constant Field Values
-
SUPPORTED_BITS_PER_VALUE
private static final int[] SUPPORTED_BITS_PER_VALUE
-
blocks
final long[] blocks
-
valueCount
protected final int valueCount
-
bitsPerValue
protected final int bitsPerValue
-
-
Method Detail
-
isSupported
public static boolean isSupported(int bitsPerValue)
-
requiredCapacity
private static int requiredCapacity(int valueCount, int valuesPerBlock)
-
size
public final int size()
- Specified by:
size
in classPackedInts.Reader
- Returns:
- the number of values.
-
ramBytesUsed
public long ramBytesUsed()
Description copied from interface:Accountable
Return the memory usage of this object in bytes. Negative values are illegal.
-
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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
create
public static LegacyPacked64SingleBlock create(DataInput in, int valueCount, int bitsPerValue) throws java.io.IOException
- Throws:
java.io.IOException
-
create
private static LegacyPacked64SingleBlock create(int valueCount, int bitsPerValue)
-
-