Package org.chaidb.db.index.btree.bufmgr

Examples of org.chaidb.db.index.btree.bufmgr.Page


    public static BTreePage newPage(BTreeSpec btreeSpec, PageBufferManager buffer, KernelContext kContext) throws ChaiDBException {
        int txnId = kContext.getLocker();
        boolean needLog = kContext.getNeedLog();

        BTreePage newPage = new BTreePage(btreeSpec, buffer);
        Page freePageInfo = buffer.getFreePage(btreeSpec, false, kContext);

        newPage.setLogInfo(txnId, needLog);

        /* begin:added by marriane 2001-9-29 for logging newPage log record */
        if (needLog) {
            int newPageNo = freePageInfo.getPageNumber().getPageNumber();

            BTreeNewPageLogRecord logRec = new BTreeNewPageLogRecord(freePageInfo.getPageNumber().getTreeId(), newPageNo, txnId, 1, -1, btreeSpec.btree.getType());
            logRec.log();
        }
        /* end:added by marriane for logging newPage log record */

        newPage.page = freePageInfo.getPageData();
        newPage.setPageNumber(freePageInfo.getPageNumber());

        //the following code may generate log records.
        newPage.setLogInfo(txnId, false);
        newPage.setInternal();
        newPage.setNextPage(new PageNumber(BTreeSpec.INVALID_PAGENO));
View Full Code Here


        int txnId = kContext.getLocker();
        boolean needLog = kContext.getNeedLog();

        DataPage newPage = new DataPage(btreeSpec, buffer);
        Page freePageInfo = buffer.getFreePage(btreeSpec, false, kContext);

        newPage.setLogInfo(txnId, needLog);

        /* begin:added by marriane 2001-9-29 for logging newPage log record */
        int newPageFlag = 0;
        if (isOverflowPage) newPageFlag = 4;
        if (needLog) {
            int newPageNo = freePageInfo.getPageNumber().getPageNumber();

            BTreeNewPageLogRecord logRec = new BTreeNewPageLogRecord(freePageInfo.getPageNumber().getTreeId(), newPageNo, txnId, newPageFlag, docid, btreeSpec.btree.getType());
            logRec.log();
        }
        /* end:added by marriane for logging newPage log record */

        newPage.page = freePageInfo.getPageData();
        newPage.setPageNumber(freePageInfo.getPageNumber());

        newPage.setLogInfo(txnId, false);

        // ### not write to page yet!
        newPage.setNodes((short) 0);
View Full Code Here

TOP

Related Classes of org.chaidb.db.index.btree.bufmgr.Page

Copyright © 2018 www.massapicom. 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.