Module org.apache.lucene.codecs
Class SimpleTextBKDReader.SimpleTextPointTree
java.lang.Object
org.apache.lucene.codecs.simpletext.SimpleTextBKDReader.SimpleTextPointTree
- All Implemented Interfaces:
Cloneable,PointValues.PointTree
- Enclosing class:
SimpleTextBKDReader
private class SimpleTextBKDReader.SimpleTextPointTree
extends Object
implements PointValues.PointTree
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IndexInput(package private) intprivate final byte[]private final byte[](package private) int(package private) final int(package private) final int[](package private) final byte[]private final int[]private final byte[][] -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateSimpleTextPointTree(IndexInput in, int nodeID, int level, byte[] minPackedValue, byte[] maxPackedValue) -
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.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) 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 intparseInt(BytesRefBuilder scratch, BytesRef prefix) private voidpop(boolean isLeft) private voidpushLeft()private void(package private) intreadDocIDs(IndexInput in, long blockFP, int[] docIDs) private voidreadLine(IndexInput in, BytesRefBuilder scratch) longsize()Return the number of points below the current node.private longsizeFromBalancedTree(int leftMostLeafNode, int rightMostLeafNode) private booleanstartsWith(BytesRefBuilder scratch, BytesRef prefix) private StringstripPrefix(BytesRefBuilder scratch, BytesRef prefix) voidvisitDocIDs(PointValues.IntersectVisitor visitor) Visit all the docs below the current node.voidVisit all the docs and values below the current node.
-
Field Details
-
scratchDocIDs
final int[] scratchDocIDs -
scratchPackedValue
final byte[] scratchPackedValue -
nodeID
int nodeID -
level
int level -
rootNode
final int rootNode -
minPackedValue
private final byte[] minPackedValue -
maxPackedValue
private final byte[] maxPackedValue -
splitDimValueStack
private final byte[][] splitDimValueStack -
splitDims
private final int[] splitDims -
in
-
-
Constructor Details
-
SimpleTextPointTree
private SimpleTextPointTree(IndexInput in, int nodeID, int level, byte[] minPackedValue, byte[] maxPackedValue)
-
-
Method Details
-
getTreeDepth
private int getTreeDepth(int numLeaves) -
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
-
moveToChild
public boolean moveToChild()Description copied from interface:PointValues.PointTreeMove to the first child node and returntrueupon success. Returnsfalsefor leaf nodes andtrueotherwise.- Specified by:
moveToChildin interfacePointValues.PointTree
-
pushLeft
private void pushLeft() -
moveToSibling
public boolean 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
-
pushRight
private void pushRight() -
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
-
pop
private void pop(boolean isLeft) -
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
-
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) -
getNumLeavesSlow
private int getNumLeavesSlow(int node) -
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
-
readDocIDs
- Throws:
IOException
-
isLeafNode
public boolean isLeafNode() -
parseInt
-
stripPrefix
-
startsWith
-
readLine
- Throws:
IOException
-