-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR refactors xds_client to support multiples watches. Those watches can be for the same type and same resource_name. There's upper level `Client` and lower level `v2client`. Before this change, all logic was in `v2client`, and `Client` was a thin wrapper. This PR moves some of the functionality from `v2client` to `Client`. New layers: - Upper level `Client` - keeps a list of watchers - provides method `func WatchXXX() (cancel func())` - has `WatchService()` which involves `LDS` and `RDS` - handles resources from the xDS responses and dispatch to the watchers - including multiple watchers for the same resource_name - keeps cache - and checks cache for new watches - Lower level `v2client` - is a dumb client that - manages ADS stream - sends a new xDS request when add/remove watch - parses xDS responses - It doesn't call watchers, but forwards all parsed results to upper Client - handles ACK/NACK - supports `addWatch(type, name)` and `removeWatch(type, name)` - instead of `func watchCDS() func()`, which is now moved up to upper `Client` Also includes other changes: - Corresponding test changes (some tests for `v2client` were moved to `Client`) - Method and type renaming - CDS/EDS -> Cluster/Endpoints - callback functions all accept updates as non-pointers
- Loading branch information
Showing
38 changed files
with
2,906 additions
and
1,754 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.