@Override public String toString() { return "("+node.label()+", "+idx+")->"+page.getId() ; } }
@Override public String toString() { return "("+node.label()+", "+idx+")->"+page.getId() ; } }
/** Short form for logging */ protected String label() { return String.format("%d[%s]", getId(), typeMark()) ; }
/** Short form for logging */ protected String label() { return String.format("%d[%s]", getId(), typeMark()) ; }
/** Promote a single page. Assumes the path to this page has been handled in some way elsewhere */ static boolean promote1(BPTreePage page, BPTreeNode node, int idx) { //System.out.println("promote1: "+page.getBlockMgr().getLabel()+" "+page.getBackingBlock().getId()) ; boolean changed = page.promote() ; node.ptrs.set(idx, page.getId()) ; return changed ; }
/** Promote a single page. Assumes the path to this page has been handled in some way elsewhere */ static boolean promote1(BPTreePage page, BPTreeNode node, int idx) { //System.out.println("promote1: "+page.getBlockMgr().getLabel()+" "+page.getBackingBlock().getId()) ; boolean changed = page.promote() ; node.ptrs.set(idx, page.getId()) ; return changed ; }
private BPTreePage rebalance(AccessPath path, BPTreePage node, int idx) { if ( logging(log) ) { log(log, "rebalance(id=%d, idx=%d)", node.getId(), idx) ; log(log, ">> this: %s", this) ; log(log, ">> node: %s", node) ; promote1(left, this, idx-1 ) ; if ( logging(log) ) log(log, "rebalance/merge/left: left=%d n=%d [%d]", left.getId(), node.getId(), idx - 1) ; if ( BPT.CheckingNode && left.getId() == node.getId() ) BPT.error("Left and n the same: %s", left) ; BPTreePage page = merge(left, node, idx - 1) ; log(log, "rebalance/merge/right: n=%d right=%d [%d]", node.getId(), right.getId(), idx) ; if ( BPT.CheckingNode && right.getId() == node.getId() ) BPT.error("N and right the same: %s", right) ; BPTreePage page = merge(node, right, idx) ;
private BPTreePage rebalance(AccessPath path, BPTreePage node, int idx) { if ( logging(log) ) { log(log, "rebalance(id=%d, idx=%d)", node.getId(), idx) ; log(log, ">> this: %s", this) ; log(log, ">> node: %s", node) ; promote1(left, this, idx-1 ) ; if ( logging(log) ) log(log, "rebalance/merge/left: left=%d n=%d [%d]", left.getId(), node.getId(), idx - 1) ; if ( BPT.CheckingNode && left.getId() == node.getId() ) BPT.error("Left and n the same: %s", left) ; BPTreePage page = merge(left, node, idx - 1) ; log(log, "rebalance/merge/right: n=%d right=%d [%d]", node.getId(), right.getId(), idx) ; if ( BPT.CheckingNode && right.getId() == node.getId() ) BPT.error("N and right the same: %s", right) ; BPTreePage page = merge(node, right, idx) ;