- java.lang.Object
-
- org.apache.lucene.index.PointValues
-
- org.apache.lucene.util.bkd.BKDReader
-
public class BKDReader extends PointValues
Handles reading a block KD-tree in byte[] space previously written withBKDWriter
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
BKDReader.BKDPointTree
private static class
BKDReader.BKDReaderDocIDSetIterator
ReusableDocIdSetIterator
to handle low cardinality leaves.-
Nested classes/interfaces inherited from class org.apache.lucene.index.PointValues
PointValues.IntersectVisitor, PointValues.PointTree, PointValues.Relation
-
-
Field Summary
Fields Modifier and Type Field Description (package private) BKDConfig
config
(package private) int
docCount
(package private) IndexInput
in
private boolean
isTreeBalanced
(package private) byte[]
maxPackedValue
(package private) long
minLeafBlockFP
(package private) byte[]
minPackedValue
(package private) int
numLeaves
(package private) IndexInput
packedIndex
(package private) long
pointCount
(package private) int
version
-
Fields inherited from class org.apache.lucene.index.PointValues
MAX_DIMENSIONS, MAX_INDEX_DIMENSIONS, MAX_NUM_BYTES
-
-
Constructor Summary
Constructors Constructor Description BKDReader(IndexInput metaIn, IndexInput indexIn, IndexInput dataIn)
Caller must pre-seek the providedIndexInput
to the index location thatBKDWriter.finish(org.apache.lucene.store.IndexOutput, org.apache.lucene.store.IndexOutput, org.apache.lucene.store.IndexOutput)
returned.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getBytesPerDimension()
Returns the number of bytes per dimensionint
getDocCount()
Returns the total number of documents that have indexed at least one point.byte[]
getMaxPackedValue()
Returns maximum value for each dimension, packed, or null ifPointValues.size(org.apache.lucene.index.IndexReader, java.lang.String)
is0
byte[]
getMinPackedValue()
Returns minimum value for each dimension, packed, or null ifPointValues.size(org.apache.lucene.index.IndexReader, java.lang.String)
is0
int
getNumDimensions()
Returns how many dimensions are represented in the valuesint
getNumIndexDimensions()
Returns how many dimensions are used for the indexPointValues.PointTree
getPointTree()
Create a newPointValues.PointTree
to navigate the indexprivate boolean
isTreeBalanced()
long
size()
Returns the total number of indexed points across all documents.-
Methods inherited from class org.apache.lucene.index.PointValues
estimateDocCount, estimatePointCount, getDocCount, getMaxPackedValue, getMinPackedValue, intersect, isEstimatedPointCountGreaterThanOrEqualTo, size
-
-
-
-
Field Detail
-
config
final BKDConfig config
-
numLeaves
final int numLeaves
-
in
final IndexInput in
-
minPackedValue
final byte[] minPackedValue
-
maxPackedValue
final byte[] maxPackedValue
-
pointCount
final long pointCount
-
docCount
final int docCount
-
version
final int version
-
minLeafBlockFP
final long minLeafBlockFP
-
packedIndex
final IndexInput packedIndex
-
isTreeBalanced
private final boolean isTreeBalanced
-
-
Constructor Detail
-
BKDReader
public BKDReader(IndexInput metaIn, IndexInput indexIn, IndexInput dataIn) throws java.io.IOException
Caller must pre-seek the providedIndexInput
to the index location thatBKDWriter.finish(org.apache.lucene.store.IndexOutput, org.apache.lucene.store.IndexOutput, org.apache.lucene.store.IndexOutput)
returned. BKD tree is always stored off-heap.- Throws:
java.io.IOException
-
-
Method Detail
-
isTreeBalanced
private boolean isTreeBalanced() throws java.io.IOException
- Throws:
java.io.IOException
-
getPointTree
public PointValues.PointTree getPointTree() throws java.io.IOException
Description copied from class:PointValues
Create a newPointValues.PointTree
to navigate the index- Specified by:
getPointTree
in classPointValues
- Throws:
java.io.IOException
-
getMinPackedValue
public byte[] getMinPackedValue()
Description copied from class:PointValues
Returns minimum value for each dimension, packed, or null ifPointValues.size(org.apache.lucene.index.IndexReader, java.lang.String)
is0
- Specified by:
getMinPackedValue
in classPointValues
-
getMaxPackedValue
public byte[] getMaxPackedValue()
Description copied from class:PointValues
Returns maximum value for each dimension, packed, or null ifPointValues.size(org.apache.lucene.index.IndexReader, java.lang.String)
is0
- Specified by:
getMaxPackedValue
in classPointValues
-
getNumDimensions
public int getNumDimensions() throws java.io.IOException
Description copied from class:PointValues
Returns how many dimensions are represented in the values- Specified by:
getNumDimensions
in classPointValues
- Throws:
java.io.IOException
-
getNumIndexDimensions
public int getNumIndexDimensions() throws java.io.IOException
Description copied from class:PointValues
Returns how many dimensions are used for the index- Specified by:
getNumIndexDimensions
in classPointValues
- Throws:
java.io.IOException
-
getBytesPerDimension
public int getBytesPerDimension() throws java.io.IOException
Description copied from class:PointValues
Returns the number of bytes per dimension- Specified by:
getBytesPerDimension
in classPointValues
- Throws:
java.io.IOException
-
size
public long size()
Description copied from class:PointValues
Returns the total number of indexed points across all documents.- Specified by:
size
in classPointValues
-
getDocCount
public int getDocCount()
Description copied from class:PointValues
Returns the total number of documents that have indexed at least one point.- Specified by:
getDocCount
in classPointValues
-
-