Examples of PersistitIOException


Examples of com.persistit.exception.PersistitIOException

                int read = 0;
                while (read < buffer.getBufferSize()) {
                    final long position = (page - 1) * _volume.getStructure().getPageSize() + bb.position();
                    final int bytesRead = getChannel().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

            } 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);
            }
        } finally {
            release();
        }
    }
View Full Code Here

Examples of com.persistit.exception.PersistitIOException

                return true;
            } else {
                return false;
            }
        } catch (final IOException ioe) {
            throw new PersistitIOException(ioe);
        } finally {
            if (stream != null) {
                try {
                    stream.close();
                } catch (final IOException e) {
View Full Code Here

Examples of com.persistit.exception.PersistitIOException

                return true;
            } else {
                return false;
            }
        } catch (IOException ioe) {
            throw new PersistitIOException(ioe);
        }
    }
View Full Code Here

Examples of com.persistit.exception.PersistitIOException

        if (channel == null) {
            try {
                channel = new MediatedFileChannel(addressToFile(address), "r");
                _journalFileChannels.put(generation, channel);
            } catch (IOException ioe) {
                throw new PersistitIOException(ioe);
            }
        }
        return channel;
    }
View Full Code Here

Examples of com.persistit.exception.PersistitIOException

                } else {
                    throw savedException;
                }
            } catch (IOException ioe) {
                throw new PersistitIOException(ioe);
            }
        }
    }
View Full Code Here

Examples of com.persistit.exception.PersistitIOException

                _readBuffer.flip();
                if (_readBuffer.remaining() < size) {
                    throw new CorruptJournalException("End of file at " + addressToString(address));
                }
            } catch (IOException e) {
                throw new PersistitIOException("Reading from " + addressToString(address), e);
            }
        }
    }
View Full Code Here

Examples of com.persistit.exception.PersistitIOException

            }
        } catch (FileNotFoundException fnfe) {
            // A friendlier exception when the properties file is not found.
            throw new PropertiesNotFoundException(fnfe.getMessage());
        } catch (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 (IOException ioe) {
            throw new PersistitIOException(ioe);
        } finally {
            if (!_opened) {
                try {
                    closeChannel();
                } catch (IOException e) {
View Full Code Here

Examples of com.persistit.exception.PersistitIOException

            flushMetaData();
            _opened = true;

        } catch (IOException ioe) {
            throw new PersistitIOException(ioe);
        } finally {
            if (_headBuffer != null) {
                if (!_opened) {
                    _headBuffer.clearFixed();
                    _headBuffer.clearValid();
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.