Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

PapaCharlie
Copy link
Member

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.

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.
Copy link
Contributor

@bohhyang bohhyang left a 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);
Copy link
Contributor

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
Copy link
Contributor

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:

  1. watchD2Uri is not needed, and can just reuse watchXdsResource(globCollectionUrn(cluster, uri), watcher).
  2. D2UriSubscriber is not needed, and can just use ResourceSubscriber.

@bohhyang
Copy link
Contributor

just a reminder for updating the version and changelog

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