A significant attempt is made to ensure only one node of the cache works on a specific key at a time. There is no guarantee that every triggered refresh ahead case will be processed. As the maximum number of backlog entries is reached, refresh ahead requests will be dropped silently.
Provided the Number of threads per node * Number of nodes < the maximum backlog, only one node in the cluster will refresh a given key at
a time.
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final Object | |
| private final RefreshAheadCacheConfiguration | |
| private final AtomicLong | |
| private volatile ThreadedWorkQueue | |
| private volatile Ehcache | |
| private CacheConfiguration |
| Access | Constructor and Description |
|---|---|
| public | RefreshAheadCache(Ehcache adaptedCache, RefreshAheadCacheConfiguration refreshConfig)
Create a Refresh Ahead Cache Adaptor with the specified configuration. |
| Modifier and Type | Method and Description |
|---|---|
| private boolean | |
| public static Set | |
| public static Set | |
| public static Set | Returns: the setthe cache this statistic is attached to. cache)Find offer statistic. |
| public static Set | |
| public static Set | Returns: the setthe cache this statistic is attached to. cache)Find refreshed counter statistic. |
| public Element | get(Object
an Object value key)Overrides net. Implements net. |
| public Element | get(Serializable
a serializable value key)Overrides net. Implements net. |
| public long | |
| public long | |
| public String | getName()
Overrides net. Implements net. |
| public long | |
| public long | |
| public long | |
| private void | |
| private void | |
| private void | |
| private void |
| DEFAULT_SUPPORT_TTL_SECONDS | back to summary |
|---|---|
| private static final int DEFAULT_SUPPORT_TTL_SECONDS | |
| REFRESH_VALUE | back to summary |
|---|---|
| private static final Object REFRESH_VALUE | |
| refreshAheadConfig | back to summary |
|---|---|
| private final RefreshAheadCacheConfiguration refreshAheadConfig | |
| refreshSuccessCount | back to summary |
|---|---|
| private final AtomicLong refreshSuccessCount | |
| refreshWorkQueue | back to summary |
|---|---|
| private volatile ThreadedWorkQueue<Object> refreshWorkQueue | |
| supportCache | back to summary |
|---|---|
| private volatile Ehcache supportCache | |
| supportConfig | back to summary |
|---|---|
| private CacheConfiguration supportConfig | |
| RefreshAheadCache | back to summary |
|---|---|
| public RefreshAheadCache(Ehcache adaptedCache, RefreshAheadCacheConfiguration refreshConfig) Create a Refresh Ahead Cache Adaptor with the specified configuration. An auxiliary EhCache Cache will be created for the purposes of synchronization, so only one node in a clustered environment will refresh a key at a given time. | |
| checkForRefresh | back to summary |
|---|---|
| private boolean checkForRefresh(Element elem, long accessTime, long timeToRefreshMillis) | |
| findBacklogStatistic | back to summary |
|---|---|
| public static Set Find backlog statistic.
| |
| findDroppedStatistic | back to summary |
|---|---|
| public static Set Find dropped statistic.
| |
| findOfferStatistic | back to summary |
|---|---|
| public static Set Find offer statistic.
| |
| findProcessedStatistic | back to summary |
|---|---|
| public static Set Find processed statistic.
| |
| findRefreshedStatistic | back to summary |
|---|---|
| public static Set Find refreshed counter statistic.
| |
| get | back to summary |
|---|---|
| public Element get(Object key) throws IllegalStateException, CacheException Overrides net. Implements net. Doc from net. Gets an element from the cache. Updates Element Statistics
Note that the Element's lastAccessTime is always the time of this get.
Use
| |
| get | back to summary |
|---|---|
| public Element get(Serializable key) throws IllegalStateException, CacheException Overrides net. Implements net. Doc from net. Gets an element from the cache. Updates Element Statistics
Note that the Element's lastAccessTime is always the time of this get.
Use
| |
| getBacklogCount | back to summary |
|---|---|
| public long getBacklogCount() Gets backlog count.
| |
| getDroppedCount | back to summary |
|---|---|
| public long getDroppedCount() Gets dropped count.
| |
| getName | back to summary |
|---|---|
| public String getName() Overrides net. Implements net. Doc from net. Gets the cache name.
| |
| getOfferCount | back to summary |
|---|---|
| public long getOfferCount() Gets offer count.
| |
| getProcessedCount | back to summary |
|---|---|
| public long getProcessedCount() Gets processed count.
| |
| getRefreshSuccessCount | back to summary |
|---|---|
| public long getRefreshSuccessCount() number of refreshes processed locally.
| |
| initSupportCache | back to summary |
|---|---|
| private void initSupportCache() | |
| initWorkQueue | back to summary |
|---|---|
| private void initWorkQueue() | |
| localDispose | back to summary |
|---|---|
| private void localDispose() throws IllegalStateException | |
| possiblyTriggerRefresh | back to summary |
|---|---|
| private void possiblyTriggerRefresh(Element elem, long timeToRefreshMillis) | |