java.lang.Object
org.apache.lucene.util.LongValues
org.apache.lucene.util.packed.DirectMonotonicReader
- All Implemented Interfaces:
Accountable
Retrieves an instance previously written by
DirectMonotonicWriter
.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
In-memory metadata that needs to be kept around forDirectMonotonicReader
to read data from disk. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final float[]
private static final long
private final long
private final int
private final byte[]
private final long[]
private final int
private final LongValues[]
Fields inherited from class org.apache.lucene.util.LongValues
IDENTITY, ZEROES
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
DirectMonotonicReader
(int blockShift, LongValues[] readers, long[] mins, float[] avgs, byte[] bpvs) -
Method Summary
Modifier and TypeMethodDescriptionlong
binarySearch
(long fromIndex, long toIndex, long key) Return the index of a key if it exists, or its insertion point otherwise likeArrays.binarySearch(long[], int, int, long)
.long
get
(long index) Get value atindex
.private long[]
getBounds
(long index) Get lower/upper bounds for the value at a given index without hitting the direct reader.static DirectMonotonicReader
getInstance
(DirectMonotonicReader.Meta meta, RandomAccessInput data) Retrieves a non-merging instance from the specified slice.static DirectMonotonicReader
getInstance
(DirectMonotonicReader.Meta meta, RandomAccessInput data, boolean merging) Retrieves an instance from the specified slice.static DirectMonotonicReader.Meta
loadMeta
(IndexInput metaIn, long numValues, int blockShift) Load metadata from the givenIndexInput
.long
Return the memory usage of this object in bytes.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 -
blockShift
private final int blockShift -
blockMask
private final long blockMask -
readers
-
mins
private final long[] mins -
avgs
private final float[] avgs -
bpvs
private final byte[] bpvs -
nonZeroBpvs
private final int nonZeroBpvs
-
-
Constructor Details
-
DirectMonotonicReader
private DirectMonotonicReader(int blockShift, LongValues[] readers, long[] mins, float[] avgs, byte[] bpvs)
-
-
Method Details
-
loadMeta
public static DirectMonotonicReader.Meta loadMeta(IndexInput metaIn, long numValues, int blockShift) throws IOException Load metadata from the givenIndexInput
.- Throws:
IOException
- See Also:
-
getInstance
public static DirectMonotonicReader getInstance(DirectMonotonicReader.Meta meta, RandomAccessInput data) throws IOException Retrieves a non-merging instance from the specified slice.- Throws:
IOException
-
getInstance
public static DirectMonotonicReader getInstance(DirectMonotonicReader.Meta meta, RandomAccessInput data, boolean merging) throws IOException Retrieves an instance from the specified slice.- Throws:
IOException
-
get
public long get(long index) Description copied from class:LongValues
Get value atindex
.- Specified by:
get
in classLongValues
-
getBounds
private long[] getBounds(long index) Get lower/upper bounds for the value at a given index without hitting the direct reader. -
binarySearch
public long binarySearch(long fromIndex, long toIndex, long key) Return the index of a key if it exists, or its insertion point otherwise likeArrays.binarySearch(long[], int, int, long)
. -
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
-