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, size
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getChildResources
final 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.IOException
long getMinLeafBlockFP()
private int getTreeDepth()
public void intersect(PointValues.IntersectVisitor visitor) throws java.io.IOException
PointValues
intersect
in class PointValues
java.io.IOException
public long estimatePointCount(PointValues.IntersectVisitor visitor)
PointValues
PointValues.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 PointValues
DocIdSetIterator.cost()
private void addAll(BKDReader.IntersectState state, boolean grown) throws java.io.IOException
java.io.IOException
public BKDReader.IntersectState getIntersectState(PointValues.IntersectVisitor visitor)
BKDReader.IntersectState
public void visitLeafBlockValues(BKDReader.IndexTree index, BKDReader.IntersectState state) throws java.io.IOException
java.io.IOException
private void visitDocIDs(IndexInput in, long blockFP, PointValues.IntersectVisitor visitor) throws java.io.IOException
java.io.IOException
int readDocIDs(IndexInput in, long blockFP, int[] docIDs) throws java.io.IOException
java.io.IOException
void visitDocValues(int[] commonPrefixLengths, byte[] scratchDataPackedValue, byte[] scratchMinIndexPackedValue, byte[] scratchMaxIndexPackedValue, IndexInput in, int[] docIDs, int count, PointValues.IntersectVisitor visitor) throws java.io.IOException
java.io.IOException
private void readMinMax(int[] commonPrefixLengths, byte[] minPackedValue, byte[] maxPackedValue, IndexInput in) throws java.io.IOException
java.io.IOException
private void visitRawDocValues(int[] commonPrefixLengths, byte[] scratchPackedValue, IndexInput in, int[] docIDs, int count, PointValues.IntersectVisitor visitor) throws java.io.IOException
java.io.IOException
private void visitCompressedDocValues(int[] commonPrefixLengths, byte[] scratchPackedValue, IndexInput in, int[] docIDs, int count, PointValues.IntersectVisitor visitor, int compressedDim) throws java.io.IOException
java.io.IOException
private int readCompressedDim(IndexInput in) throws java.io.IOException
java.io.IOException
private void readCommonPrefixes(int[] commonPrefixLengths, byte[] scratchPackedValue, IndexInput in) throws java.io.IOException
java.io.IOException
private void intersect(BKDReader.IntersectState state, byte[] cellMinPacked, byte[] cellMaxPacked) throws java.io.IOException
java.io.IOException
private long estimatePointCount(BKDReader.IntersectState state, byte[] cellMinPacked, byte[] cellMaxPacked)
public long ramBytesUsed()
Accountable
ramBytesUsed
in interface Accountable
public byte[] getMinPackedValue()
PointValues
PointValues.size(org.apache.lucene.index.IndexReader, java.lang.String)
is 0
getMinPackedValue
in class PointValues
public byte[] getMaxPackedValue()
PointValues
PointValues.size(org.apache.lucene.index.IndexReader, java.lang.String)
is 0
getMaxPackedValue
in class PointValues
public int getNumDataDimensions()
PointValues
getNumDataDimensions
in class PointValues
public int getNumIndexDimensions()
PointValues
getNumIndexDimensions
in class PointValues
public int getBytesPerDimension()
PointValues
getBytesPerDimension
in class PointValues
public long size()
PointValues
size
in class PointValues
public int getDocCount()
PointValues
getDocCount
in class PointValues
public boolean isLeafNode(int nodeID)