org.jclouds.cache.internal
Class BackoffExponentiallyAndRetryOnThrowableCacheLoader<K,V>
java.lang.Object
com.google.common.cache.CacheLoader<K,V>
org.jclouds.cache.ForwardingCacheLoader<K,V>
org.jclouds.cache.internal.BackoffExponentiallyAndRetryOnThrowableCacheLoader<K,V>
- Type Parameters:
K - the key type of the cache loaderV - the value type of the cache loader
@Beta
public class BackoffExponentiallyAndRetryOnThrowableCacheLoader<K,V>
- extends ForwardingCacheLoader<K,V>
Exponentially backs off, if we encounter an exception of the given type during any of the
following methods:
- Since:
- 1.5
- Author:
- Adrian Cole
| Nested classes/interfaces inherited from class com.google.common.cache.CacheLoader |
com.google.common.cache.CacheLoader.InvalidCacheLoadException |
| Methods inherited from class com.google.common.cache.CacheLoader |
from, from |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BackoffExponentiallyAndRetryOnThrowableCacheLoader
public BackoffExponentiallyAndRetryOnThrowableCacheLoader(Class<? extends Throwable> retryableThrowable,
long periodMs,
long maxPeriodMs,
int maxTries,
com.google.common.cache.CacheLoader<K,V> loader)
- Parameters:
retryableThrowable - the exception which we can retryperiodMs - initial period, which exponentially increases with each try, specified in
millisecondsmaxPeriodMs - maximum period duration, specified in millisecondsmaxTries - maximum amount of triesloader - the loader we are able to retry
delegate
protected com.google.common.cache.CacheLoader<K,V> delegate()
- Specified by:
delegate in class ForwardingCacheLoader<K,V>
load
public V load(K key)
throws Exception
- Overrides:
load in class ForwardingCacheLoader<K,V>
- Throws:
Exception
reload
public com.google.common.util.concurrent.ListenableFuture<V> reload(K key,
V oldValue)
throws Exception
- Overrides:
reload in class ForwardingCacheLoader<K,V>
- Throws:
Exception
loadAll
public Map<K,V> loadAll(Iterable<? extends K> keys)
throws Exception
- Overrides:
loadAll in class ForwardingCacheLoader<K,V>
- Throws:
Exception
Copyright © 2009-2013 jclouds. All Rights Reserved.