private static void error(String msg, Object... args) { msg = format(msg, args) ; System.out.println(msg) ; System.out.flush() ; throw new BPTreeException(msg) ; }
private static void error(String msg, Object... args) { msg = format(msg, args) ; System.out.println(msg) ; System.out.flush() ; throw new BPTreeException(msg) ; }
static void error(String msg, Object... args) { msg = format(msg, args) ; System.out.println() ; System.out.println(msg) ; System.out.flush() ; throw new BPTreeException(msg) ; }
static void error(String msg, Object... args) { msg = format(msg, args) ; System.out.println() ; System.out.println(msg) ; System.out.flush() ; throw new BPTreeException(msg) ; }
@Override public BPTreeNode fromBlock(Block block) { // synchronized - needed for multiple reader? synchronized (block) { int x = block.getByteBuffer().getInt(0) ; BlockType type = getType(x) ; if ( type != BPTREE_BRANCH && type != BPTREE_LEAF ) throw new BPTreeException("Wrong block type: " + type) ; int count = decodeCount(x) ; return overlay(bpTree, block, (type == BPTREE_LEAF), count) ; } }
@Override public BPTreeNode fromBlock(Block block) { // synchronized - needed for multiple reader? synchronized (block) { int x = block.getByteBuffer().getInt(0) ; BlockType type = getType(x) ; if ( type != BPTREE_BRANCH && type != BPTREE_LEAF ) throw new BPTreeException("Wrong block type: " + type) ; int count = decodeCount(x) ; return overlay(bpTree, block, (type == BPTREE_LEAF), count) ; } }
private static void error(String string, Object ...args) { String msg = String.format(string, args) ; System.err.println(msg) ; throw new BPTreeException(msg) ; } }
private static void error(String string, Object ...args) { String msg = String.format(string, args) ; System.err.println(msg) ; throw new BPTreeException(msg) ; } }
/** 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 ; }
/** 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 ; }
throw new BPTreeException( "Node block manager empty = "+nodeManager.getBlockMgr().isEmpty()+ " // "+
throw new BPTreeException( "Node block manager empty = "+nodeManager.getBlockMgr().isEmpty()+ " // "+
/** 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 ; }
int rootId = root.getId() ; if ( rootId != 0 ) throw new BPTreeException("**** Not the root: " + rootId) ;
int rootId = root.getId() ; if ( rootId != 0 ) throw new BPTreeException("**** Not the root: " + rootId) ;
throw new BPTreeException("Delete begins but this is not the root") ;
throw new BPTreeException("Delete begins but this is not the root") ;