Examples of PersistitIOException


Examples of com.persistit.exception.PersistitIOException

            }
        } catch (final FileNotFoundException fnfe) {
            // A friendlier exception when the properties file is not found.
            throw new PropertiesNotFoundException(fnfe.getMessage());
        } catch (final IOException ioe) {
            throw new PersistitIOException(ioe);
        }
        merge(properties);
        loadProperties();
    }
View Full Code Here

Examples of com.persistit.exception.PersistitIOException

            _channel = new MediatedFileChannel(getPath(), "rw");
            lockChannel();
            truncate();
            _opened = true;
        } catch (final IOException ioe) {
            throw new PersistitIOException(ioe);
        } finally {
            if (!_opened) {
                try {
                    closeChannel();
                } catch (final IOException e) {
View Full Code Here

Examples of com.persistit.exception.PersistitIOException

            flushMetaData();
            _opened = true;

        } catch (final IOException ioe) {
            throw new PersistitIOException(ioe);
        } finally {
            if (_headBuffer != null) {
                if (!_opened) {
                    _headBuffer.clearFixed();
                    _headBuffer.clearValid();
View Full Code Here

Examples of com.persistit.exception.PersistitIOException

    @Override
    void force() throws PersistitIOException {
        try {
            _channel.force(true);
        } catch (final IOException ioe) {
            throw new PersistitIOException(ioe);
        }
    }
View Full Code Here

Examples of com.persistit.exception.PersistitIOException

                int read = 0;
                while (read < buffer.getBufferSize()) {
                    final long position = page * _volume.getStructure().getPageSize() + bb.position();
                    final int bytesRead = _channel.read(bb, position);
                    if (bytesRead <= 0) {
                        throw new PersistitIOException("Unable to read bytes at position " + position + " in " + this);
                    }
                    read += bytesRead;
                }
                _persistit.getIOMeter().chargeReadPageFromVolume(this._volume, buffer.getPageAddress(),
                        buffer.getBufferSize(), buffer.getIndex());
                _volume.getStatistics().bumpReadCounter();

            } catch (final IOException ioe) {
                _persistit.getAlertMonitor().post(
                        new Event(AlertLevel.ERROR, _persistit.getLogBase().readException, ioe, _volume, page,
                                buffer.getIndex()), AlertMonitor.READ_PAGE_CATEGORY);
                throw new PersistitIOException(ioe);
            }
        } finally {
            release();
        }
    }
View Full Code Here

Examples of com.persistit.exception.PersistitIOException

            _channel.write(bb, page * _volume.getStructure().getPageSize());
        } catch (final IOException ioe) {
            _persistit.getAlertMonitor().post(
                    new Event(AlertLevel.ERROR, _persistit.getLogBase().writeException, ioe, _volume, page),
                    AlertMonitor.WRITE_PAGE_CATEGORY);
            throw new PersistitIOException(ioe);
        }
    }
View Full Code Here

Examples of com.persistit.exception.PersistitIOException

            _extendedPageCount = pageCount;
        } catch (final IOException ioe) {
            _persistit.getAlertMonitor().post(
                    new Event(AlertLevel.ERROR, _persistit.getLogBase().extendException, ioe, _volume.getName(),
                            currentSize, newSize), AlertMonitor.EXTEND_VOLUME_CATEGORY);
            throw new PersistitIOException(ioe);
        }
    }
View Full Code Here

Examples of com.persistit.exception.PersistitIOException

        while (bb.remaining() > 0) {
            int count;
            try {
                count = fc.read(bb, fileAddr);
            } catch (final IOException ioe) {
                throw new PersistitIOException(ioe);
            }
            if (count < 0) {
                final File file = addressToFile(address);
                throw new CorruptJournalException(String.format("End of file at %s:%d(%,d)", file, fileAddr, address));
            }
View Full Code Here

Examples of com.persistit.exception.PersistitIOException

        synchronized (this) {
            try {
                closeAllChannels();
            } catch (final IOException ioe) {
                throw new PersistitIOException(ioe);
            } finally {
                _handleToTreeMap.clear();
                _handleToVolumeMap.clear();
                _volumeToHandleMap.clear();
                _treeToHandleMap.clear();
View Full Code Here

Examples of com.persistit.exception.PersistitIOException

                    _persistit.getIOMeter().chargeFlushJournal(written, address);
                    return _writeBufferAddress;
                }
            } catch (final IOException e) {
                throw new PersistitIOException("Writing to file " + addressToFile(address), e);
            }
        }
        return Long.MAX_VALUE;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.