@Contract(threading=SAFE) public class DefaultFailureCache extends Object implements FailureCache
| Constructor and Description |
|---|
DefaultFailureCache()
Create a new failure cache with the maximum size of
DEFAULT_MAX_SIZE. |
DefaultFailureCache(int maxSize)
Creates a new failure cache with the specified maximum size.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getErrorCount(String identifier)
Get the current error count.
|
void |
increaseErrorCount(String identifier)
Increases the error count by one.
|
void |
resetErrorCount(String identifier)
Reset the error count back to zero.
|
public DefaultFailureCache()
DEFAULT_MAX_SIZE.public DefaultFailureCache(int maxSize)
maxSize - the maximum number of entries the cache should storepublic int getErrorCount(String identifier)
FailureCachegetErrorCount in interface FailureCacheidentifier - the identifier for which the error count is requestedpublic void resetErrorCount(String identifier)
FailureCacheresetErrorCount in interface FailureCacheidentifier - the identifier for which the error count should be
resetpublic void increaseErrorCount(String identifier)
FailureCacheincreaseErrorCount in interface FailureCacheidentifier - the identifier for which the error count should be
increasedCopyright © 1999–2022 The Apache Software Foundation. All rights reserved.