java.lang.Object
org.apache.lucene.util.bkd.BKDReader.BKDPointTree
- All Implemented Interfaces:
Cloneable,PointValues.PointTree
- Enclosing class:
BKDReader
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int[]private final BKDConfigprivate final DocIdsWriterprivate final IndexInputprivate final booleanprivate final intprivate final long[]private final intprivate final IndexInputprivate intprivate final byte[]private final byte[]private final boolean[]private intprivate final int(package private) final longprivate final int[]private final intprivate final int[]private final byte[]private final BKDReader.BKDReaderDocIDSetIteratorprivate final byte[]private final byte[]private final int[]private final byte[][]private final byte[][]private final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateBKDPointTree(IndexInput innerNodes, IndexInput leafNodes, BKDConfig config, int numLeaves, int version, long pointCount, byte[] minPackedValue, byte[] maxPackedValue, boolean isTreeBalanced) privateBKDPointTree(IndexInput innerNodes, IndexInput leafNodes, BKDConfig config, int numLeaves, int version, long pointCount, int nodeID, int level, byte[] minPackedValue, byte[] maxPackedValue, BKDReader.BKDReaderDocIDSetIterator scratchIterator, byte[] scratchDataPackedValue, byte[] scratchMinIndexPackedValue, byte[] scratchMaxIndexPackedValue, int[] commonPrefixLengths, boolean isTreeBalanced) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAll(PointValues.IntersectVisitor visitor, boolean grown) private intbalanceTreeNodePosition(int minNode, int maxNode, int node, int position, int level) clone()Clone, the current node becomes the root of the new tree.private longOnly valid after pushLeft or pushRight, not pop!byte[]Return the maximum packed value of the current node.byte[]Return the minimum packed value of the current node.private intgetNumLeavesSlow(int node) private intgetTreeDepth(int numLeaves) private booleanprivate booleanprivate booleanbooleanMove to the first child node and returntrueupon success.booleanMove to the parent node and returntrueupon success.booleanMove to the next sibling node and returntrueupon success.private booleanprivate voidpop()private voidpopBounds(byte[] packedValue) private voidprivate voidprivate voidpushLeft()private voidprivate voidreadCommonPrefixes(int[] commonPrefixLengths, byte[] scratchPackedValue, IndexInput in) private intprivate intreadDocIDs(IndexInput in, long blockFP, BKDReader.BKDReaderDocIDSetIterator iterator) private voidreadMinMax(int[] commonPrefixLengths, byte[] minPackedValue, byte[] maxPackedValue, IndexInput in) private voidreadNodeData(boolean isLeft) private voidlongsize()Return the number of points below the current node.private longsizeFromBalancedTree(int leftMostLeafNode, int rightMostLeafNode) toString()private voidvisitCompressedDocValues(int[] commonPrefixLengths, byte[] scratchPackedValue, IndexInput in, BKDReader.BKDReaderDocIDSetIterator scratchIterator, int count, PointValues.IntersectVisitor visitor, int compressedDim) voidvisitDocIDs(PointValues.IntersectVisitor visitor) Visit all the docs below the current node.voidVisit all the docs and values below the current node.private voidvisitDocValues(PointValues.IntersectVisitor visitor, long fp) private voidvisitDocValuesNoCardinality(int[] commonPrefixLengths, byte[] scratchDataPackedValue, byte[] scratchMinIndexPackedValue, byte[] scratchMaxIndexPackedValue, IndexInput in, BKDReader.BKDReaderDocIDSetIterator scratchIterator, int count, PointValues.IntersectVisitor visitor) private voidvisitDocValuesWithCardinality(int[] commonPrefixLengths, byte[] scratchDataPackedValue, byte[] scratchMinIndexPackedValue, byte[] scratchMaxIndexPackedValue, IndexInput in, BKDReader.BKDReaderDocIDSetIterator scratchIterator, int count, PointValues.IntersectVisitor visitor) private voidprivate voidvisitSparseRawDocValues(int[] commonPrefixLengths, byte[] scratchPackedValue, IndexInput in, BKDReader.BKDReaderDocIDSetIterator scratchIterator, int count, PointValues.IntersectVisitor visitor) private voidvisitUniqueRawDocValues(byte[] scratchPackedValue, BKDReader.BKDReaderDocIDSetIterator scratchIterator, int count, PointValues.IntersectVisitor visitor)
-
Field Details
-
nodeID
private int nodeID -
nodeRoot
private final int nodeRoot -
level
private int level -
innerNodes
-
leafNodes
-
leafBlockFPStack
private final long[] leafBlockFPStack -
readNodeDataPositions
private final int[] readNodeDataPositions -
rightNodePositions
private final int[] rightNodePositions -
splitDimsPos
private final int[] splitDimsPos -
negativeDeltas
private final boolean[] negativeDeltas -
splitValuesStack
private final byte[][] splitValuesStack -
minPackedValue
private final byte[] minPackedValue -
maxPackedValue
private final byte[] maxPackedValue -
splitDimValueStack
private final byte[][] splitDimValueStack -
config
-
leafNodeOffset
private final int leafNodeOffset -
version
private final int version -
pointCount
final long pointCount -
lastLeafNodePointCount
private final int lastLeafNodePointCount -
rightMostLeafNode
private final int rightMostLeafNode -
scratchDataPackedValue
private final byte[] scratchDataPackedValue -
scratchMinIndexPackedValue
private final byte[] scratchMinIndexPackedValue -
scratchMaxIndexPackedValue
private final byte[] scratchMaxIndexPackedValue -
commonPrefixLengths
private final int[] commonPrefixLengths -
scratchIterator
-
docIdsWriter
-
isTreeBalanced
private final boolean isTreeBalanced
-
-
Constructor Details
-
BKDPointTree
private BKDPointTree(IndexInput innerNodes, IndexInput leafNodes, BKDConfig config, int numLeaves, int version, long pointCount, byte[] minPackedValue, byte[] maxPackedValue, boolean isTreeBalanced) throws IOException - Throws:
IOException
-
BKDPointTree
private BKDPointTree(IndexInput innerNodes, IndexInput leafNodes, BKDConfig config, int numLeaves, int version, long pointCount, int nodeID, int level, byte[] minPackedValue, byte[] maxPackedValue, BKDReader.BKDReaderDocIDSetIterator scratchIterator, byte[] scratchDataPackedValue, byte[] scratchMinIndexPackedValue, byte[] scratchMaxIndexPackedValue, int[] commonPrefixLengths, boolean isTreeBalanced)
-
-
Method Details
-
clone
Description copied from interface:PointValues.PointTreeClone, the current node becomes the root of the new tree.- Specified by:
clonein interfacePointValues.PointTree- Overrides:
clonein classObject
-
getMinPackedValue
public byte[] getMinPackedValue()Description copied from interface:PointValues.PointTreeReturn the minimum packed value of the current node.- Specified by:
getMinPackedValuein interfacePointValues.PointTree
-
getMaxPackedValue
public byte[] getMaxPackedValue()Description copied from interface:PointValues.PointTreeReturn the maximum packed value of the current node.- Specified by:
getMaxPackedValuein interfacePointValues.PointTree
-
moveToChild
Description copied from interface:PointValues.PointTreeMove to the first child node and returntrueupon success. Returnsfalsefor leaf nodes andtrueotherwise.- Specified by:
moveToChildin interfacePointValues.PointTree- Throws:
IOException
-
resetNodeDataPosition
- Throws:
IOException
-
pushBoundsLeft
private void pushBoundsLeft() -
pushLeft
- Throws:
IOException
-
pushBoundsRight
private void pushBoundsRight() -
pushRight
- Throws:
IOException
-
moveToSibling
Description copied from interface:PointValues.PointTreeMove to the next sibling node and returntrueupon success. Returnsfalseif the current node has no more siblings.- Specified by:
moveToSiblingin interfacePointValues.PointTree- Throws:
IOException
-
pop
private void pop() -
popBounds
private void popBounds(byte[] packedValue) -
moveToParent
public boolean moveToParent()Description copied from interface:PointValues.PointTreeMove to the parent node and returntrueupon success. Returnsfalsefor the root node andtrueotherwise.- Specified by:
moveToParentin interfacePointValues.PointTree
-
isRootNode
private boolean isRootNode() -
isLeftNode
private boolean isLeftNode() -
isLeafNode
private boolean isLeafNode() -
nodeExists
private boolean nodeExists() -
getLeafBlockFP
private long getLeafBlockFP()Only valid after pushLeft or pushRight, not pop! -
size
public long size()Description copied from interface:PointValues.PointTreeReturn the number of points below the current node.- Specified by:
sizein interfacePointValues.PointTree
-
sizeFromBalancedTree
private long sizeFromBalancedTree(int leftMostLeafNode, int rightMostLeafNode) -
balanceTreeNodePosition
private int balanceTreeNodePosition(int minNode, int maxNode, int node, int position, int level) -
visitDocIDs
Description copied from interface:PointValues.PointTreeVisit all the docs below the current node.- Specified by:
visitDocIDsin interfacePointValues.PointTree- Throws:
IOException
-
addAll
- Throws:
IOException
-
visitDocValues
Description copied from interface:PointValues.PointTreeVisit all the docs and values below the current node.- Specified by:
visitDocValuesin interfacePointValues.PointTree- Throws:
IOException
-
visitLeavesOneByOne
- Throws:
IOException
-
visitDocValues
- Throws:
IOException
-
readDocIDs
private int readDocIDs(IndexInput in, long blockFP, BKDReader.BKDReaderDocIDSetIterator iterator) throws IOException - Throws:
IOException
-
getNumLeavesSlow
private int getNumLeavesSlow(int node) -
readNodeData
- Throws:
IOException
-
getTreeDepth
private int getTreeDepth(int numLeaves) -
visitDocValuesNoCardinality
private void visitDocValuesNoCardinality(int[] commonPrefixLengths, byte[] scratchDataPackedValue, byte[] scratchMinIndexPackedValue, byte[] scratchMaxIndexPackedValue, IndexInput in, BKDReader.BKDReaderDocIDSetIterator scratchIterator, int count, PointValues.IntersectVisitor visitor) throws IOException - Throws:
IOException
-
visitDocValuesWithCardinality
private void visitDocValuesWithCardinality(int[] commonPrefixLengths, byte[] scratchDataPackedValue, byte[] scratchMinIndexPackedValue, byte[] scratchMaxIndexPackedValue, IndexInput in, BKDReader.BKDReaderDocIDSetIterator scratchIterator, int count, PointValues.IntersectVisitor visitor) throws IOException - Throws:
IOException
-
readMinMax
private void readMinMax(int[] commonPrefixLengths, byte[] minPackedValue, byte[] maxPackedValue, IndexInput in) throws IOException - Throws:
IOException
-
visitSparseRawDocValues
private void visitSparseRawDocValues(int[] commonPrefixLengths, byte[] scratchPackedValue, IndexInput in, BKDReader.BKDReaderDocIDSetIterator scratchIterator, int count, PointValues.IntersectVisitor visitor) throws IOException - Throws:
IOException
-
visitUniqueRawDocValues
private void visitUniqueRawDocValues(byte[] scratchPackedValue, BKDReader.BKDReaderDocIDSetIterator scratchIterator, int count, PointValues.IntersectVisitor visitor) throws IOException - Throws:
IOException
-
visitCompressedDocValues
private void visitCompressedDocValues(int[] commonPrefixLengths, byte[] scratchPackedValue, IndexInput in, BKDReader.BKDReaderDocIDSetIterator scratchIterator, int count, PointValues.IntersectVisitor visitor, int compressedDim) throws IOException - Throws:
IOException
-
readCompressedDim
- Throws:
IOException
-
readCommonPrefixes
private void readCommonPrefixes(int[] commonPrefixLengths, byte[] scratchPackedValue, IndexInput in) throws IOException - Throws:
IOException
-
toString
-