-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
add scheduler client (with caching) #1187
Conversation
|
||
} | ||
void resetCache(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the part i mentioned in the PR description. caching isn't fully hidden. but couldn't really think of another way to allow the caller to invalidate the cache without exposing it like this.
* case where the docker image is replaced with an image of the same name and tag) and they are | ||
* called very frequently. | ||
*/ | ||
public class SpecCachingSchedulerJobClient extends DefaultSchedulerJobClient implements CachingSchedulerJobClient { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I usually delegation instead of inheritance for that kind of class:
new SpecCacheSJC(client);
most of the methods would just call:
client.xxx()
and only the one where you want to change behavior you add your code.
That allows you to compose features on top of the DefaultClient
You can argue that this is over-engineered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also since you can not hide the cache invalidation, I guess it doesn't really matter.
a89e657
to
f4eb9b8
Compare
This is a low priority PR. Wanted to try something out on caching while I was making changes in the area. This PR does not block anything related to your current weekly or monthly goals
What
How
Outcome
Checklist
Recommended reading order
SchedulerJobClient
DefaultSchedulerJobClient
CachingSchedulerJobClient.
SpecCachingSchedulerJobClient.
SchedulerHandler