public class BKDReader extends java.lang.Object implements Accountable
BKDWriter
.Modifier and Type | Class and Description |
---|---|
static class |
BKDReader.IntersectState
Used to track all state for a single call to
intersect(org.apache.lucene.index.PointValues.IntersectVisitor) . |
private static class |
BKDReader.VerifyVisitor |
Modifier and Type | Field and Description |
---|---|
(package private) int |
bytesPerDim |
(package private) int |
docCount |
(package private) IndexInput |
in |
(package private) long[] |
leafBlockFPs |
private int |
leafNodeOffset |
(package private) byte[] |
maxPackedValue |
(package private) int |
maxPointsInLeafNode |
(package private) byte[] |
minPackedValue |
(package private) int |
numDims |
protected int |
packedBytesLength |
(package private) long |
pointCount |
private byte[] |
splitPackedValues |
Modifier | 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 |
protected |
BKDReader(IndexInput in,
int numDims,
int maxPointsInLeafNode,
int bytesPerDim,
long[] leafBlockFPs,
byte[] splitPackedValues,
byte[] minPackedValue,
byte[] maxPackedValue,
long pointCount,
int docCount)
Called by consumers that have their own on-disk format for the index (e.g.
|
Modifier and Type | Method and Description |
---|---|
private void |
addAll(BKDReader.IntersectState state,
int nodeID)
Fast path: this is called when the query box fully encompasses all cells under this node.
|
void |
copySplitValue(int nodeID,
byte[] splitPackedValue)
Copies the split value for this node into the provided byte array
|
int |
getBytesPerDimension() |
int |
getDocCount() |
BKDReader.IntersectState |
getIntersectState(PointValues.IntersectVisitor visitor)
Create a new
BKDReader.IntersectState |
byte[] |
getMaxPackedValue() |
byte[] |
getMinPackedValue() |
int |
getNumDimensions() |
long |
getPointCount() |
private void |
intersect(BKDReader.IntersectState state,
int nodeID,
byte[] cellMinPacked,
byte[] cellMaxPacked) |
void |
intersect(PointValues.IntersectVisitor visitor) |
boolean |
isLeafNode(int nodeID) |
long |
ramBytesUsed()
Return the memory usage of this object in bytes.
|
protected int |
readDocIDs(IndexInput in,
long blockFP,
int[] docIDs) |
private void |
verify(BKDReader.IntersectState state,
int nodeID,
byte[] cellMinPacked,
byte[] cellMaxPacked) |
void |
verify(int maxDoc)
Only used for debugging, to make sure all values in each leaf block fall within the range expected by the index
|
protected void |
visitDocIDs(IndexInput in,
long blockFP,
PointValues.IntersectVisitor visitor) |
protected void |
visitDocValues(int[] commonPrefixLengths,
byte[] scratchPackedValue,
IndexInput in,
int[] docIDs,
int count,
PointValues.IntersectVisitor visitor) |
void |
visitLeafBlockValues(int nodeID,
BKDReader.IntersectState state)
Visits all docIDs and packed values in a single leaf block
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getChildResources
private final byte[] splitPackedValues
final long[] leafBlockFPs
private final int leafNodeOffset
final int numDims
final int bytesPerDim
final IndexInput in
final int maxPointsInLeafNode
final byte[] minPackedValue
final byte[] maxPackedValue
final long pointCount
final int docCount
protected final int packedBytesLength
public BKDReader(IndexInput in) throws java.io.IOException
IndexInput
to the index location that BKDWriter.finish(org.apache.lucene.store.IndexOutput)
returnedjava.io.IOException
protected BKDReader(IndexInput in, int numDims, int maxPointsInLeafNode, int bytesPerDim, long[] leafBlockFPs, byte[] splitPackedValues, byte[] minPackedValue, byte[] maxPackedValue, long pointCount, int docCount) throws java.io.IOException
java.io.IOException
public void verify(int maxDoc) throws java.io.IOException
java.io.IOException
private void verify(BKDReader.IntersectState state, int nodeID, byte[] cellMinPacked, byte[] cellMaxPacked) throws java.io.IOException
java.io.IOException
public void intersect(PointValues.IntersectVisitor visitor) throws java.io.IOException
java.io.IOException
private void addAll(BKDReader.IntersectState state, int nodeID) throws java.io.IOException
java.io.IOException
public BKDReader.IntersectState getIntersectState(PointValues.IntersectVisitor visitor)
BKDReader.IntersectState
public void visitLeafBlockValues(int nodeID, BKDReader.IntersectState state) throws java.io.IOException
java.io.IOException
protected void visitDocIDs(IndexInput in, long blockFP, PointValues.IntersectVisitor visitor) throws java.io.IOException
java.io.IOException
protected int readDocIDs(IndexInput in, long blockFP, int[] docIDs) throws java.io.IOException
java.io.IOException
protected void visitDocValues(int[] commonPrefixLengths, byte[] scratchPackedValue, IndexInput in, int[] docIDs, int count, PointValues.IntersectVisitor visitor) throws java.io.IOException
java.io.IOException
private void intersect(BKDReader.IntersectState state, int nodeID, byte[] cellMinPacked, byte[] cellMaxPacked) throws java.io.IOException
java.io.IOException
public void copySplitValue(int nodeID, byte[] splitPackedValue)
public long ramBytesUsed()
Accountable
ramBytesUsed
in interface Accountable
public byte[] getMinPackedValue()
public byte[] getMaxPackedValue()
public int getNumDimensions()
public int getBytesPerDimension()
public long getPointCount()
public int getDocCount()
public boolean isLeafNode(int nodeID)