Package xbird.storage

Examples of xbird.storage.DbCollection


        }
        CommandRequest command = (CommandRequest) request;
        String[] cmdArg = command.getArgs();
        String baseCol = command.getBaseCollection();

        DbCollection contextCol = DbCollection.getCollection(baseCol);
        Session session = new Session(contextCol);
        CommandInvoker invoker = new CommandInvoker(session);

        _runningThreads.put(rc, Thread.currentThread());
        try {
View Full Code Here


    }

    private void run(String[] args) {
        prepArgs(args);
        if(colpath != null) {
            final DbCollection col;
            try {
                col = DbCollection.getRootCollection().createCollection(colpath);
            } catch (DbException e) {
                throw new IllegalStateException("create collection failed: " + colpath, e);
            }
View Full Code Here

        String colPath = arg2.stringValue();
        File docFile = new File(docPath);
        if(!docFile.exists()) {
            return ValueSequence.EMPTY_SEQUENCE;
        }
        DbCollection col = DbCollection.getCollection(colPath);
        if(col == null) {
            return ValueSequence.EMPTY_SEQUENCE;
        }
        final IDocumentTable doc;
        try {
View Full Code Here

            }
            final Profiler profiler = _dynEnv.getProfiler();
            final Iterator<Pair<DbCollection, String>> itor = ffcous.eachDocument();
            while(itor.hasNext()) {
                final Pair<DbCollection, String> pair = itor.next();
                final DbCollection col = pair.getFirst();
                final String docName = pair.getSecond();
                final File idxFile = getIndexFile(col, docName);
                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);
                }
                // TODO REVIEWME sort really required?
                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: "
                            + matchCounts);
                }
                if(matchCounts > 0) {
                    final IDocumentTable doctbl;
                    try {
                        doctbl = DocumentTableLoader.load(col, docName, _dynEnv);
                    } catch (IOException e) {
                        throw new XQRTException("failed to load document '" + docName
                                + "' is the collection '" + col.getAbsolutePath() + '\'', e);
                    }
                    final PagingProfile profile = doctbl.getPagingProfile();
                    Strategy origStrategy = null;
                    if(profile != null) {
                        profile.setProfiler(profiler);
View Full Code Here

            return false;
        }

        public final int totalCount() throws XQueryException {
            for(Pair<DbCollection, String> pair : lst) {
                final DbCollection col = pair.getFirst();
                final String docName = pair.getSecond();
                final File idxFile = getIndexFile(col, docName);
                BTreeIndexer indexer = new BTreeIndexer(idxFile);
                final IndexMatch matched;
                try {
View Full Code Here

        final List<Pair<DbCollection, String>> lst = new ArrayList<Pair<DbCollection, String>>(files.size());
        for(File f : files) {
            String fname = FileUtils.getFileName(f);
            String dname = fname.substring(0, fname.lastIndexOf('.'));
            String parentDirPath = f.getParent();
            final DbCollection col;
            if(parentDirPath.length() == colDirPathLength) {
                col = collection;
            } else {
                String relative = parentDirPath.substring(colDirPathLength);
                col = DbCollection.getCollection(relative);
View Full Code Here

TOP

Related Classes of xbird.storage.DbCollection

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.