Package voldemort

Examples of voldemort.VoldemortException


                if(logger.isDebugEnabled()) {
                    logger.debug("REST EXCEPTION STATUS : " + exception.getResponse().getStatus());
                }

            } else {
                throw new VoldemortException("Unknown HTTP request execution exception: "
                                             + e.getMessage(), e);
            }
        } catch(InterruptedException e) {
            if(logger.isDebugEnabled()) {
                logger.debug("Operation interrupted : " + e.getMessage(), e);
            }
            throw new VoldemortException("Operation interrupted exception: " + e.getMessage(), e);
        } catch(URISyntaxException e) {
            throw new VoldemortException("Illegal HTTP URL" + e.getMessage(), e);
        }

        return resultList;
    }
View Full Code Here


    @Override
    protected Cluster getCurrentCluster(int nodeId) {
        String hostName = nodeIdsInv.get(nodeId);
        if(hostName == null) {
            throw new VoldemortException("Node id " + nodeId + " does not exist");
        } else {
            AdminClient adminClient = new AdminClient(hostName,
                                                      new AdminClientConfig(),
                                                      new ClientConfig());
            return adminClient.getAdminClientCluster();
View Full Code Here

    @Override
    protected VoldemortState getCurrentState(int nodeId) {
        String hostName = nodeIdsInv.get(nodeId);
        if(hostName == null) {
            throw new VoldemortException("Node id " + nodeId + " does not exist");
        } else {
            AdminClient adminClient = new AdminClient(hostName,
                                                      new AdminClientConfig(),
                                                      new ClientConfig());
            return adminClient.rebalanceOps.getRemoteServerState(nodeId).getValue();
View Full Code Here

        String propertiesFileName = System.getProperty("ec2PropertiesFile");

        List<String> requireds = getRequiredPropertyNames();

        if(propertiesFileName == null)
            throw new VoldemortException("ec2PropertiesFile system property must be defined that "
                                         + "provides the path to file containing the following "
                                         + "required properties: "
                                         + StringUtils.join(requireds, ", "));

        Properties properties = new Properties();
        InputStream in = null;

        try {
            in = new FileInputStream(propertiesFileName);
            properties.load(in);
        } catch(IOException e) {
            throw new VoldemortException(e);
        } finally {
            IOUtils.closeQuietly(in);
        }

        for(String required: requireds) {
            // Allow system properties to override
            if(System.getProperties().containsKey(required))
                properties.put(required, System.getProperty(required));

            if(!properties.containsKey(required))
                throw new VoldemortException("Required properties: "
                                             + StringUtils.join(requireds, ", ") + "; missing "
                                             + required);
        }

        return properties;
View Full Code Here

                                                  segmentFactory,
                                                  hashLoadFactor,
                                                  new FnvHashFunction());
            this.locks = new StripedLock(lockStripes);
        } catch(Exception e) {
            throw new VoldemortException("Failure initializing store.", e);
        }

    }
View Full Code Here

    public void truncate() {
        try {
            datastore.clear();
        } catch(Exception e) {
            logger.error("Failed to truncate store '" + getName() + "': ", e);
            throw new VoldemortException("Failed to truncate store '" + getName() + "'.");
        }
    }
View Full Code Here

        StoreUtils.assertValidKey(key);
        try {
            return disassembleValues(datastore.get(key.get()));
        } catch(Exception e) {
            logger.error("Error reading value: ", e);
            throw new VoldemortException("Error reading value: ", e);
        }
    }
View Full Code Here

            if(maxVersion == null) {
                try {
                    return datastore.delete(key.get());
                } catch(Exception e) {
                    logger.error("Failed to delete key: ", e);
                    throw new VoldemortException("Failed to delete key: " + key, e);
                }
            }

            List<Versioned<byte[]>> returnedValuesList = this.get(key, null);

            // Case if there is nothing to delete
            if(returnedValuesList.size() == 0) {
                return false;
            }

            Iterator<Versioned<byte[]>> iter = returnedValuesList.iterator();
            while(iter.hasNext()) {
                Versioned<byte[]> currentValue = iter.next();
                Version currentVersion = currentValue.getVersion();
                if(currentVersion.compare(maxVersion) == Occurred.BEFORE) {
                    iter.remove();
                }
            }

            try {
                if(returnedValuesList.size() == 0)
                    return datastore.delete(key.get());
                else
                    return datastore.put(key.get(), assembleValues(returnedValuesList));
            } catch(Exception e) {
                String message = "Failed to delete key " + key;
                logger.error(message, e);
                throw new VoldemortException(message, e);
            }
        }
    }
View Full Code Here

            try {
                datastore.put(key.get(), assembleValues(existingValuesList));
            } catch(Exception e) {
                String message = "Failed to put key " + key;
                logger.error(message, e);
                throw new VoldemortException(message, e);
            }
        }
    }
View Full Code Here

            try {
                datastore.put(key.get(), assembleValues(valuesInStorage));
            } catch(Exception e) {
                String message = "Failed to put key " + key;
                logger.error(message, e);
                throw new VoldemortException(message, e);
            }
        }
        return obsoleteVals;
    }
View Full Code Here

TOP

Related Classes of voldemort.VoldemortException

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.