Package voldemort.store

Examples of voldemort.store.PersistenceFailureException


     * @param nodeId
     */
    public void createInnerStore(int nodeId) {
        Store<ByteArray, byte[], byte[]> realStore = new InMemoryPutAssertionStorageEngine<ByteArray, byte[], byte[]>(STORE_NAME);
        ForceFailStore<ByteArray, byte[], byte[]> forceFailStore = new ForceFailStore<ByteArray, byte[], byte[]>(realStore,
                                                                                                                 new PersistenceFailureException("Force failed"));
        SleepyStore<ByteArray, byte[], byte[]> sleepyStore = new SleepyStore<ByteArray, byte[], byte[]>(0,
                                                                                                        forceFailStore);
        realStores.put(nodeId, realStore);
        forceFailStores.put(nodeId, forceFailStore);
        sleepyStores.put(nodeId, sleepyStore);
View Full Code Here


                    this.cache.add(Pair.create(key, val));
                return true;
            } catch(DatabaseException e) {
                bdbEngine.bdbEnvironmentStats.reportException(e);
                logger.error(e);
                throw new PersistenceFailureException(e);
            }
        }
View Full Code Here

                current = new ByteArray(StoreBinaryFormat.extractKey(keyEntry.getData()));
                return true;
            } catch(DatabaseException e) {
                bdbEngine.bdbEnvironmentStats.reportException(e);
                logger.error(e);
                throw new PersistenceFailureException(e);
            }
        }
View Full Code Here

        @Override
        public Pair<ByteArray, Versioned<byte[]>> next() {
            try {
                if(!this.hasMore)
                    throw new PersistenceFailureException("Next called on iterator, but no more items available!");
                ByteArray key = new ByteArray(rs.getBytes("key_"));
                byte[] value = rs.getBytes("value_");
                VectorClock clock = new VectorClock(rs.getBytes("version_"));
                this.hasMore = rs.next();
                return Pair.create(key, new Versioned<byte[]>(value, clock));
            } catch(SQLException e) {
                throw new PersistenceFailureException(e);
            }
        }
View Full Code Here

        @Override
        public void remove() {
            try {
                rs.deleteRow();
            } catch(SQLException e) {
                throw new PersistenceFailureException(e);
            }
        }
View Full Code Here

            conn = this.datasource.getConnection();
            stmt = conn.prepareStatement(select);
            rs = stmt.executeQuery();
            return rs.next();
        } catch(SQLException e) {
            throw new PersistenceFailureException("SQLException while checking for table existence!",
                                                  e);
        } finally {
            tryClose(rs);
            tryClose(stmt);
            tryClose(conn);
View Full Code Here

        try {
            conn = datasource.getConnection();
            stmt = conn.prepareStatement(query);
            stmt.executeUpdate();
        } catch(SQLException e) {
            throw new PersistenceFailureException("SQLException while performing operation.", e);
        } finally {
            tryClose(stmt);
            tryClose(conn);
        }
    }
View Full Code Here

            conn = datasource.getConnection();
            stmt = conn.prepareStatement(select);
            rs = stmt.executeQuery();
            return new MysqlClosableIterator(conn, stmt, rs);
        } catch(SQLException e) {
            throw new PersistenceFailureException("Fix me!", e);
        }
    }
View Full Code Here

                }
            }

            return deletedSomething;
        } catch(SQLException e) {
            throw new PersistenceFailureException("Fix me!", e);
        } finally {
            tryClose(rs);
            tryClose(selectStmt);
            tryClose(conn);
        }
View Full Code Here

                if(found.size() > 0)
                    result.put(key, found);
            }
            return result;
        } catch(SQLException e) {
            throw new PersistenceFailureException("Fix me!", e);
        } finally {
            tryClose(rs);
            tryClose(stmt);
            tryClose(conn);
        }
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.