/** Find a record, using the active comparator */ public static Record search(BPTreeNode root, Record rec) { root.internalCheckNodeDeep() ; if ( ! root.isRoot() ) throw new BPTreeException("Search not starting from the root: " + root) ; AccessPath path = new AccessPath(root) ; Record r = root.internalSearch(path, rec) ; return r ; }
private BPTreeRecords loadStack(BPTreeNode node) { AccessPath path = new AccessPath(null) ; node.bpTree.startReadBlkMgr(); if ( minRecord == null ) node.internalMinRecord(path) ; else node.internalSearch(path, minRecord) ; List<AccessStep> steps = path.getPath() ; for ( AccessStep step : steps ) { BPTreeNode n = step.node ; Iterator<BPTreePage> it = n.iterator(minRecord, maxRecord) ; if ( it == null || ! it.hasNext() ) continue ; BPTreePage p = it.next() ; stack.push(it) ; } BPTreePage p = steps.get(steps.size()-1).page ; if ( ! ( p instanceof BPTreeRecords ) ) throw new InternalErrorException("Last path step not to a records block") ; node.bpTree.finishReadBlkMgr(); return (BPTreeRecords)p ; }
private BPTreeRecords loadStack(BPTreeNode node) { AccessPath path = new AccessPath(null) ; node.bpTree.startReadBlkMgr(); if ( minRecord == null ) node.internalMinRecord(path) ; else node.internalSearch(path, minRecord) ; List<AccessStep> steps = path.getPath() ; for ( AccessStep step : steps ) { BPTreeNode n = step.node ; Iterator<BPTreePage> it = n.iterator(minRecord, maxRecord) ; if ( it == null || ! it.hasNext() ) continue ; BPTreePage p = it.next() ; stack.push(it) ; } BPTreePage p = steps.get(steps.size()-1).page ; if ( ! ( p instanceof BPTreeRecords ) ) throw new InternalErrorException("Last path step not to a records block") ; node.bpTree.finishReadBlkMgr(); return (BPTreeRecords)p ; }
private BPTreeRecords loadStack(BPTreeNode node) { AccessPath path = new AccessPath(null) ; node.bpTree.startReadBlkMgr(); if ( minRecord == null ) node.internalMinRecord(path) ; else node.internalSearch(path, minRecord) ; List<AccessStep> steps = path.getPath() ; for ( AccessStep step : steps ) { BPTreeNode n = step.node ; Iterator<BPTreePage> it = n.iterator(minRecord, maxRecord) ; if ( it == null || ! it.hasNext() ) continue ; BPTreePage p = it.next() ; stack.push(it) ; } BPTreePage p = steps.get(steps.size()-1).page ; if ( ! ( p instanceof BPTreeRecords ) ) throw new InternalErrorException("Last path step not to a records block") ; node.bpTree.finishReadBlkMgr(); return (BPTreeRecords)p ; }
private BPTreeRecords loadStack(BPTreeNode node) { AccessPath path = new AccessPath(null) ; node.bpTree.startReadBlkMgr(); if ( minRecord == null ) node.internalMinRecord(path) ; else node.internalSearch(path, minRecord) ; List<AccessStep> steps = path.getPath() ; for ( AccessStep step : steps ) { BPTreeNode n = step.node ; Iterator<BPTreePage> it = n.iterator(minRecord, maxRecord) ; if ( it == null || ! it.hasNext() ) continue ; BPTreePage p = it.next() ; stack.push(it) ; } BPTreePage p = steps.get(steps.size()-1).page ; if ( ! ( p instanceof BPTreeRecords ) ) throw new InternalErrorException("Last path step not to a records block") ; node.bpTree.finishReadBlkMgr(); return (BPTreeRecords)p ; }
/** Find a record, using the active comparator */ public static Record search(BPTreeNode root, Record rec) { root.internalCheckNodeDeep() ; if ( ! root.isRoot() ) throw new BPTreeException("Search not starting from the root: " + root) ; AccessPath path = new AccessPath(root) ; Record r = root.internalSearch(path, rec) ; return r ; }