Package com.persistit.exception

Examples of com.persistit.exception.PersistitIOException


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


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

            _channel.write(bb, page * _volume.getStructure().getPageSize());
        } catch (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

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

        while (bb.remaining() > 0) {
            int count;
            try {
                count = fc.read(bb, fileAddr);
            } catch (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 (IOException ioe) {
                throw new PersistitIOException(ioe);
            } finally {
                _handleToTreeMap.clear();
                _handleToVolumeMap.clear();
                _volumeToHandleMap.clear();
                _treeToHandleMap.clear();
View Full Code Here

                    _persistit.getIOMeter().chargeFlushJournal(written, address);
                    return _writeBufferAddress;
                }
            } catch (IOException e) {
                throw new PersistitIOException("Writing to file " + addressToFile(address), e);
            }
        }
        return Long.MAX_VALUE;
    }
View Full Code Here

            if (address != Long.MAX_VALUE) {
                final FileChannel channel = getFileChannel(address);
                channel.force(false);
            }
        } catch (IOException e) {
            throw new PersistitIOException("Writing to file " + addressToFile(address), e);
        }
    }
View Full Code Here

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

        if (channel == null) {
            try {
                channel = new MediatedFileChannel(addressToFile(address), "rw");
                _journalFileChannels.put(generation, channel);
            } catch (IOException ioe) {
                throw new PersistitIOException(ioe);
            }
        }
        return channel;
    }
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.