0

What is the Graph class and createExpensiveGraph() method in the Manual Population example of Caffeine Cache:

Cache<Key, Graph> cache = Caffeine.newBuilder()
    .expireAfterWrite(10, TimeUnit.MINUTES)
    .maximumSize(10_000)
    .build();
// Lookup an entry, or null if not found
Graph graph = cache.getIfPresent(key);
// Lookup and compute an entry if absent, or null if not computable
graph = cache.get(key, k -> createExpensiveGraph(key));
// Insert or update an entry
cache.put(key, graph);
// Remove an entry
cache.invalidate(key);

https://github.com/ben-manes/caffeine/wiki/Population

?

dimo414
  • 47,227
  • 18
  • 148
  • 244
Fuzzy Analysis
  • 3,168
  • 2
  • 42
  • 66

0 Answers0