Package xbird.storage

Examples of xbird.storage.DbException


            HashBucket bucket = loadRecordedBucket(pageNum);
            if(bucket != null) {
                return bucket.findValue(key);
            }
        } catch (IOException e) {
            throw new DbException(e);
        }
        return null;
    }
View Full Code Here


        try {
            checkOpened();
            HashBucket bucket = seekInsertionBucket(key);
            return bucket.addValue(key, value);
        } catch (IOException e) {
            throw new DbException(e);
        }
    }
View Full Code Here

                PageHeader ph = p.getPageHeader();
                if(ph.getStatus() == USED_BUCKET) {
                    try {
                        bucket.read();
                    } catch (IOException e) {
                        throw new DbException(e);
                    }
                } else {
                    ph.setStatus(USED_BUCKET);
                }
                _cache.put(pageNum, bucket);
View Full Code Here

            HashBucket bucket = loadRecordedBucket(pageNum);
            if(bucket != null) {
                return bucket.removeValue(key);
            }
        } catch (IOException e) {
            throw new DbException(e);
        }
        return null;
    }
View Full Code Here

            for(BucketEntry<HashBucket> e : _cache) {
                HashBucket node = e.getValue();
                try {
                    node.write();
                } catch (IOException ioe) {
                    throw new DbException(ioe);
                }
            }
        }
        if(clear) {
            _cache.clear();
View Full Code Here

            HashBucket bucket = loadRecordedBucket(pageNum);
            if(bucket != null) {
                return bucket.findValue(key);
            }
        } catch (IOException e) {
            throw new DbException(e);
        }
        return null;
    }
View Full Code Here

        try {
            ensureResourceOpen();
            HashBucket bucket = seekInsertionBucket(key);
            return bucket.addValue(key, value);
        } catch (IOException e) {
            throw new DbException(e);
        }
    }
View Full Code Here

            HashBucket bucket = loadRecordedBucket(pageNum);
            if(bucket != null) {
                return bucket.removeValue(key);
            }
        } catch (IOException e) {
            throw new DbException(e);
        }
        return null;
    }
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

    public boolean create(boolean close) throws DbException {
        ensureResourceOpen();
        try {
            _fileHeader.write();
        } catch (IOException e) {
            throw new DbException(e);
        }
        if(close) {
            close();
        } else {
            this._opened = true;
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.