-
Notifications
You must be signed in to change notification settings - Fork 10.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refreshAfterWrite does not use loadAll #1975
Comments
This may be too invasive of a change for the Guava team to resolve soon. For the short-term, I'd see if your datasource supports multi-get escalation to collapse a sequence of gets into a single operation (see memcached clients for an example). For the Guava team, since few are familiar with the cache logic.... When A simplistic approach of returning a tuple A naive but optimal approach would have to duplicate logic and be much more low-level in order to track both missing and refreshable keys. This might mean that the top-level is more aware of the segment's internals and creates a more cumbersome execution path. Probably the best solution would be to pass a collecting parameter to the segment's Note that this issue is currently present in Caffeine and I haven't decided if it will be addressed soon or backlogged. No matter how it is done, this change is invasive and slightly ugly but worthwhile as a valid expectation. |
The issue also manifests in |
still had met the same issue |
I think this should be closed and users directed to use their favorite Reactive Streams library. See this example using Resctor, which could trivially be adjusted to complete Guava’s ListenableFuture. |
If you have a CacheLoader with loadAll implemented in use with a LoadingCache that is configured to refreshAfterWrite, calls to getAll load each item individually rather than falling back to the bulk loadAll for all expired keys. This can cause some serious issues when your datasource has high latency. It would be nice if refreshAfterWrite functioned the same as expiredAfterWrite, in that loadAll gets called for all the expired keys.
Here is an example that shows the behavior:
The text was updated successfully, but these errors were encountered: