Package org.chaidb.db.log.logrecord

Examples of org.chaidb.db.log.logrecord.BTreeReplLogRecord.log()


                int newPageNo = page.pageNumber.getPageNumber();
                byte[] newData = ByteTool.append(this.getHeader(), data);
                if (oldData != null && (oldData != newData)) {
                    /* replace old data with new data*/
                    BTreeReplLogRecord logRec = new BTreeReplLogRecord(page.getPageNumber().getTreeId(), newPageNo, txnId, nodeOffset, oldData, newData, page.btreeSpec.btree.getType());
                    logRec.log();
                } else {
                    if (page.btreeSpec.btree.getType() == IDBIndex.HYPER_BTREE) {
                        BTreeAddRemoveLogRecord logRec = new BTreeAddRemoveLogRecord(page.getPageNumber().getTreeId(), newPageNo, txnId, BTreeAddRemoveLogRecord.ADD_FLAG, nodeOffset, newData, page.btreeSpec.btree.getType());
                        logRec.log();
                    }
View Full Code Here


                    BTreeReplLogRecord logRec = new BTreeReplLogRecord(page.getPageNumber().getTreeId(), newPageNo, txnId, nodeOffset, oldData, newData, page.btreeSpec.btree.getType());
                    logRec.log();
                } else {
                    if (page.btreeSpec.btree.getType() == IDBIndex.HYPER_BTREE) {
                        BTreeAddRemoveLogRecord logRec = new BTreeAddRemoveLogRecord(page.getPageNumber().getTreeId(), newPageNo, txnId, BTreeAddRemoveLogRecord.ADD_FLAG, nodeOffset, newData, page.btreeSpec.btree.getType());
                        logRec.log();
                    }
                }
            }
            // add the new node
            System.arraycopy(this.getHeader(), 0, page.getPage(), nodeOffset, BTreeSpec.DATA_NODE_HEADER_SIZE);
View Full Code Here

                    System.arraycopy(ByteTool.intToBytes(4), 0, newV, BTreeSpec.OFF_FLAGS, 4);
                    System.arraycopy(ByteTool.shortToBytes((short) (overflowPage.upperBound - requireSpace)), 0, newV, BTreeSpec.OFF_UPPERBOUND, 2);
                    System.arraycopy(ByteTool.intToBytes(last.pageNumber.getPageNumber(), overflowPage.btreeSpec.getMsbFirst()), 0, newV, BTreeSpec.OFF_PREVPAGE, 4);
                    if (newV != oldV) {
                        BTreeReplLogRecord lr = new BTreeReplLogRecord(overflowPage.getPageNumber().getTreeId(), pgno, txnId, 0, oldV, newV, overflowPage.btreeSpec.btree.getType());
                        lr.log();
                    }
                }

                overflowPage.setUpperBound((short) (overflowPage.upperBound - requireSpace));
                overflowPage.setPrevPage(last.pageNumber);
View Full Code Here

        if (page.needLog) {
            int newPageNo = page.getPageNumber().getPageNumber();
            byte[] newData = ByteTool.append(this.getHeader(), ByteTool.intToBytes(pn.getPageNumber()));
            if (oldData != null && (newData != oldData)) {
                BTreeReplLogRecord logRec = new BTreeReplLogRecord(page.getPageNumber().getTreeId(), newPageNo, page.txnId, nodeOffset, oldData, newData, page.btreeSpec.btree.getType());
                logRec.log();
            } else {
                BTreeAddRemoveLogRecord logRec = new BTreeAddRemoveLogRecord(page.getPageNumber().getTreeId(), newPageNo, page.txnId, BTreeAddRemoveLogRecord.ADD_FLAG, nodeOffset, newData, page.btreeSpec.btree.getType());
                logRec.log();
            }
        }
View Full Code Here

            if (oldData != null && (newData != oldData)) {
                BTreeReplLogRecord logRec = new BTreeReplLogRecord(page.getPageNumber().getTreeId(), newPageNo, page.txnId, nodeOffset, oldData, newData, page.btreeSpec.btree.getType());
                logRec.log();
            } else {
                BTreeAddRemoveLogRecord logRec = new BTreeAddRemoveLogRecord(page.getPageNumber().getTreeId(), newPageNo, page.txnId, BTreeAddRemoveLogRecord.ADD_FLAG, nodeOffset, newData, page.btreeSpec.btree.getType());
                logRec.log();
            }
        }
        // add the new node to the current page
        System.arraycopy(this.getHeader(), 0, page.getPage(), nodeOffset, BTreeSpec.DATA_NODE_HEADER_SIZE);
        // last pageNumber is the one we need here!!
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.