Package gridool

Examples of gridool.GridException


        try {
            directory.prefixSearch(k, collector);
        } catch (DbException e) {
            String errmsg = "prefixSearch failed: " + colPath;
            LOG.error(errmsg);
            throw new GridException(errmsg, e);
        }
        final Map<String, List<GridNode>> mapping = collector.getMapping();
        if(mapping.isEmpty()) {// no mapping found
            return Collections.emptyMap();
        }
View Full Code Here


        final Future<Sequence<? extends Item>> future = grid.execute(QueryExecJob.class, this);
        try {
            return future.get();
        } catch (InterruptedException ie) {
            LOG.error(ie.getMessage(), ie);
            throw new GridException(ie.getMessage(), ie);
        } catch (ExecutionException ee) {
            LOG.error(ee.getMessage(), ee);
            throw new GridException(ee.getMessage(), ee);
        }
    }
View Full Code Here

                try {
                    directory.exactSearch(k, collector);
                } catch (DbException e) {
                    String errmsg = "Exception caused while lookup: " + path;
                    LOG.error(errmsg, e);
                    throw new GridException(errmsg, e);
                }
                final List<GridNode> replicatedNodes = collector.getMatched();
                if(replicatedNodes == null || replicatedNodes.isEmpty()) {
                    throw new GridException("No replicated document found for path: " + path);
                }
                // TODO Select a node that least recently used for write requests.
                GridNode node = nodeSelector.selectNode(replicatedNodes, config);
                assert (node != null);
                List<String> mappedPaths = assignMap.get(node);
View Full Code Here

        final Sequence<? extends Item> result;
        try {
            result = bodyExpr.eval(ValueSequence.EMPTY_SEQUENCE, DynamicContext.DUMMY);
        } catch (XQueryException e) {
            throw new GridException(e);
        }
        return wrapResult(result, this, forwardingEnabled, queryShipping);
    }
View Full Code Here

            final List<Pair<String, Lock>> fileResources = e.getValue();

            DbCollection col = DbCollection.getCollection(colpath);
            File colDir = col.getDirectory();
            if(!colDir.exists()) {
                throw new GridException("Collection not found: " + colpath);
            }

            for(Pair<String, Lock> rsc : fileResources) {
                String fname = rsc.getFirst();
                File docFile = new File(colDir, fname + IDocumentTable.DTM_SEGMENT_FILE_SUFFIX);
                if(!docFile.exists()) {
                    throw new GridException("Document not found: " + docFile.getAbsolutePath());
                }
                LazyDTMDocument doc = new LazyDTMDocument(fname, col, DynamicContext.DUMMY);
                Lock lock = rsc.getSecond();
                assert (lock != null);
                doc.setLock(lock);
View Full Code Here

        final Set<GridNode> mapableNodes = CollectionUtils.asSet(liveNodes);
        final Map<String, List<GridNode>> mapping;
        try {
            mapping = directory.prefixSearch(colPath, mapableNodes);
        } catch (DbException e) {
            throw new GridException("prefixSearch failed: " + colPath, e);
        }
        if(mapping.isEmpty()) {// no mapping found
            return Collections.emptyMap();
        }
View Full Code Here

        final Future<Sequence<? extends Item>> future = grid.execute(QueryExecJob.class, this);
        try {
            return future.get();
        } catch (InterruptedException ie) {
            LOG.error(ie.getMessage());
            throw new GridException(ie.getMessage(), ie);
        } catch (ExecutionException ee) {
            LOG.error(ee.getMessage());
            throw new GridException(ee.getMessage(), ee);
        }
    }
View Full Code Here

                final List<GridNode> replicatedNodes;
                try {
                    replicatedNodes = directory.exactSearch(path, excludeNodeList);
                } catch (DbException e) {
                    LOG.error(e.getMessage());
                    throw new GridException("Exception caused while lookup: " + path, e);
                }
                if(replicatedNodes == null || replicatedNodes.isEmpty()) {
                    throw new GridException("No replicated document found for path: " + path);
                }
                // TODO Select a node that least recently used for write requests.
                GridNode node = nodeSelector.selectNode(replicatedNodes, this, config);
                assert (node != null);
                List<String> mappedPaths = assignMap.get(node);
View Full Code Here

        final Sequence<? extends Item> result;
        try {
            result = bodyExpr.eval(ValueSequence.EMPTY_SEQUENCE, DynamicContext.DUMMY);
        } catch (XQueryException e) {
            LOG.error(e.getMessage(), e);
            throw new GridException(e);
        }
        return wrapResult(result, this, forwardingEnabled, queryShipping);
    }
View Full Code Here

            final List<Pair<String, Lock>> fileResources = e.getValue();

            DbCollection col = DbCollection.getCollection(colpath);
            File colDir = col.getDirectory();
            if(!colDir.exists()) {
                throw new GridException("Collection not found: " + colpath);
            }

            for(Pair<String, Lock> rsc : fileResources) {
                String fname = rsc.getFirst();
                File docFile = new File(colDir, fname + IDocumentTable.DTM_SEGMENT_FILE_SUFFIX);
                if(!docFile.exists()) {
                    throw new GridException("Document not found: " + docFile.getAbsolutePath());
                }
                LazyDTMDocument doc = new LazyDTMDocument(fname, col, DynamicContext.DUMMY);
                Lock lock = rsc.getSecond();
                assert (lock != null);
                doc.setLock(lock);
View Full Code Here

TOP

Related Classes of gridool.GridException

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.