final class SimpleTextBKDReader extends PointValues implements Accountable
BKDReader and simplified/specialized for SimpleText's usage| Modifier and Type | Class and Description |
|---|---|
static class |
SimpleTextBKDReader.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 |
bytesPerIndexEntry |
(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 |
numDataDims |
(package private) int |
numIndexDims |
protected int |
packedBytesLength |
protected int |
packedIndexBytesLength |
(package private) long |
pointCount |
private byte[] |
splitPackedValues |
(package private) int |
version |
MAX_DIMENSIONS, MAX_NUM_BYTES| Constructor and Description |
|---|
SimpleTextBKDReader(IndexInput in,
int numDataDims,
int numIndexDims,
int maxPointsInLeafNode,
int bytesPerDim,
long[] leafBlockFPs,
byte[] splitPackedValues,
byte[] minPackedValue,
byte[] maxPackedValue,
long pointCount,
int docCount) |
| Modifier and Type | Method and Description |
|---|---|
private void |
addAll(SimpleTextBKDReader.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
|
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. |
private long |
estimatePointCount(SimpleTextBKDReader.IntersectState state,
int nodeID,
byte[] cellMinPacked,
byte[] cellMaxPacked) |
int |
getBytesPerDimension()
Returns the number of bytes per dimension
|
int |
getDocCount()
Returns the total number of documents that have indexed at least one point.
|
SimpleTextBKDReader.IntersectState |
getIntersectState(PointValues.IntersectVisitor visitor)
Create a new
SimpleTextBKDReader.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 |
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
|
void |
intersect(PointValues.IntersectVisitor visitor)
Finds all documents and points matching the provided visitor.
|
private void |
intersect(SimpleTextBKDReader.IntersectState state,
int nodeID,
byte[] cellMinPacked,
byte[] cellMaxPacked) |
boolean |
isLeafNode(int nodeID) |
private int |
parseInt(BytesRefBuilder scratch,
BytesRef prefix) |
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 |
readLine(IndexInput in,
BytesRefBuilder scratch) |
long |
size()
Returns the total number of indexed points across all documents.
|
private boolean |
startsWith(BytesRefBuilder scratch,
BytesRef prefix) |
private java.lang.String |
stripPrefix(BytesRefBuilder scratch,
BytesRef prefix) |
private void |
visitCompressedDocValues(int[] commonPrefixLengths,
byte[] scratchPackedValue,
IndexInput in,
int[] docIDs,
int count,
PointValues.IntersectVisitor visitor,
int compressedDim) |
(package private) void |
visitDocIDs(IndexInput in,
long blockFP,
PointValues.IntersectVisitor visitor) |
(package private) void |
visitDocValues(int[] commonPrefixLengths,
byte[] scratchPackedValue,
IndexInput in,
int[] docIDs,
int count,
PointValues.IntersectVisitor visitor) |
void |
visitLeafBlockValues(int nodeID,
SimpleTextBKDReader.IntersectState state)
Visits all docIDs and packed values in a single leaf block
|
estimateDocCount, getDocCount, getMaxPackedValue, getMinPackedValue, sizeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetChildResourcesprivate final byte[] splitPackedValues
final long[] leafBlockFPs
private final int leafNodeOffset
final int numDataDims
final int numIndexDims
final int bytesPerDim
final int bytesPerIndexEntry
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
public SimpleTextBKDReader(IndexInput in, int numDataDims, int numIndexDims, int maxPointsInLeafNode, int bytesPerDim, long[] leafBlockFPs, byte[] splitPackedValues, byte[] minPackedValue, byte[] maxPackedValue, long pointCount, int docCount) throws java.io.IOException
java.io.IOExceptionpublic void intersect(PointValues.IntersectVisitor visitor) throws java.io.IOException
PointValuesintersect in class PointValuesjava.io.IOExceptionprivate void addAll(SimpleTextBKDReader.IntersectState state, int nodeID) throws java.io.IOException
java.io.IOExceptionpublic SimpleTextBKDReader.IntersectState getIntersectState(PointValues.IntersectVisitor visitor)
SimpleTextBKDReader.IntersectStatepublic void visitLeafBlockValues(int nodeID,
SimpleTextBKDReader.IntersectState state)
throws java.io.IOException
java.io.IOExceptionvoid 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[] 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(SimpleTextBKDReader.IntersectState state, int nodeID, byte[] cellMinPacked, byte[] cellMaxPacked) throws java.io.IOException
java.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 PointValuesprivate long estimatePointCount(SimpleTextBKDReader.IntersectState state, int nodeID, byte[] cellMinPacked, byte[] cellMaxPacked)
public void copySplitValue(int nodeID,
byte[] splitPackedValue)
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)
private int parseInt(BytesRefBuilder scratch, BytesRef prefix)
private java.lang.String stripPrefix(BytesRefBuilder scratch, BytesRef prefix)
private boolean startsWith(BytesRefBuilder scratch, BytesRef prefix)
private void readLine(IndexInput in, BytesRefBuilder scratch) throws java.io.IOException
java.io.IOException