Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[MD] Support legacy client for data source #2204
[MD] Support legacy client for data source #2204
Changes from 5 commits
1d7fbf3
30cd218
d26ac47
a26db06
6244daf
5435d9d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 have this pool includes a LRU of <endpoint, root_client> . since now we support Legacy client, shall we have one pool for legacy client, and another pool for new client? otherwise, it will cause runtime error when when a use case need a legacy client while getting a new client root client from the pool, and verse versa.
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.
There are in fact 2 pool instances being initiated in the constructor of
DataSourceService
here. One only stores new client, the other one for legacy client.Since the only different of pool impl for legacy or new client is the "value" type of the LRU, I didn't make a copy of
client_pool
to avoid having too much duplicate code. Instead I defined the LRU type as multiple type.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'd prefer to have 2 cache in the pool to avoid misuse the pool. but the current implementation makes sense to me.