V - the value typepublic class GuavaStableReadExternalCache<V> extends AbstractStableReadExternalCache<V>
StableReadExternalCache.metricsRecordername| Constructor and Description |
|---|
GuavaStableReadExternalCache(String name,
com.google.common.cache.Cache<String,IdentifiedData> delegate,
Supplier<RequestContext> contextSupplier,
ExternalCacheKeyGenerator keyGenerator,
Optional<com.atlassian.marshalling.api.MarshallingPair<V>> valueMarshalling,
MetricsRecorder metricsRecorder) |
| Modifier and Type | Method and Description |
|---|---|
protected Optional<V> |
directGet(String externalKey)
Performs a direct get operation against the external cache using the supplied external key.
|
protected Map<String,Optional<V>> |
directGetBulk(Set<String> externalKeys)
Performs a direct bulk get operation against the external cache using the supplied external keys.
|
protected AbstractExternalCacheRequestContext<V> |
ensureCacheContext()
Returns the cache context for the current request.
|
protected org.slf4j.Logger |
getLogger()
Returns the logging instance for the implementation class.
|
protected Map<String,V> |
handleCreation(Function<Set<String>,Map<String,V>> factory,
Set<String> externalKeys)
Handles the creation of a number of entries
|
protected V |
handleCreation(String internalKey,
Supplier<V> supplier)
Handles the creation of an entry, if required.
|
protected CompletionStage<Boolean> |
internalPut(String internalKey,
V value,
PutPolicy policy) |
protected CompletionStage<Void> |
internalRemove(Iterable<String> internalKeys) |
protected CompletionStage<Void> |
internalRemoveAll() |
protected ExternalCacheException |
mapException(Exception ex)
Maps a generic
Exception to a corresponding ExternalCacheException. |
checkValuesRecorded, get, get, getBulk, getBulk, put, remove, removeAllgetName, perform, performclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetBulk, getBulkremovepublic GuavaStableReadExternalCache(String name, com.google.common.cache.Cache<String,IdentifiedData> delegate, Supplier<RequestContext> contextSupplier, ExternalCacheKeyGenerator keyGenerator, Optional<com.atlassian.marshalling.api.MarshallingPair<V>> valueMarshalling, MetricsRecorder metricsRecorder)
protected CompletionStage<Boolean> internalPut(String internalKey, V value, PutPolicy policy)
internalPut in class AbstractStableReadExternalCache<V>protected CompletionStage<Void> internalRemove(Iterable<String> internalKeys)
internalRemove in class AbstractStableReadExternalCache<V>protected CompletionStage<Void> internalRemoveAll()
internalRemoveAll in class AbstractStableReadExternalCache<V>protected org.slf4j.Logger getLogger()
AbstractExternalCachegetLogger in class AbstractExternalCache<V>protected AbstractExternalCacheRequestContext<V> ensureCacheContext()
AbstractExternalCacheensureCacheContext in class AbstractExternalCache<V>protected V handleCreation(String internalKey, Supplier<V> supplier) throws ExecutionException, InterruptedException
AbstractNonDirectExternalCachehandleCreation in class AbstractNonDirectExternalCache<V>internalKey - the internal key for the entry.supplier - called to create the value, if requiredExecutionExceptionInterruptedExceptionprotected Map<String,V> handleCreation(Function<Set<String>,Map<String,V>> factory, Set<String> externalKeys) throws ExecutionException, InterruptedException
AbstractNonDirectExternalCachehandleCreation in class AbstractNonDirectExternalCache<V>factory - called to create the required values.externalKeys - the external keys for the entries.ExecutionExceptionInterruptedExceptionprotected final ExternalCacheException mapException(Exception ex)
AbstractExternalCacheException to a corresponding ExternalCacheException.mapException in class AbstractExternalCache<V>protected final Optional<V> directGet(String externalKey)
AbstractNonDirectExternalCachedirectGet in class AbstractNonDirectExternalCache<V>protected final Map<String,Optional<V>> directGetBulk(Set<String> externalKeys)
AbstractNonDirectExternalCachedirectGetBulk in class AbstractNonDirectExternalCache<V>Copyright © 2016 Atlassian. All rights reserved.