public final class BKDReader extends PointValues implements Accountable
BKDWriter.| Modifier and Type | Class and Description |
|---|---|
class |
BKDReader.IndexTree
Used to walk the in-heap index.
|
static class |
BKDReader.IntersectState
Used to track all state for a single call to
intersect(org.apache.lucene.index.PointValues.IntersectVisitor). |
PointValues.IntersectVisitor, PointValues.Relation| Modifier and Type | Field and Description |
|---|---|
(package private) int |
bytesPerDim |
(package private) int |
docCount |
(package private) IndexInput |
in |
(package private) int |
leafNodeOffset |
(package private) byte[] |
maxPackedValue |
(package private) int |
maxPointsInLeafNode |
(package private) byte[] |
minPackedValue |
(package private) int |
numDataDims |
(package private) int |
numIndexDims |
(package private) int |
numLeaves |
protected int |
packedBytesLength |
(package private) byte[] |
packedIndex |
protected int |
packedIndexBytesLength |
(package private) long |
pointCount |
(package private) int |
version |
MAX_DIMENSIONS, MAX_NUM_BYTES| Constructor and Description |
|---|
BKDReader(IndexInput in)
Caller must pre-seek the provided
IndexInput to the index location that BKDWriter.finish(org.apache.lucene.store.IndexOutput) returned |
| Modifier and Type | Method and Description |
|---|---|
private void |
addAll(BKDReader.IntersectState state,
boolean grown)
Fast path: this is called when the query box fully encompasses all cells under this node.
|
private long |
estimatePointCount(BKDReader.IntersectState state,
byte[] cellMinPacked,
byte[] cellMaxPacked) |
long |
estimatePointCount(PointValues.IntersectVisitor visitor)
Estimate the number of points that would be visited by
PointValues.intersect(org.apache.lucene.index.PointValues.IntersectVisitor)
with the given PointValues.IntersectVisitor. |
int |
getBytesPerDimension()
Returns the number of bytes per dimension
|
int |
getDocCount()
Returns the total number of documents that have indexed at least one point.
|
BKDReader.IntersectState |
getIntersectState(PointValues.IntersectVisitor visitor)
Create a new
BKDReader.IntersectState |
byte[] |
getMaxPackedValue()
Returns maximum value for each dimension, packed, or null if
PointValues.size(org.apache.lucene.index.IndexReader, java.lang.String) is 0 |
(package private) long |
getMinLeafBlockFP() |
byte[] |
getMinPackedValue()
Returns minimum value for each dimension, packed, or null if
PointValues.size(org.apache.lucene.index.IndexReader, java.lang.String) is 0 |
int |
getNumDataDimensions()
Returns how many data dimensions are represented in the values
|
int |
getNumIndexDimensions()
Returns how many dimensions are used for the index
|
private int |
getTreeDepth() |
private void |
intersect(BKDReader.IntersectState state,
byte[] cellMinPacked,
byte[] cellMaxPacked) |
void |
intersect(PointValues.IntersectVisitor visitor)
Finds all documents and points matching the provided visitor.
|
boolean |
isLeafNode(int nodeID) |
long |
ramBytesUsed()
Return the memory usage of this object in bytes.
|
private void |
readCommonPrefixes(int[] commonPrefixLengths,
byte[] scratchPackedValue,
IndexInput in) |
private int |
readCompressedDim(IndexInput in) |
(package private) int |
readDocIDs(IndexInput in,
long blockFP,
int[] docIDs) |
private void |
readMinMax(int[] commonPrefixLengths,
byte[] minPackedValue,
byte[] maxPackedValue,
IndexInput in) |
long |
size()
Returns the total number of indexed points across all documents.
|
private void |
visitCompressedDocValues(int[] commonPrefixLengths,
byte[] scratchPackedValue,
IndexInput in,
int[] docIDs,
int count,
PointValues.IntersectVisitor visitor,
int compressedDim) |
private void |
visitDocIDs(IndexInput in,
long blockFP,
PointValues.IntersectVisitor visitor) |
(package private) void |
visitDocValues(int[] commonPrefixLengths,
byte[] scratchDataPackedValue,
byte[] scratchMinIndexPackedValue,
byte[] scratchMaxIndexPackedValue,
IndexInput in,
int[] docIDs,
int count,
PointValues.IntersectVisitor visitor) |
void |
visitLeafBlockValues(BKDReader.IndexTree index,
BKDReader.IntersectState state)
Visits all docIDs and packed values in a single leaf block
|
private void |
visitRawDocValues(int[] commonPrefixLengths,
byte[] scratchPackedValue,
IndexInput in,
int[] docIDs,
int count,
PointValues.IntersectVisitor visitor) |
getDocCount, getMaxPackedValue, getMinPackedValue, sizeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetChildResourcesfinal int leafNodeOffset
final int numDataDims
final int numIndexDims
final int bytesPerDim
final int numLeaves
final IndexInput in
final int maxPointsInLeafNode
final byte[] minPackedValue
final byte[] maxPackedValue
final long pointCount
final int docCount
final int version
protected final int packedBytesLength
protected final int packedIndexBytesLength
final byte[] packedIndex
public BKDReader(IndexInput in) throws java.io.IOException
IndexInput to the index location that BKDWriter.finish(org.apache.lucene.store.IndexOutput) returnedjava.io.IOExceptionlong getMinLeafBlockFP()
private int getTreeDepth()
public void intersect(PointValues.IntersectVisitor visitor) throws java.io.IOException
PointValuesintersect in class PointValuesjava.io.IOExceptionpublic long estimatePointCount(PointValues.IntersectVisitor visitor)
PointValuesPointValues.intersect(org.apache.lucene.index.PointValues.IntersectVisitor)
with the given PointValues.IntersectVisitor. This should run many times faster
than PointValues.intersect(IntersectVisitor).estimatePointCount in class PointValuesDocIdSetIterator.cost()private void addAll(BKDReader.IntersectState state, boolean grown) throws java.io.IOException
java.io.IOExceptionpublic BKDReader.IntersectState getIntersectState(PointValues.IntersectVisitor visitor)
BKDReader.IntersectStatepublic void visitLeafBlockValues(BKDReader.IndexTree index, BKDReader.IntersectState state) throws java.io.IOException
java.io.IOExceptionprivate void visitDocIDs(IndexInput in, long blockFP, PointValues.IntersectVisitor visitor) throws java.io.IOException
java.io.IOExceptionint readDocIDs(IndexInput in, long blockFP, int[] docIDs) throws java.io.IOException
java.io.IOExceptionvoid visitDocValues(int[] commonPrefixLengths,
byte[] scratchDataPackedValue,
byte[] scratchMinIndexPackedValue,
byte[] scratchMaxIndexPackedValue,
IndexInput in,
int[] docIDs,
int count,
PointValues.IntersectVisitor visitor)
throws java.io.IOException
java.io.IOExceptionprivate void readMinMax(int[] commonPrefixLengths,
byte[] minPackedValue,
byte[] maxPackedValue,
IndexInput in)
throws java.io.IOException
java.io.IOExceptionprivate void visitRawDocValues(int[] commonPrefixLengths,
byte[] scratchPackedValue,
IndexInput in,
int[] docIDs,
int count,
PointValues.IntersectVisitor visitor)
throws java.io.IOException
java.io.IOExceptionprivate void visitCompressedDocValues(int[] commonPrefixLengths,
byte[] scratchPackedValue,
IndexInput in,
int[] docIDs,
int count,
PointValues.IntersectVisitor visitor,
int compressedDim)
throws java.io.IOException
java.io.IOExceptionprivate int readCompressedDim(IndexInput in) throws java.io.IOException
java.io.IOExceptionprivate void readCommonPrefixes(int[] commonPrefixLengths,
byte[] scratchPackedValue,
IndexInput in)
throws java.io.IOException
java.io.IOExceptionprivate void intersect(BKDReader.IntersectState state, byte[] cellMinPacked, byte[] cellMaxPacked) throws java.io.IOException
java.io.IOExceptionprivate long estimatePointCount(BKDReader.IntersectState state, byte[] cellMinPacked, byte[] cellMaxPacked)
public long ramBytesUsed()
AccountableramBytesUsed in interface Accountablepublic byte[] getMinPackedValue()
PointValuesPointValues.size(org.apache.lucene.index.IndexReader, java.lang.String) is 0getMinPackedValue in class PointValuespublic byte[] getMaxPackedValue()
PointValuesPointValues.size(org.apache.lucene.index.IndexReader, java.lang.String) is 0getMaxPackedValue in class PointValuespublic int getNumDataDimensions()
PointValuesgetNumDataDimensions in class PointValuespublic int getNumIndexDimensions()
PointValuesgetNumIndexDimensions in class PointValuespublic int getBytesPerDimension()
PointValuesgetBytesPerDimension in class PointValuespublic long size()
PointValuessize in class PointValuespublic int getDocCount()
PointValuesgetDocCount in class PointValuespublic boolean isLeafNode(int nodeID)