Examples of PersistitIOException


Examples of com.persistit.exception.PersistitIOException

                if (matches) {
                    channel.truncate(length);
                }
                channel.force(true);
            } catch (final IOException ioe) {
                throw new PersistitIOException(ioe);
            }
            _currentAddress = ((_currentAddress / _blockSize) + 1) * _blockSize;
            _writeBuffer.clear();
            _writeBufferAddress = _currentAddress;
            _isNewEpoch = false;
View Full Code Here

Examples of com.persistit.exception.PersistitIOException

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

Examples of com.persistit.exception.PersistitIOException

                final File file = File.createTempFile(TEMP_FILE_PREFIX, null, _tempDirectory);
                _path = file.getPath();
                _channel = new MediatedFileChannel(_path, "rw");
            } catch (final IOException ioe) {
                _persistit.getLogBase().tempVolumeCreateException.log(ioe, _path);
                throw new PersistitIOException(ioe);
            }
        }
        return _channel;
    }
View Full Code Here

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

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

Examples of com.persistit.exception.PersistitIOException

                } else {
                    throw savedException;
                }
            } catch (final 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 (final IOException e) {
                throw new PersistitIOException("Reading from " + addressToString(address), e);
            }
        }
    }
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 (final IOException ioe) {
                throw new PersistitIOException(ioe);
            }
        }
        return channel;
    }
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.