Add method to clear local store cache, update client service handler.#2741
Add method to clear local store cache, update client service handler.#2741EdColeman wants to merge 2 commits intoapache:mainfrom
Conversation
EdColeman
commented
May 27, 2022
- Alternate impl of PR Clear property caches on RPC request for props #2740
- Alternate impl of PR apache#2740
ctubbsii
left a comment
There was a problem hiding this comment.
I thought about doing this in my PR, but got stuck on naming, because it wasn't obvious in the PropStore interface that the implementation would even have a locally cached copy.
I've updated my PR #2740 with the changes I think would make the situation more explicit.
I'm not sure why, but both our PRs failed in GitHub Actions. My branch passed in a Jenkins instance, in just under 4 hours, which is about 15-20 minutes faster than normal. My guess is that it finished faster because fewer flakes were re-run.
| * @param propCacheKey | ||
| * the prop cache key | ||
| */ | ||
| void clearLocal(PropCacheKey<?> propCacheKey); |
There was a problem hiding this comment.
This javadoc is really the first time it is explained anywhere in this interface that there's a locally cached copy of anything. Aside from the key being named "PropCacheKey", it's not really obvious that implementations of this interface will be doing any kind of caching. In fact, I think PropCacheKey should really be named PropStoreKey, because it's so tightly coupled to the PropStore interface, and a cache isn't necessarily implemented.
I think instead of this method, it would be good to have two changes:
- Rename PropCacheKey to PropStoreKey (and subclasses accordingly)
- Add a method to this interface called
getCache()that returns an instance of the cache, to make it more obvious that it is expected for a PropStore implementation to use one
Then, instead of calling this clearLocal method, they could just do context.propStore().getCache().remove(propStoreKey)
|
This PR is basically a duplicate of what I was doing with #2740. Can we close this and collaborate / come to consensus there instead of having two open PRs trying to do the same basic thing? |
|
closing in favor of #2740 |