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) int
private 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
ConstructorsModifierConstructorDescriptionprivate
SimpleTextPointTree
(IndexInput in, int nodeID, int level, byte[] minPackedValue, byte[] maxPackedValue) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAll
(PointValues.IntersectVisitor visitor, boolean grown) private int
balanceTreeNodePosition
(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 int
getNumLeavesSlow
(int node) private int
getTreeDepth
(int numLeaves) boolean
boolean
Move to the first child node and returntrue
upon success.boolean
Move to the parent node and returntrue
upon success.boolean
Move to the next sibling node and returntrue
upon success.private int
parseInt
(BytesRefBuilder scratch, BytesRef prefix) private void
pop
(boolean isLeft) private void
pushLeft()
private void
(package private) int
readDocIDs
(IndexInput in, long blockFP, int[] docIDs) private void
readLine
(IndexInput in, BytesRefBuilder scratch) long
size()
Return the number of points below the current node.private long
sizeFromBalancedTree
(int leftMostLeafNode, int rightMostLeafNode) private boolean
startsWith
(BytesRefBuilder scratch, BytesRef prefix) private String
stripPrefix
(BytesRefBuilder scratch, BytesRef prefix) void
visitDocIDs
(PointValues.IntersectVisitor visitor) Visit all the docs below the current node.void
Visit 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.PointTree
Clone, the current node becomes the root of the new tree.- Specified by:
clone
in interfacePointValues.PointTree
- Overrides:
clone
in classObject
-
moveToChild
public boolean moveToChild()Description copied from interface:PointValues.PointTree
Move to the first child node and returntrue
upon success. Returnsfalse
for leaf nodes andtrue
otherwise.- Specified by:
moveToChild
in interfacePointValues.PointTree
-
pushLeft
private void pushLeft() -
moveToSibling
public boolean moveToSibling()Description copied from interface:PointValues.PointTree
Move to the next sibling node and returntrue
upon success. Returnsfalse
if the current node has no more siblings.- Specified by:
moveToSibling
in interfacePointValues.PointTree
-
pushRight
private void pushRight() -
moveToParent
public boolean moveToParent()Description copied from interface:PointValues.PointTree
Move to the parent node and returntrue
upon success. Returnsfalse
for the root node andtrue
otherwise.- Specified by:
moveToParent
in interfacePointValues.PointTree
-
pop
private void pop(boolean isLeft) -
getMinPackedValue
public byte[] getMinPackedValue()Description copied from interface:PointValues.PointTree
Return the minimum packed value of the current node.- Specified by:
getMinPackedValue
in interfacePointValues.PointTree
-
getMaxPackedValue
public byte[] getMaxPackedValue()Description copied from interface:PointValues.PointTree
Return the maximum packed value of the current node.- Specified by:
getMaxPackedValue
in interfacePointValues.PointTree
-
size
public long size()Description copied from interface:PointValues.PointTree
Return the number of points below the current node.- Specified by:
size
in 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.PointTree
Visit all the docs below the current node.- Specified by:
visitDocIDs
in interfacePointValues.PointTree
- Throws:
IOException
-
addAll
- Throws:
IOException
-
visitDocValues
Description copied from interface:PointValues.PointTree
Visit all the docs and values below the current node.- Specified by:
visitDocValues
in interfacePointValues.PointTree
- Throws:
IOException
-
readDocIDs
- Throws:
IOException
-
isLeafNode
public boolean isLeafNode() -
parseInt
-
stripPrefix
-
startsWith
-
readLine
- Throws:
IOException
-