final class SimpleTextBKDReader extends PointValues implements Accountable
BKDReader
and simplified/specialized for SimpleText's usageModifier 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
|
getDocCount, getMaxPackedValue, getMinPackedValue, size
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 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.IOException
public void intersect(PointValues.IntersectVisitor visitor) throws java.io.IOException
PointValues
intersect
in class PointValues
java.io.IOException
private void addAll(SimpleTextBKDReader.IntersectState state, int nodeID) throws java.io.IOException
java.io.IOException
public SimpleTextBKDReader.IntersectState getIntersectState(PointValues.IntersectVisitor visitor)
SimpleTextBKDReader.IntersectState
public void visitLeafBlockValues(int nodeID, SimpleTextBKDReader.IntersectState state) throws java.io.IOException
java.io.IOException
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[] 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(SimpleTextBKDReader.IntersectState state, int nodeID, byte[] cellMinPacked, byte[] cellMaxPacked) throws java.io.IOException
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 long estimatePointCount(SimpleTextBKDReader.IntersectState state, int nodeID, byte[] cellMinPacked, byte[] cellMaxPacked)
public void copySplitValue(int nodeID, byte[] splitPackedValue)
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)
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