Questions tagged [google-guava-cache]

97 questions
1
vote
1 answer

Guava cache considering older key

I am facing an issue with Guava Caches. When I have only one element in cache, things are fine. But when I load a second element, Its trying to pick with key of earlier entry private static LoadingCache cache = null; .... public…
rajesh
  • 3,247
  • 5
  • 31
  • 56
1
vote
1 answer

Which function does loadingCache call when .refreshAfterWrite() ends?

I am trying to create a cache using Google LoadingCache. My program uses another rest service. I am wondering if it's possible to configure the cache such that once the .refreshAfterWrite ends it calls the loadAll function. Essentially I'd like to…
1
vote
1 answer

Looking for something like Guava Cache with NavigableMap

I'm looking for a Cache facility that can remove old entries if predefined interval expires (Like Guava Cache) but internally uses a NavigableMap interface. Is there something like that?
Shvalb
  • 1,835
  • 2
  • 30
  • 60
1
vote
1 answer

Is there any third party java cache which provides control over the expiration event?

My use-case is that I need to implement a cache on top of a service should expire entries after a certain amount of time (from their time of creation). And if the entry is getting expired, then service look up should be done to get the latest entry.…
1
vote
1 answer

Google Guava cache auto remove value of Optional.absent()

Is it possible to auto evict the record with value Optional.absent()? In some applications the Optional.absent() may not be the value for some keys. For example, if an application contains http calls where the key can be some string and the value is…
user2716189
  • 63
  • 1
  • 6
1
vote
0 answers

Caching Spring Data repositories / CacheEvict not working

I am using Spring Boot, Spring Data, with QueryDSL. Most of my queries are QueryDSL based. I want to implement a simple cache that stores User queries, and once a single entity is updated/saved then the entire Cache is cleared. So here is my…
ChrisGeo
  • 3,807
  • 13
  • 54
  • 92
1
vote
2 answers

can we use multiple types of cache(redis & guava) in spring boot at the same time?

I am trying to have two implementations of Cache for different type of objects in my spring boot application. I want to store certain objects in redis cache whereas other object in guava cache based on the method. Whenever I implement two calsses…
mohit_d
  • 235
  • 2
  • 13
1
vote
1 answer

What can be the maximum preferable size guava cache can use?

What can be the maximum preferable size guava cache can use?My system has 8 gb RAM so without degrading the performance of system and other applications how much MB's can i use ? Does Guava cache also use hardDisk storage when RAM storage is not…
agrawal1084
  • 129
  • 2
  • 11
1
vote
1 answer

Forcing refresh at specific time Guava Cache

I'm trying to get this cache to refresh every day at 3AM. The problem is that users are having to wait a long time for the cache to warm up. So I would rather it be refreshed overnight and be ready to quickly access in the morning for the UI. …
Ramie
  • 1,171
  • 2
  • 16
  • 35
1
vote
1 answer

Use Guava CacheBuilder correctly

Could somebody explain me please how to use the Guava CacheBuilder correctly. Should getFromNetwork() raise an exception or return null, if the data is not reachable? Should I raise the Execution Exception and use guavaCache.get(). I am just not…
Johannes
  • 2,732
  • 5
  • 23
  • 32
1
vote
0 answers

Guava Cache size method not returning actual number of entries in the cache

I am using guava cache in my application to boost performance. I have inserted 850 entries in the caches using putAll API in LoadingCache . My configured max cache size is 20K entries. I am testing cache size using test class TestCacheSize: public…
chammu
  • 1,275
  • 1
  • 18
  • 26
1
vote
1 answer

Reset time to expire in a Guava Cache

I'm using a Guava Cache Loader and picking up the time to expire from a config file. I'm wondering if there is a way to programmatically reset the time to expire value for a given cache. In my case this is desirable in the action of a listener that…
Manolo
  • 1,597
  • 4
  • 21
  • 35
1
vote
1 answer

@CacheEvict with key="#id" throws NullPointerException

I'm trying to use Spring Caching annotations @Cacheable and @CacheEvict together with the GuavaCacheManager. I've created a test case with these two tests: cachesById - verifies that two invocations to a method annotatted with @Cacheable returns…
Geir
  • 514
  • 4
  • 18
0
votes
1 answer

How to refresh the key and value in cache after they are expired in Guava (Spring)

So, I was looking at caching methods in Java (Spring). And Guava looked like it would solve the purpose. This is the usecase - I query for some data from a remote service. Kind of configuration field for my application. This field will be used by…
nirvair
  • 4,001
  • 10
  • 51
  • 85
0
votes
1 answer

Guava cache data loading Issue

I use guava cache in my appliation which was written in a hibernate platform. The problem is my cache doesn't work well when loading the data. It doesn't update quickly when I delete or add a new data. private void initializeCache() { …
chamzz.dot
  • 607
  • 2
  • 12
  • 24