@InterfaceAudience.Private public class RetryCache extends Object
RetryCache
and the previous response is sent back to the request.
To look an implementation using this cache, see HDFS FSNamesystem class.
Modifier and Type | Class and Description |
---|---|
static class |
RetryCache.CacheEntry
CacheEntry is tracked using unique client ID and callId of the RPC request
|
static class |
RetryCache.CacheEntryWithPayload
CacheEntry with payload that tracks the previous response or parts of
previous response to be used for generating response for retried requests.
|
Modifier and Type | Field and Description |
---|---|
static org.apache.commons.logging.Log |
LOG |
Constructor and Description |
---|
RetryCache(String cacheName,
double percentage,
long expirationTime)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addCacheEntry(byte[] clientId,
int callId)
Add a new cache entry into the retry cache.
|
void |
addCacheEntryWithPayload(byte[] clientId,
int callId,
Object payload) |
static void |
clear(RetryCache cache) |
LightWeightGSet<RetryCache.CacheEntry,RetryCache.CacheEntry> |
getCacheSet() |
static void |
setState(RetryCache.CacheEntry e,
boolean success) |
static void |
setState(RetryCache.CacheEntryWithPayload e,
boolean success,
Object payload) |
static RetryCache.CacheEntry |
waitForCompletion(RetryCache cache)
Static method that provides null check for retryCache
|
static RetryCache.CacheEntryWithPayload |
waitForCompletion(RetryCache cache,
Object payload)
Static method that provides null check for retryCache
|
public RetryCache(String cacheName, double percentage, long expirationTime)
cacheName
- name to identify the cache bypercentage
- percentage of total java heap space used by this cacheexpirationTime
- time for an entry to expire in nanosecondspublic LightWeightGSet<RetryCache.CacheEntry,RetryCache.CacheEntry> getCacheSet()
public void addCacheEntry(byte[] clientId, int callId)
public void addCacheEntryWithPayload(byte[] clientId, int callId, Object payload)
public static RetryCache.CacheEntry waitForCompletion(RetryCache cache)
public static RetryCache.CacheEntryWithPayload waitForCompletion(RetryCache cache, Object payload)
public static void setState(RetryCache.CacheEntry e, boolean success)
public static void setState(RetryCache.CacheEntryWithPayload e, boolean success, Object payload)
public static void clear(RetryCache cache)
Copyright © 2013 Apache Software Foundation. All rights reserved.