Package xbird.xquery

Examples of xbird.xquery.XQRTException


                BTreeIndexer indexer = new BTreeIndexer(idxFile);
                final IndexMatch matched;
                try {
                    matched = indexer.find(idxCond);
                } catch (DbException e) {
                    throw new XQRTException("failed to query index: " + idxFile.getAbsolutePath(), e);
                }
                final long[] ptrs = filter(matched.getMatchedUnsorted(), docName, idxFile);
                final int matchCounts = ptrs.length;
                if(LOG.isInfoEnabled()) {
                    LOG.info("Index scan done. matched: " + matched.countMatched() + ", filtered: "
View Full Code Here


            for(int i = 0; i < CACHE_SIZE; i++) {
                final long old;
                try {
                    old = pathIndexer.add(keys[i], values[i]);
                } catch (DbException e) {
                    throw new XQRTException("failed flushing PathIndexer. key: " + keys[i]
                            + ", value: " + values[i], e);
                }
                if(old != -1L) {
                    ++pathIdxDuplicates;
                }
View Full Code Here

            final byte[][] labels = labelValues;
            for(int i = 0; i < CACHE_SIZE; i++) {
                try {
                    labelIndexer.putValue(rowids[i], labels[i]);
                } catch (DbException e) {
                    throw new XQRTException("failed flushing PathIndexer. DTM_ROWID: " + rowids[i]
                            + ", LABEL: " + labels[i], e);
                }
            }
            labelIdxEntries += CACHE_SIZE;
            labelCachePtr = 0;
View Full Code Here

            for(int i = 0; i < pathCachePtr; i++) {
                final long old;
                try {
                    old = pathIndexer.add(keys[i], values[i]);
                } catch (DbException e) {
                    throw new XQRTException("failed flushing PathIndexer. key: " + keys[i]
                            + ", value: " + values[i], e);
                }
                if(old != -1L) {
                    ++pathIdxDuplicates;
                }
            }
            pathIdxEntries += pathCachePtr;
            pathCachePtr = 0;
        }
        if(labelCachePtr > 0) {
            final long[] rowids = labelKeys;
            final byte[][] labels = labelValues;
            for(int i = 0; i < labelCachePtr; i++) {
                try {
                    labelIndexer.putValue(rowids[i], labels[i]);
                } catch (DbException e) {
                    throw new XQRTException("failed flushing PathIndexer. DTM_ROWID: " + rowids[i]
                            + ", LABEL: " + labels[i], e);
                }
            }
            labelIdxEntries += labelCachePtr;
            labelCachePtr = 0;
        }

        try {
            pathIndexer.flush(true);
            //valueIndexer.flush(true);
            labelIndexer.flush(true, true);
        } catch (DbException dbe) {
            throw new XQRTException("failed flushing indexer", dbe);
        }

        final long pathPages = pathIndexer.getPageCount();
        docProps.setProperty(PATHS_IDX_PAGES + docName, String.valueOf(pathPages));
        docProps.setProperty(PATHS_IDX_ENTRIES + docName, String.valueOf(pathIdxEntries));
View Full Code Here

                factory.setNamespaceAware(true);
                SAXParser parser = factory.newSAXParser();
                myReader = parser.getXMLReader();
            }
        } catch (Exception e) {
            throw new XQRTException("Creating SAX XMLReader failed", e);
        }
        // setup handlers (requires saxHandler)
        myReader.setContentHandler(handler);
        try {
            myReader.setProperty("http://xml.org/sax/properties/lexical-handler", handler);
            myReader.setFeature("http://xml.org/sax/features/validation", true);
            if(!parseAsHtml) {
                myReader.setFeature("http://apache.org/xml/features/validation/dynamic", true);
                myReader.setFeature("http://apache.org/xml/features/validation/schema", true);
            }
        } catch (Exception e) {
            throw new XQRTException("Configuaring SAX XMLReader failed.", e);
        }
        // setup entity resolver
        if(resolveEntity) {
            org.apache.xml.resolver.CatalogManager catalog = org.apache.xml.resolver.CatalogManager.getStaticManager();
            catalog.setIgnoreMissingProperties(true);
View Full Code Here

        public void writeExternal(ObjectOutput out) throws IOException {
            final XQEventEncoder encoder = new XQEventEncoder(out);
            try {
                encoder.emit(this);
            } catch (XQueryException xqe) {
                throw new XQRTException(xqe);
            } catch (Throwable e) {
                LOG.fatal(e);
                throw new IllegalStateException("failed encoding", e);
            }
        }
View Full Code Here

            final XQEventDecoder decoder = new XQEventDecoder(in);
            final Sequence<Item> decoded;
            try {
                decoded = decoder.decode();
            } catch (IOException ioe) {
                throw new XQRTException("decode failed", ioe);
            } catch (XQueryException xqe) {
                throw new XQRTException(xqe);
            } catch (Throwable e) {
                throw new IllegalStateException("decode failed", e);
            }
            this._toReplace = decoded;
        }
View Full Code Here

        private QualifiedName(String nsuri, String localName, String prefix) {
            assert (nsuri != null && localName != null);
            assert (prefix != null);
            if(localName.length() != 0 && !NodeTest.ANY.equals(localName)
                    && !XMLUtils.isNCName(localName)) {
                throw new XQRTException("err:XPST0081", "Illegally specified a non-ncname string as name: "
                        + localName);
            }
            if("*".equals(prefix)) {
                this.nsuri = "*";// hack
            } else {
View Full Code Here

                if(count == _fetchSize) {
                    break;
                }
            }
        } catch (IOException ioe) {
            throw new XQRTException("failed to deserialize the fetched items", ioe);
        } catch (ClassNotFoundException cnf) {
            throw new XQRTException("failed to deserialize the fetched items", cnf);
        }
        return count;
    }
View Full Code Here

        final int fetchedLength;
        try {
            ois = new ObjectInputStream(is);
            fetchedLength = ois.readInt();
        } catch (IOException ioe) {
            throw new XQRTException("failed to deserialize the fetched items", ioe);
        }
        try {
            for(int i = 0; i < fetchedLength; i++) {
                Object ro = ois.readObject();
                Item fetched = (Item) ro;
                _fetchedQueue.offer(fetched);
            }
        } catch (IOException ioe) {
            throw new XQRTException("failed to deserialize the fetched items", ioe);
        } catch (ClassNotFoundException cnf) {
            throw new XQRTException("failed to deserialize the fetched items", cnf);
        }
        return fetchedLength;
    }
View Full Code Here

TOP

Related Classes of xbird.xquery.XQRTException

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.