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 ; }
if ( path.getPath().size() > 2) { List<AccessStep> y = path.getPath().subList(0, path.getPath().size()-2) ; Optional<AccessStep> z = y.stream().filter(e -> e.node.isLeaf() ).findFirst() ; if ( z.isPresent() ) Optional<AccessStep> z2 = path.getPath().stream().filter(e -> e.node.ptrs.get(e.idx) != e.page.getId()).findFirst() ; if ( z2.isPresent() ) error("promote: path error: %s in %s", z2.get(), path) ; List<AccessStep> steps = path.getPath() ;
if ( path.getPath().size() > 2) { List<AccessStep> y = path.getPath().subList(0, path.getPath().size()-2) ; Optional<AccessStep> z = y.stream().filter(e -> e.node.isLeaf() ).findFirst() ; if ( z.isPresent() ) Optional<AccessStep> z2 = path.getPath().stream().filter(e -> e.node.ptrs.get(e.idx) != e.page.getId()).findFirst() ; if ( z2.isPresent() ) error("promote: path error: %s in %s", z2.get(), path) ; List<AccessStep> steps = path.getPath() ;