Package voldemort.store

Examples of voldemort.store.PersistenceFailureException


            doCommit = true;
        } catch(SQLException e) {
            if(e.getErrorCode() == MYSQL_ERR_DUP_KEY || e.getErrorCode() == MYSQL_ERR_DUP_ENTRY) {
                throw new ObsoleteVersionException("Key or value already used.");
            } else {
                throw new PersistenceFailureException("Fix me!", e);
            }
        } finally {
            if(conn != null) {
                try {
                    if(doCommit)
View Full Code Here


                                     ResultSet resultSet) {
            try {
                // Move to the first item
                this.hasMore = resultSet.next();
            } catch(SQLException e) {
                throw new PersistenceFailureException(e);
            }
            this.rs = resultSet;
            this.connection = connection;
            this.statement = statement;
        }
View Full Code Here

                cursor.setCacheMode(CacheMode.EVICT_BIN);
            return new BdbEntriesIterator(cursor, this);
        } catch(DatabaseException e) {
            this.bdbEnvironmentStats.reportException(e);
            logger.error(e);
            throw new PersistenceFailureException(e);
        }
    }
View Full Code Here

                cursor.setCacheMode(CacheMode.EVICT_BIN);
            return new BdbKeysIterator(cursor, this);
        } catch(DatabaseException e) {
            this.bdbEnvironmentStats.reportException(e);
            logger.error(e);
            throw new PersistenceFailureException(e);
        }
    }
View Full Code Here

                return Collections.emptyList();
            }
        } catch(DatabaseException e) {
            this.bdbEnvironmentStats.reportException(e);
            logger.error(e);
            throw new PersistenceFailureException(e);
        } finally {
            if(logger.isTraceEnabled()) {
                logger.trace("Completed GET (" + getName() + ") from key " + key + " (keyRef: "
                             + System.identityHashCode(key) + ") in "
                             + (System.nanoTime() - startTimeNs) + " ns at "
View Full Code Here

            valueEntry.setData(StoreBinaryFormat.toByteArray(vals));
            status = getBdbDatabase().put(transaction, keyEntry, valueEntry);

            if(status != OperationStatus.SUCCESS)
                throw new PersistenceFailureException("Put operation failed with status: " + status);
            succeeded = true;

        } catch(DatabaseException e) {
            this.bdbEnvironmentStats.reportException(e);
            logger.error("Error in put for store " + this.getName(), e);
            throw new PersistenceFailureException(e);
        } finally {
            if(succeeded)
                attemptCommit(transaction);
            else
                attemptAbort(transaction);
View Full Code Here

                return numDeletedVersions > 0;
            }
        } catch(DatabaseException e) {
            this.bdbEnvironmentStats.reportException(e);
            logger.error(e);
            throw new PersistenceFailureException(e);
        } finally {
            attemptCommit(transaction);
            if(logger.isTraceEnabled()) {
                logger.trace("Completed DELETE (" + getName() + ") of key "
                             + ByteUtils.toHexString(key.get()) + " (keyRef: "
View Full Code Here

            if(this.isOpen.compareAndSet(true, false))
                this.getBdbDatabase().close();
        } catch(DatabaseException e) {
            this.bdbEnvironmentStats.reportException(e);
            logger.error(e);
            throw new PersistenceFailureException("Shutdown failed.", e);
        }
    }
View Full Code Here

                transaction.commit();
        } catch(DatabaseException e) {
            this.bdbEnvironmentStats.reportException(e);
            logger.error("Transaction commit failed!", e);
            attemptAbort(transaction);
            throw new PersistenceFailureException(e);
        }
    }
View Full Code Here

            this.bdbEnvironmentStats.reportException(e);
            // Unless we return out properly from this method, we need to ensure
            // the transaction handle is closed on exception..
            attemptAbort(transaction);
            logger.error("Error in getAndLock for store " + this.getName(), e);
            throw new PersistenceFailureException(e);
        } finally {
            if(logger.isTraceEnabled()) {
                logger.trace("Completed getAndLock (" + getName() + ") to key " + key
                             + " (keyRef: " + System.identityHashCode(key) + " in "
                             + (System.nanoTime() - startTimeNs) + " ns at "
View Full Code Here

TOP

Related Classes of voldemort.store.PersistenceFailureException

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.