final static Record minRecord(BPTreeNode root) { AccessPath path = new AccessPath(root) ; return root.internalMinRecord(path) ; }
final static Record maxRecord(BPTreeNode root) { AccessPath path = new AccessPath(root) ; return root.internalMaxRecord(path) ; }
final static Record maxRecord(BPTreeNode root) { AccessPath path = new AccessPath(root) ; return root.internalMaxRecord(path) ; }
final static Record minRecord(BPTreeNode root) { AccessPath path = new AccessPath(root) ; return root.internalMinRecord(path) ; }
/** 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 ; }
/** Insert a record - return existing value if any, else null */ public static Record insert(BPTreeNode root, Record record) { if ( logging(log) ) { log(log, "** insert(%s) / root=%d", record, root.getId()) ; if ( DumpTree ) root.dump() ; } if ( !root.isRoot() ) throw new BPTreeException("Insert begins but this is not the root") ; if ( root.isFull() ) { // Root full - root split is a special case. splitRoot(root) ; if ( DumpTree ) root.dump() ; } AccessPath path = new AccessPath(root) ; // Root ready - call insert proper. Record result = root.internalInsert(path, record) ; root.internalCheckNodeDeep() ; if ( logging(log) ) { log(log, "** insert(%s) / finish", record) ; if ( DumpTree ) root.dump() ; } return result ; }
/** Insert a record - return existing value if any, else null */ public static Record insert(BPTreeNode root, Record record) { if ( logging(log) ) { log(log, "** insert(%s) / root=%d", record, root.getId()) ; if ( DumpTree ) root.dump() ; } if ( !root.isRoot() ) throw new BPTreeException("Insert begins but this is not the root") ; if ( root.isFull() ) { // Root full - root split is a special case. splitRoot(root) ; if ( DumpTree ) root.dump() ; } AccessPath path = new AccessPath(root) ; // Root ready - call insert proper. Record result = root.internalInsert(path, record) ; root.internalCheckNodeDeep() ; if ( logging(log) ) { log(log, "** insert(%s) / finish", record) ; if ( DumpTree ) root.dump() ; } return result ; }
throw new BPTreeException("Delete begins but this is not the root") ; AccessPath path = new AccessPath(root) ;
throw new BPTreeException("Delete begins but this is not the root") ; AccessPath path = new AccessPath(root) ;