chakidan
chakidan

Reputation: 11

Guava Cache property update on the fly

Can I update the Guava cache properties like initialCapacity, concurrencyLevel, durationInSeconds, maximumSize etc on the fly? For example, can I update maximumSize of the cache Once the cache is already up and initialized from a program?

Upvotes: 1

Views: 180

Answers (1)

dimo414
dimo414

Reputation: 48824

No, these properties can only be set when first creating your cache via CacheBuilder. If you need to change the caching semantics the easiest option is to create a new cache instance and copy the contents of the old cache to the new one.

Upvotes: 1

Related Questions