Package com.thinkaurelius.titan.diskstorage

Examples of com.thinkaurelius.titan.diskstorage.TemporaryStorageException


        expect(lockState.getLocksForTx(defaultTx)).andReturn(Maps.newLinkedHashMap(ImmutableMap.of(defaultLockID, defaultLS)));

        List<StaticBuffer> dels = ImmutableList.of(codec.toLockCol(defaultLS.getWriteTimestamp(TimeUnit.NANOSECONDS), defaultLockRid));
        expect(times.getApproxNSSinceEpoch()).andReturn(currentTimeNS);
        store.mutate(eq(defaultLockKey), eq(ImmutableList.<Entry>of()), eq(dels), eq(defaultTx));
        expectLastCall().andThrow(new TemporaryStorageException("Storage cluster is busy"));
        expect(times.getApproxNSSinceEpoch()).andReturn(currentTimeNS);
        store.mutate(eq(defaultLockKey), eq(ImmutableList.<Entry>of()), eq(dels), eq(defaultTx));
        expectLastCall().andThrow(new TemporaryStorageException("Storage cluster is busier"));
        expect(times.getApproxNSSinceEpoch()).andReturn(currentTimeNS);
        store.mutate(eq(defaultLockKey), eq(ImmutableList.<Entry>of()), eq(dels), eq(defaultTx));
        expectLastCall().andThrow(new TemporaryStorageException("Storage cluster has reached peak business"));
        expect(mediator.unlock(defaultLockID, defaultTx)).andReturn(true);
//        lockState.release(defaultTx, defaultLockID);
        ctrl.replay();

        locker.deleteLocks(defaultTx);
View Full Code Here


       */
            log.debug("Waiting for Cassandra process to log successful Thrift-port bind...");
            if (!outputReader.awaitThrift(CASSANDRA_STARTUP_TIMEOUT, TimeUnit.MILLISECONDS)) {
                String msg = "Cassandra process failed to bind Thrift-port within timeout.";
                log.error(msg);
                throw new TemporaryStorageException(msg);
            }
            log.debug("Cassandra process logged successful Thrift-port bind.");
        } catch (Exception e) {
            e.printStackTrace();
            throw new TitanException(e);
View Full Code Here

        CTConnection conn = null;
        try {
            conn = f.makeRawConnection();
            CTConnectionFactory.waitForClusterSize(conn.getClient(), minSize);
        } catch (TTransportException e) {
            throw new TemporaryStorageException(e);
        } finally {
            if (null != conn)
                if (conn.getTransport().isOpen())
                    conn.getTransport().close();
        }
View Full Code Here

            for (Map.Entry<String, Map<String, IndexMutation>> stores : mutations.entrySet()) {
                mutateStores(stores, informations);
            }
            ltx.postCommit();
        } catch (IOException e) {
            throw new TemporaryStorageException("Could not update Lucene index", e);
        } finally {
            writerLock.unlock();
        }
    }
View Full Code Here

            for (int i = 0; i < docs.scoreDocs.length; i++) {
                result.add(searcher.doc(docs.scoreDocs[i].doc).getField(DOCID).stringValue());
            }
            return result;
        } catch (IOException e) {
            throw new TemporaryStorageException("Could not execute Lucene query", e);
        }
    }
View Full Code Here

            for (int i = 0; i < docs.scoreDocs.length; i++) {
                result.add(new RawQuery.Result<String>(searcher.doc(docs.scoreDocs[i].doc).getField(DOCID).stringValue(),docs.scoreDocs[i].score));
            }
            return result;
        } catch (IOException e) {
            throw new TemporaryStorageException("Could not execute Lucene query", e);
        }
    }
View Full Code Here

            oldLockCol = wr.getLockCol();
            handleMutationFailure(lockID, lockKey, wr, txh);
        }
        tryDeleteLockOnce(lockKey, oldLockCol, txh);
        // TODO log exception or successful too-slow write here
        throw new TemporaryStorageException("Lock write retry count exceeded");
    }
View Full Code Here

            } catch (TemporaryStorageException e) {
                log.warn("Temporary storage failure while checking locks", e);
            }
        }

        throw new TemporaryStorageException("Maximum retries (" + lockRetryCount + ") exceeded while checking locks");
    }
View Full Code Here

                log.error("Failed to check expected value (exception is permanent; won't retry)", e);
                throw e;
            }
        }

        throw new TemporaryStorageException("Lock write retry count exceeded");
    }
View Full Code Here

            } catch (ExecutionException e) {
                Throwable cause = e.getCause();
                if (cause != null && cause instanceof StorageException) {
                    throw (StorageException) cause;
                } else {
                    throw new TemporaryStorageException("Exception while accessing cache", e);
                }
            }
        } else {
            return store.getSlice(query, txh);
        }
View Full Code Here

TOP

Related Classes of com.thinkaurelius.titan.diskstorage.TemporaryStorageException

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.