Class SimpleTextBKDReader.SimpleTextPointTree
- java.lang.Object
-
- org.apache.lucene.codecs.simpletext.SimpleTextBKDReader.SimpleTextPointTree
-
- All Implemented Interfaces:
java.lang.Cloneable
,PointValues.PointTree
- Enclosing class:
- SimpleTextBKDReader
private class SimpleTextBKDReader.SimpleTextPointTree extends java.lang.Object implements PointValues.PointTree
-
-
Field Summary
Fields Modifier and Type Field Description private IndexInput
in
(package private) int
level
private byte[]
maxPackedValue
private byte[]
minPackedValue
(package private) int
nodeID
(package private) int
rootNode
(package private) int[]
scratchDocIDs
(package private) byte[]
scratchPackedValue
private int[]
splitDims
private byte[][]
splitDimValueStack
-
Constructor Summary
Constructors Modifier Constructor Description private
SimpleTextPointTree(IndexInput in, int nodeID, int level, byte[] minPackedValue, byte[] maxPackedValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAll(PointValues.IntersectVisitor visitor, boolean grown)
private int
balanceTreeNodePosition(int minNode, int maxNode, int node, int position, int level)
PointValues.PointTree
clone()
Clone, the current node becomes the root of the new tree.byte[]
getMaxPackedValue()
Return the maximum packed value of the current node.byte[]
getMinPackedValue()
Return the minimum packed value of the current node.private int
getNumLeavesSlow(int node)
private int
getTreeDepth(int numLeaves)
boolean
isLeafNode()
boolean
moveToChild()
Move to the first child node and returntrue
upon success.boolean
moveToParent()
Move to the parent node and returntrue
upon success.boolean
moveToSibling()
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
pushRight()
(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 java.lang.String
stripPrefix(BytesRefBuilder scratch, BytesRef prefix)
void
visitDocIDs(PointValues.IntersectVisitor visitor)
Visit all the docs below the current node.void
visitDocValues(PointValues.IntersectVisitor visitor)
Visit all the docs and values below the current node.
-
-
-
Field Detail
-
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
private final IndexInput in
-
-
Constructor Detail
-
SimpleTextPointTree
private SimpleTextPointTree(IndexInput in, int nodeID, int level, byte[] minPackedValue, byte[] maxPackedValue)
-
-
Method Detail
-
getTreeDepth
private int getTreeDepth(int numLeaves)
-
clone
public PointValues.PointTree 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 classjava.lang.Object
-
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
public void visitDocIDs(PointValues.IntersectVisitor visitor) throws java.io.IOException
Description copied from interface:PointValues.PointTree
Visit all the docs below the current node.- Specified by:
visitDocIDs
in interfacePointValues.PointTree
- Throws:
java.io.IOException
-
addAll
public void addAll(PointValues.IntersectVisitor visitor, boolean grown) throws java.io.IOException
- Throws:
java.io.IOException
-
visitDocValues
public void visitDocValues(PointValues.IntersectVisitor visitor) throws java.io.IOException
Description copied from interface:PointValues.PointTree
Visit all the docs and values below the current node.- Specified by:
visitDocValues
in interfacePointValues.PointTree
- Throws:
java.io.IOException
-
readDocIDs
int readDocIDs(IndexInput in, long blockFP, int[] docIDs) throws java.io.IOException
- Throws:
java.io.IOException
-
isLeafNode
public boolean isLeafNode()
-
parseInt
private int parseInt(BytesRefBuilder scratch, BytesRef prefix)
-
stripPrefix
private java.lang.String stripPrefix(BytesRefBuilder scratch, BytesRef prefix)
-
startsWith
private boolean startsWith(BytesRefBuilder scratch, BytesRef prefix)
-
readLine
private void readLine(IndexInput in, BytesRefBuilder scratch) throws java.io.IOException
- Throws:
java.io.IOException
-
-