Waits uninterruptibly for newValue to be loaded, and then records loading stats.
(
K key,
int hash,
LoadingValueReference<K, V> loadingValueReference,
ListenableFuture<V> newValue)
| 2414 | */ |
| 2415 | |
| 2416 | V getAndRecordStats( |
| 2417 | K key, |
| 2418 | int hash, |
| 2419 | LoadingValueReference<K, V> loadingValueReference, |
| 2420 | ListenableFuture<V> newValue) throws ExecutionException { |
| 2421 | V value = null; |
| 2422 | try { |
| 2423 | value = getUninterruptibly(newValue); |
| 2424 | if (value == null) { |
| 2425 | throw new InvalidCacheLoadException("CacheLoader returned null for key " + key + "."); |
| 2426 | } |
| 2427 | statsCounter.recordLoadSuccess(loadingValueReference.elapsedNanos()); |
| 2428 | storeLoadedValue(key, hash, loadingValueReference, value); |
| 2429 | return value; |
| 2430 | } finally { |
| 2431 | if (value == null) { |
| 2432 | statsCounter.recordLoadException(loadingValueReference.elapsedNanos()); |
| 2433 | removeLoadingValue(key, hash, loadingValueReference); |
| 2434 | } |
| 2435 | } |
| 2436 | } |
| 2437 | |
| 2438 | V scheduleRefresh(ReferenceEntry<K, V> entry, K key, int hash, V oldValue, long now, CacheLoader<? super K, V> loader) { |
| 2439 | if (map.refreshes() |
no test coverage detected