Package com.persistit.exception

Examples of com.persistit.exception.PersistitIOException


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


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

            } catch (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

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

                _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

        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

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

                _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

        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

        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

TOP

Related Classes of com.persistit.exception.PersistitIOException

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.