|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.netflix.eureka.resources.ResponseCache
public class ResponseCache
The class that is responsible for caching registry information that will be queried by the clients.
The cache is maintained in compressed and non-compressed form for three
categories of requests - all applications, delta changes and for individual
applications. The compressed form is probably the most efficient in terms of
network traffic especially when querying all applications.
The cache also maintains separate pay load for JSON and XML
formats and for multiple versions too. The cache is updated periodically to
reflect the latest information configured by
EurekaServerConfig.getResponseCacheUpdateIntervalMs().
| Nested Class Summary | |
|---|---|
static class |
ResponseCache.Key
The key for the cached payload. |
static class |
ResponseCache.KeyType
|
| Field Summary | |
|---|---|
static java.lang.String |
ALL_APPS
|
static java.lang.String |
ALL_APPS_DELTA
|
| Method Summary | |
|---|---|
java.lang.String |
get(ResponseCache.Key key)
Get the cached information about applications. |
int |
getCurrentSize()
Get the number of items in the response cache. |
byte[] |
getGZIP(ResponseCache.Key key)
Get the compressed information about the applications. |
static ResponseCache |
getInstance()
|
static java.util.concurrent.atomic.AtomicLong |
getVersionDelta()
Gets the version number of the cached data. |
static java.util.concurrent.atomic.AtomicLong |
getVersionDeltaWithRegions()
Gets the version number of the cached data with remote regions. |
void |
invalidate(ResponseCache.Key... keys)
Invalidate the cache information given the list of keys. |
void |
invalidate(java.lang.String appName,
java.lang.String vipAddress,
java.lang.String secureVipAddress)
Invalidate the cache of a particular application. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ALL_APPS
public static final java.lang.String ALL_APPS_DELTA
| Method Detail |
|---|
public static ResponseCache getInstance()
public java.lang.String get(ResponseCache.Key key)
If the cached information is not available it is generated on the first request. After the first request, the information is then updated periodically by a background thread.
key - the key for which the cached information needs to be obtained.
public byte[] getGZIP(ResponseCache.Key key)
key - the key for which the compressed cached information needs to
be obtained.
public void invalidate(java.lang.String appName,
@Nullable
java.lang.String vipAddress,
@Nullable
java.lang.String secureVipAddress)
appName - the application name of the application.public void invalidate(ResponseCache.Key... keys)
keys - the list of keys for which the cache information needs to be
invalidated.public static java.util.concurrent.atomic.AtomicLong getVersionDelta()
public static java.util.concurrent.atomic.AtomicLong getVersionDeltaWithRegions()
@Monitor(name="responseCacheSize",
type=GAUGE)
public int getCurrentSize()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||