Skip to content

fix: resource cache interface for InformerEventSource #758

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

Merged
merged 5 commits into from
Dec 17, 2021

Conversation

csviri
Copy link
Collaborator

@csviri csviri commented Dec 16, 2021

No description provided.

@@ -56,8 +50,8 @@ protected void handleEvent(T value, ResourceID relatedResourceID) {
}
}

public Cache<ResourceID, T> getCache() {
return cache;
public Map<ResourceID, T> getCache() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is too restrictive… I think we should probably simplify ResourceCache and return that instead maybe?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if following, we return all the values, can it be less restrictive?

On the other hand the resource cache is now about K8S resource, and this class is dedicated to non k8s resources. So not sure if we should unify those. Those have totally different requirements. And approach how we are handling them.

Copy link
Collaborator Author

@csviri csviri Dec 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe just a very simple way.

Like having a simple interface with one method
getValue(ResourceID id)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be addressed in a subsequent PR, let's merge this as-is for now.

@@ -56,8 +50,8 @@ protected void handleEvent(T value, ResourceID relatedResourceID) {
}
}

public Cache<ResourceID, T> getCache() {
return cache;
public Map<ResourceID, T> getCache() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be addressed in a subsequent PR, let's merge this as-is for now.

@metacosm metacosm merged commit 22f03fe into main Dec 17, 2021
@metacosm metacosm deleted the caching-improvements branch December 17, 2021 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants