Package com.thinkaurelius.titan.diskstorage

Examples of com.thinkaurelius.titan.diskstorage.PermanentStorageException


            return new LongToken(Murmur3Partitioner.MAXIMUM);
        } else if (partitioner instanceof ByteOrderedPartitioner) {
            //TODO: This makes the assumption that its an EdgeStore (i.e. 8 byte keys)
            return new BytesToken(com.thinkaurelius.titan.diskstorage.util.ByteBufferUtil.oneByteBuffer(8));
        } else {
            throw new PermanentStorageException("Unsupported partitioner: " + partitioner);
        }
    }
View Full Code Here


        storeManager = mgr;
        persistit = db;
        try {
            mgr.getVolume().getTree(name, true);
        } catch (PersistitException e) {
            throw new PermanentStorageException(e);
        }
    }
View Full Code Here

    public void clear() throws StorageException {
        try {
            Exchange exchange = persistit.getExchange(VOLUME_NAME, name, true);
            exchange.removeTree();
        } catch (PersistitException ex) {
            throw new PermanentStorageException(ex);
        }
    }
View Full Code Here

                    return getValue(exchange);
                } else {
                    return null;
                }
            } catch (PersistitException ex) {
                throw new PermanentStorageException(ex);
            } finally {
                tx.releaseExchange(exchange);
            }
        }
    }
View Full Code Here

            final Exchange exchange = tx.getExchange(name);
            try {
                toKey(exchange, key);
                return exchange.isValueDefined();
            } catch (PersistitException ex) {
                throw new PermanentStorageException(ex);
            } finally {
                tx.releaseExchange(exchange);
            }
        }
    }
View Full Code Here

                        if (limit != null && limit >= 0 && i >= limit) break;
                        if (selector != null && selector.reachedLimit()) break;
                    }
                }
            } catch (PersistitException ex) {
                throw new PermanentStorageException(ex);
            } finally {
                tx.releaseExchange(exchange);
            }
        }
View Full Code Here

            final Exchange exchange = tx.getExchange(name);
            try {
                toKey(exchange, key);
                setValue(exchange, value);
            } catch (PersistitException ex) {
                throw new PermanentStorageException(ex);
            } finally {
                tx.releaseExchange(exchange);
            }
        }
    }
View Full Code Here

            final Exchange exchange = tx.getExchange(name);
            try {
                toKey(exchange, key);
                exchange.remove();
            } catch (PersistitException ex) {
                throw new PermanentStorageException(ex);
            } finally {
                tx.releaseExchange(exchange);
            }
        }
    }
View Full Code Here

     * if columnStart = columnEnd.
     */
        if (ByteBufferUtil.compare(query.getSliceStart(), query.getSliceEnd()) >= 0) {
            // Check for invalid arguments where columnEnd < columnStart
            if (ByteBufferUtil.isSmallerThan(query.getSliceEnd(), query.getSliceStart())) {
                throw new PermanentStorageException("columnStart=" + query.getSliceStart() +
                        " is greater than columnEnd=" + query.getSliceEnd() + ". " +
                        "columnStart must be less than or equal to columnEnd");
            }
            if (0 != query.getSliceStart().length() && 0 != query.getSliceEnd().length()) {
                logger.debug("Return empty list due to columnEnd==columnStart and neither empty");
View Full Code Here

    @Override
    public KeyIterator getKeys(@Nullable SliceQuery sliceQuery, StoreTransaction txh) throws StorageException {
        final IPartitioner<? extends Token<?>> partitioner = storeManager.getCassandraPartitioner();

        if (!(partitioner instanceof RandomPartitioner) && !(partitioner instanceof Murmur3Partitioner))
            throw new PermanentStorageException("This operation is only allowed when random partitioner (md5 or murmur3) is used.");

        try {
            return new AllTokensIterator<Token<?>>(partitioner, sliceQuery, storeManager.getPageSize());
        } catch (Exception e) {
            throw convertException(e);
View Full Code Here

TOP

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

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.