Search in sources :

Example 1 with RetryBackoffStrategy

use of com.netflix.astyanax.connectionpool.RetryBackoffStrategy in project titan by thinkaurelius.

the class AstyanaxStoreManager method getRetryBackoffStrategy.

private static RetryBackoffStrategy getRetryBackoffStrategy(String desc) throws PermanentBackendException {
    if (null == desc)
        return null;
    String[] tokens = desc.split(",");
    String policyClassName = tokens[0];
    int argCount = tokens.length - 1;
    Integer[] args = new Integer[argCount];
    for (int i = 1; i < tokens.length; i++) {
        args[i - 1] = Integer.valueOf(tokens[i]);
    }
    try {
        RetryBackoffStrategy rbs = instantiate(policyClassName, args, desc);
        log.debug("Instantiated RetryBackoffStrategy object {} from config string \"{}\"", rbs, desc);
        return rbs;
    } catch (Exception e) {
        throw new PermanentBackendException("Failed to instantiate Astyanax RetryBackoffStrategy implementation", e);
    }
}
Also used : ExponentialRetryBackoffStrategy(com.netflix.astyanax.connectionpool.impl.ExponentialRetryBackoffStrategy) RetryBackoffStrategy(com.netflix.astyanax.connectionpool.RetryBackoffStrategy) PermanentBackendException(com.thinkaurelius.titan.diskstorage.PermanentBackendException) TemporaryBackendException(com.thinkaurelius.titan.diskstorage.TemporaryBackendException) PermanentBackendException(com.thinkaurelius.titan.diskstorage.PermanentBackendException) BackendException(com.thinkaurelius.titan.diskstorage.BackendException) ConfigurationException(org.apache.cassandra.exceptions.ConfigurationException) ConnectionException(com.netflix.astyanax.connectionpool.exceptions.ConnectionException)

Aggregations

RetryBackoffStrategy (com.netflix.astyanax.connectionpool.RetryBackoffStrategy)1 ConnectionException (com.netflix.astyanax.connectionpool.exceptions.ConnectionException)1 ExponentialRetryBackoffStrategy (com.netflix.astyanax.connectionpool.impl.ExponentialRetryBackoffStrategy)1 BackendException (com.thinkaurelius.titan.diskstorage.BackendException)1 PermanentBackendException (com.thinkaurelius.titan.diskstorage.PermanentBackendException)1 TemporaryBackendException (com.thinkaurelius.titan.diskstorage.TemporaryBackendException)1 ConfigurationException (org.apache.cassandra.exceptions.ConfigurationException)1