Package org.chaidb.db.index.btree

Examples of org.chaidb.db.index.btree.DataPage


        final PageBufferManager buffer = btree.getBuffer();
        final BTreeSpec btreeSpec = btree.getBTreeSpec();
        PageNumber dupPageNumber = new PageNumber(nodePos.getPageNo());
        try {
            DataPage curDataPage = new DataPage(btree.getBtreeId(), dupPageNumber, btreeSpec, buffer);
            DataNode curDataNode = new DataNode(curDataPage, nodePos.getOffsetInPage());
            curDataNode.setFlags(BTreeSpec.DATA_NODE_DUP_NEXT);
            byte[] oldData = ByteTool.copyByteArray(curDataNode.getPage().getPage(), curDataNode.getNodeOffset(), (int) curDataNode.getNodeSpace());
            byte[] data = new byte[8];
            ByteTool.intToBytes(data, 0, nextNodePos.getOffsetInPage());
View Full Code Here


        final PageBufferManager buffer = btree.getBuffer();
        final BTreeSpec btreeSpec = btree.getBTreeSpec();
        PageNumber dupPageNumber = new PageNumber(nPageNo);

        try {
            DataPage dupDataPage = new DataPage(id, dupPageNumber, btreeSpec, buffer);
            int pageCount = 0;
            while (pageCount < page && !finished) {
                NodeInfo node = new NodeInfo();
                node.nodePosition = bulkNextNodePos;
                int ret = getNode(dupDataPage, node);
                bulkNextNodePos = node.nodeNextPosition;
                if ((ret & DUP_FINISHED) == DUP_FINISHED) {
                    finished = true;
                    if ((ret & DUP_NEXT) == DUP_NEXT) {
                        break;
                    }
                }
                if ((ret & DUP_DATA) == DUP_DATA) {
                    cache.add(node);
                } else if ((ret & DUP_NEXT) == DUP_NEXT) {
                    if (bulkNextNodePos.getPageNo() == nPageNo) {
                        continue;
                    } else {
                        if (cache.size() > 0) {
                            pageCount++;
                        }
                        if (pageCount < page) {
                            nPageNo = bulkNextNodePos.getPageNo();
                            buffer.releasePage(id, dupPageNumber, false);
                            dupPageNumber = new PageNumber(nPageNo);
                            dupDataPage = new DataPage(id, dupPageNumber, btreeSpec, buffer);
                        }
                    }
                } else {
                    logger.error("Failed to get next dup node.");
                }
View Full Code Here

        dupNextCountForNextNode = 0;

        int curPageNo = nodePos.getPageNo();
        PageNumber dupPageNumber = new PageNumber(curPageNo);
        try {
            DataPage dupDataPage = new DataPage(id, dupPageNumber, btreeSpec, buffer);
            NodeInfo node = new NodeInfo();
            node.nodePosition = nodePos;
            while (true) {
                int ret = getNode(dupDataPage, node);
                if ((ret & DUP_FINISHED) == DUP_FINISHED) {
                    finished = true;
                    if ((ret & DUP_NEXT) == DUP_NEXT) {
                        break;
                    }
                }
                if ((ret & DUP_DATA) == DUP_DATA) {
                    return node;
                } else if ((ret & DUP_NEXT) == DUP_NEXT) {
                    node.nodePosition = node.nodeNextPosition;
                    if (node.nodeNextPosition.getPageNo() != curPageNo) {
                        curPageNo = node.nodeNextPosition.getPageNo();
                        buffer.releasePage(id, dupPageNumber, false);
                        dupPageNumber = new PageNumber(curPageNo);
                        dupDataPage = new DataPage(id, dupPageNumber, btreeSpec, buffer);
                    }
                } else {
                    logger.error("Failed to get next dup node.");
                    break;
                }
View Full Code Here

TOP

Related Classes of org.chaidb.db.index.btree.DataPage

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.