MCPcopy Create free account
hub / github.com/antlr/codebuff / waitForLoadingValue

Method waitForLoadingValue

output/java_guava/1.4.13/LocalCache.java:2364–2383  ·  view source on GitHub ↗
(ReferenceEntry<K, V> e, K key, ValueReference<K, V> valueReference)

Source from the content-addressed store, hash-verified

2362 }
2363
2364 V waitForLoadingValue(ReferenceEntry<K, V> e, K key, ValueReference<K, V> valueReference) throws ExecutionException {
2365 if (!valueReference.isLoading()) {
2366 throw new AssertionError();
2367 }
2368 checkState(!Thread.holdsLock(e), "Recursive load of: %s", key);
2369 // don't consider expiration as we're concurrent with loading
2370 try {
2371 V value = valueReference.waitForValue();
2372 if (value == null) {
2373 throw new InvalidCacheLoadException("CacheLoader returned null for key " + key + ".");
2374 }
2375 // re-read ticker now that loading has completed
2376
2377 long now = map.ticker.read();
2378 recordRead(e, now);
2379 return value;
2380 } finally {
2381 statsCounter.recordMisses(1);
2382 }
2383 }
2384
2385 // at most one of loadSync/loadAsync may be called for any given LoadingValueReference
2386

Callers 2

getMethod · 0.95
lockedGetOrLoadMethod · 0.95

Calls 6

recordReadMethod · 0.95
isLoadingMethod · 0.65
waitForValueMethod · 0.65
recordMissesMethod · 0.65
checkStateMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected