-
Notifications
You must be signed in to change notification settings - Fork 547
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
Allow subscribing to a single resource #1037
base: master
Are you sure you want to change the base?
Conversation
This new endpoint on `XdsClient` allows one to watch a single URI using the glob collection interface. The watcher will be notified whenever the URI changes or is deleted, which allows for lightweight watches of a singular URI instead of needing to watch the entire cluster.
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.
Please if my understanding aligns with your thought: we don't want to store this single uri resource into event bus, so that it will not to be put into load balancer, nor saved to FS, as it's not needed.
} | ||
else | ||
{ | ||
metricsProvider.trackLatency(System.currentTimeMillis() - d2Uri.getModifiedTime().getSeconds() * 1000); |
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 need to update _d2Uri and notify the watchers.
@@ -95,6 +95,23 @@ final void onChanged(ResourceUpdate update) | |||
} | |||
} | |||
|
|||
public static abstract class D2UriResourceWatcher |
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.
we should make this extends ResourceWatcher for better code structure, so that:
- watchD2Uri is not needed, and can just reuse watchXdsResource(globCollectionUrn(cluster, uri), watcher).
- D2UriSubscriber is not needed, and can just use ResourceSubscriber.
just a reminder for updating the version and changelog |
This new endpoint on
XdsClient
allows one to watch a single URI using the glob collection interface. The watcher will be notified whenever the URI changes or is deleted, which allows for lightweight watches of a singular URI instead of needing to watch the entire cluster.