|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.netflix.hystrix.HystrixRequestCache
public class HystrixRequestCache
Cache that is scoped to the current request as managed by HystrixRequestVariableDefault.
This is used for short-lived caching of HystrixCommand instances to allow de-duping of command executions within a request.
| Method Summary | ||
|---|---|---|
void |
clear(java.lang.String cacheKey)
Clear the cache for a given cacheKey. |
|
|
get(java.lang.String cacheKey)
Retrieve a cached Future for this request scope if a matching command has already been executed/queued. |
|
static HystrixRequestCache |
getInstance(HystrixCollapserKey key,
HystrixConcurrencyStrategy concurrencyStrategy)
|
|
static HystrixRequestCache |
getInstance(HystrixCommandKey key,
HystrixConcurrencyStrategy concurrencyStrategy)
|
|
|
putIfAbsent(java.lang.String cacheKey,
java.util.concurrent.Future<T> f)
Put the Future in the cache if it does not already exist. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static HystrixRequestCache getInstance(HystrixCommandKey key,
HystrixConcurrencyStrategy concurrencyStrategy)
public static HystrixRequestCache getInstance(HystrixCollapserKey key,
HystrixConcurrencyStrategy concurrencyStrategy)
public <T> java.util.concurrent.Future<T> get(java.lang.String cacheKey)
Future<T>
public <T> java.util.concurrent.Future<T> putIfAbsent(java.lang.String cacheKey,
java.util.concurrent.Future<T> f)
If this method returns a non-null value then another thread won the race and it should be returned instead of proceeding with execution of the new Future.
cacheKey - key as defined by HystrixCommand.getCacheKey()f - Future to be cached
HystrixCommand does not have a cacheKey) or previous value if another thread beat us to adding to the cachepublic void clear(java.lang.String cacheKey)
cacheKey - key as defined by HystrixCommand.getCacheKey()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||