Package xbird.storage

Examples of xbird.storage.DbException


            _rootNode.ph.setStatus(LEAF);
            _rootNode.set(new Value[0], new long[0]);
            try {
                _rootNode.write();
            } catch (IOException e) {
                throw new DbException(e);
            }
            synchronized(_cache) {
                _cache.put(_rootNode.page.getPageNum(), _rootNode);
            }
            if(close) {
View Full Code Here


     */
    public synchronized long addValue(Value value, long pointer) throws DbException {
        try {
            return _rootNode.addValue(value, pointer);
        } catch (IOException e) {
            throw new DbException(e);
        }
    }
View Full Code Here

     */
    public synchronized long removeValue(Value value) throws DbException {
        try {
            return _rootNode.removeValue(value);
        } catch (IOException e) {
            throw new DbException(e);
        }
    }
View Full Code Here

    public synchronized long[] removeValue(Value value, long pointer) throws DbException {
        try {
            return _rootNode.removeValue(value, pointer);
        } catch (IOException e) {
            throw new DbException(e);
        }
    }
View Full Code Here

                    scanRange(leftmost, rightmost, query, callback);
                    break;
                }
            }
        } catch (IOException e) {
            throw new DbException(e);
        }
    }
View Full Code Here

            if(node == null) {
                node = new BTreeNode(root, getPage(page), parent);
                try {
                    node.read();
                } catch (IOException e) {
                    throw new DbException("failed to read page#" + page, e);
                }
                if(LOG.isDebugEnabled()) {
                    LOG.debug("read node page#" + page + ", keys: " + node.keys.length);
                }
                _cache.put(page, node);
View Full Code Here

            if(node == null) {
                node = new BTreeNode(root, getPage(page));
                try {
                    node.read();
                } catch (IOException e) {
                    throw new DbException("failed to read page#" + page, e);
                }
                if(LOG.isDebugEnabled()) {
                    LOG.debug("read node page#" + page + ", keys: " + node.keys.length);
                }
                _cache.put(page, node);
View Full Code Here

                    if(node != null) {
                        node.write();
                    }
                }
            } catch (IOException ioe) {
                throw new DbException(ioe);
            }
        }
        if(clear) {
            _cache.clear();
        }
View Full Code Here

        }

        /** find lest-most value which matches to the key */
        long findValue(Value serarchKey) throws DbException {
            if(serarchKey == null) {
                throw new DbException("Can't search on null Value");
            }
            int idx = searchLeftmostKey(keys, serarchKey, keys.length);
            switch(ph.getStatus()) {
                case BRANCH:
                    idx = idx < 0 ? -(idx + 1) : idx + 1;
View Full Code Here

        }
        File file = new File(col.getDirectory(), col.getCollectionName()
                + DbCollection.QNAMES_FILE_SUFFIX);
        if(file.exists()) {
            if(!file.delete()) {
                throw new DbException("Could not delete symbol file: " + file.getAbsolutePath());
            }
        }
        if(file.canWrite()) {
            throw new IllegalStateException("Does not have write permission for "
                    + file.getAbsolutePath());
        }
        try {
            ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(file));
            oos.writeObject(this);
            oos.flush();
            oos.close();
        } catch (FileNotFoundException fe) {
            throw new DbException(fe);
        } catch (IOException ioe) {
            throw new DbException(ioe);
        }
    }
View Full Code Here

TOP

Related Classes of xbird.storage.DbException

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.