Class LegacyDirectMonotonicReader
- java.lang.Object
-
- org.apache.lucene.util.LongValues
-
- org.apache.lucene.backward_codecs.packed.LegacyDirectMonotonicReader
-
- All Implemented Interfaces:
Accountable
public final class LegacyDirectMonotonicReader extends LongValues implements Accountable
Retrieves an instance previously written byLegacyDirectMonotonicWriter.- See Also:
LegacyDirectMonotonicWriter
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLegacyDirectMonotonicReader.MetaIn-memory metadata that needs to be kept around forLegacyDirectMonotonicReaderto read data from disk.
-
Field Summary
Fields Modifier and Type Field Description private float[]avgsprivate static longBASE_RAM_BYTES_USEDprivate intblockShiftprivate byte[]bpvsprivate long[]minsprivate intnonZeroBpvsprivate LongValues[]readers-
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 Modifier Constructor Description privateLegacyDirectMonotonicReader(int blockShift, LongValues[] readers, long[] mins, float[] avgs, byte[] bpvs)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longbinarySearch(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).longget(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 LegacyDirectMonotonicReadergetInstance(LegacyDirectMonotonicReader.Meta meta, RandomAccessInput data)Retrieves an instance from the specified slice.static LegacyDirectMonotonicReader.MetaloadMeta(IndexInput metaIn, long numValues, int blockShift)Load metadata from the givenIndexInput.longramBytesUsed()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 Detail
-
BASE_RAM_BYTES_USED
private static final long BASE_RAM_BYTES_USED
-
blockShift
private final int blockShift
-
readers
private final LongValues[] readers
-
mins
private final long[] mins
-
avgs
private final float[] avgs
-
bpvs
private final byte[] bpvs
-
nonZeroBpvs
private final int nonZeroBpvs
-
-
Constructor Detail
-
LegacyDirectMonotonicReader
private LegacyDirectMonotonicReader(int blockShift, LongValues[] readers, long[] mins, float[] avgs, byte[] bpvs)
-
-
Method Detail
-
loadMeta
public static LegacyDirectMonotonicReader.Meta loadMeta(IndexInput metaIn, long numValues, int blockShift) throws java.io.IOException
Load metadata from the givenIndexInput.- Throws:
java.io.IOException- See Also:
getInstance(Meta, RandomAccessInput)
-
getInstance
public static LegacyDirectMonotonicReader getInstance(LegacyDirectMonotonicReader.Meta meta, RandomAccessInput data) throws java.io.IOException
Retrieves an instance from the specified slice.- Throws:
java.io.IOException
-
get
public long get(long index)
Description copied from class:LongValuesGet value atindex.- Specified by:
getin 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).- See Also:
Arrays.binarySearch(long[], int, int, long)
-
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
-
-