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 IndexInputin(package private) intlevelprivate byte[]maxPackedValueprivate byte[]minPackedValue(package private) intnodeID(package private) introotNode(package private) int[]scratchDocIDs(package private) byte[]scratchPackedValueprivate int[]splitDimsprivate byte[][]splitDimValueStack
-
Constructor Summary
Constructors Modifier Constructor Description privateSimpleTextPointTree(IndexInput in, int nodeID, int level, byte[] minPackedValue, byte[] maxPackedValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAll(PointValues.IntersectVisitor visitor, boolean grown)private intbalanceTreeNodePosition(int minNode, int maxNode, int node, int position, int level)PointValues.PointTreeclone()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 intgetNumLeavesSlow(int node)private intgetTreeDepth(int numLeaves)booleanisLeafNode()booleanmoveToChild()Move to the first child node and returntrueupon success.booleanmoveToParent()Move to the parent node and returntrueupon success.booleanmoveToSibling()Move to the next sibling node and returntrueupon success.private intparseInt(BytesRefBuilder scratch, BytesRef prefix)private voidpop(boolean isLeft)private voidpushLeft()private voidpushRight()(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 java.lang.StringstripPrefix(BytesRefBuilder scratch, BytesRef prefix)voidvisitDocIDs(PointValues.IntersectVisitor visitor)Visit all the docs below the current node.voidvisitDocValues(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.PointTreeClone, the current node becomes the root of the new tree.- Specified by:
clonein interfacePointValues.PointTree- Overrides:
clonein classjava.lang.Object
-
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
public void visitDocIDs(PointValues.IntersectVisitor visitor) throws java.io.IOException
Description copied from interface:PointValues.PointTreeVisit all the docs below the current node.- Specified by:
visitDocIDsin 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.PointTreeVisit all the docs and values below the current node.- Specified by:
visitDocValuesin 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
-
-