Class BKDReader.BKDPointTree

    • Field Detail

      • nodeID

        private int nodeID
      • nodeRoot

        private final int nodeRoot
      • level

        private int level
      • 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
      • 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
      • isTreeBalanced

        private final boolean isTreeBalanced
    • Constructor Detail

      • BKDPointTree

        private BKDPointTree​(IndexInput innerNodes,
                             IndexInput leafNodes,
                             BKDConfig config,
                             int numLeaves,
                             int version,
                             long pointCount,
                             byte[] minPackedValue,
                             byte[] maxPackedValue,
                             boolean isTreeBalanced)
                      throws java.io.IOException
        Throws:
        java.io.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 Detail

      • moveToChild

        public boolean moveToChild()
                            throws java.io.IOException
        Description copied from interface: PointValues.PointTree
        Move to the first child node and return true upon success. Returns false for leaf nodes and true otherwise.
        Specified by:
        moveToChild in interface PointValues.PointTree
        Throws:
        java.io.IOException
      • resetNodeDataPosition

        private void resetNodeDataPosition()
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • pushBoundsLeft

        private void pushBoundsLeft()
      • pushLeft

        private void pushLeft()
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • pushBoundsRight

        private void pushBoundsRight()
      • pushRight

        private void pushRight()
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • moveToSibling

        public boolean moveToSibling()
                              throws java.io.IOException
        Description copied from interface: PointValues.PointTree
        Move to the next sibling node and return true upon success. Returns false if the current node has no more siblings.
        Specified by:
        moveToSibling in interface PointValues.PointTree
        Throws:
        java.io.IOException
      • pop

        private void pop()
      • popBounds

        private void popBounds​(byte[] packedValue)
      • moveToParent

        public boolean moveToParent()
        Description copied from interface: PointValues.PointTree
        Move to the parent node and return true upon success. Returns false for the root node and true otherwise.
        Specified by:
        moveToParent in interface PointValues.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!
      • sizeFromBalancedTree

        private long sizeFromBalancedTree​(int leftMostLeafNode,
                                          int rightMostLeafNode)
      • balanceTreeNodePosition

        private int balanceTreeNodePosition​(int minNode,
                                            int maxNode,
                                            int node,
                                            int position,
                                            int level)
      • addAll

        public void addAll​(PointValues.IntersectVisitor visitor,
                           boolean grown)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • visitLeavesOneByOne

        private void visitLeavesOneByOne​(PointValues.IntersectVisitor visitor)
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • visitDocValues

        private void visitDocValues​(PointValues.IntersectVisitor visitor,
                                    long fp)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • getNumLeavesSlow

        private int getNumLeavesSlow​(int node)
      • readNodeData

        private void readNodeData​(boolean isLeft)
                           throws java.io.IOException
        Throws:
        java.io.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 java.io.IOException
        Throws:
        java.io.IOException
      • visitDocValuesWithCardinality

        private void visitDocValuesWithCardinality​(int[] commonPrefixLengths,
                                                   byte[] scratchDataPackedValue,
                                                   byte[] scratchMinIndexPackedValue,
                                                   byte[] scratchMaxIndexPackedValue,
                                                   IndexInput in,
                                                   BKDReader.BKDReaderDocIDSetIterator scratchIterator,
                                                   int count,
                                                   PointValues.IntersectVisitor visitor)
                                            throws java.io.IOException
        Throws:
        java.io.IOException
      • readMinMax

        private void readMinMax​(int[] commonPrefixLengths,
                                byte[] minPackedValue,
                                byte[] maxPackedValue,
                                IndexInput in)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • readCompressedDim

        private int readCompressedDim​(IndexInput in)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • readCommonPrefixes

        private void readCommonPrefixes​(int[] commonPrefixLengths,
                                        byte[] scratchPackedValue,
                                        IndexInput in)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object