Package org.exist.storage.btree

Examples of org.exist.storage.btree.BTreeException


            do {
                nodeID = nodeID.getParentId();
                if (nodeID == null) {
                    SanityCheck.TRACE("Node " + node.getDocument().getDocId() + ":" +
                        nodeID + " not found.");
                    throw new BTreeException("Node " + nodeID + " not found.");
                }
                if (nodeID == NodeId.DOCUMENT_NODE) {
                    SanityCheck.TRACE("Node " + node.getDocument().getDocId() + ":" +
                            nodeID + " not found.");
                    throw new BTreeException("Node " + nodeID + " not found.");
                }
                final NativeBroker.NodeRef parentRef = new NativeBroker.NodeRef(doc.getDocId(), nodeID);
                try {
                    parentPointer = findValue(parentRef);
                } catch (final BTreeException bte) {
                    LOG.error("report me", bte);
                }
            } while (parentPointer == KEY_NOT_FOUND);
            try {
                final NodeProxy parent = new NodeProxy(doc, nodeID, parentPointer);
                final EmbeddedXMLStreamReader cursor = broker.getXMLStreamReader(parent, true);
                while(cursor.hasNext()) {
                    final int status = cursor.next();
                    if (status != XMLStreamReader.END_ELEMENT) {
                        final NodeId nextId = (NodeId) cursor.getProperty(EmbeddedXMLStreamReader.PROPERTY_NODE_ID);
                        if (nextId.equals(node.getNodeId())) {
                            return cursor.getCurrentPosition();
                        }
                    }
                }
                if (LOG.isDebugEnabled())
                    {LOG.debug("Node " + node.getNodeId() + " could not be found. Giving up. This is usually not an error.");}
                return KEY_NOT_FOUND;
            } catch (final XMLStreamException e) {
                SanityCheck.TRACE("Node " + node.getDocument().getDocId() + ":" + node.getNodeId() + " not found.");
                throw new BTreeException("Node " + node.getNodeId() + " not found.");
            }
        } else {
            return pointer;
        }
    }
View Full Code Here

TOP

Related Classes of org.exist.storage.btree.BTreeException

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.