-
Notifications
You must be signed in to change notification settings - Fork 827
[JAV-264]support zone aware load balance features #106
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
Conversation
|
||
@Override | ||
public List<Server> getFilteredListOfServers(List<Server> list) { | ||
List<Server> result = new ArrayList<>(); |
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.
is it possible to create cache for this?
avoid loop and build the list each time?
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.
not possible here because doing that we have to iterate 'list' to check if it is changed here.
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.
if want to use cache, must:
1.the filter must be the first filter
2.when create instance, save the cache reference
3.when getFilteredListOfServers, ask cache if it is changed, if changed, then rebuild zone cache
it's a little complex, if this filter caused a performance problem in the furture, then can use this method to optimize.
headers.add("X-Tenant-Name", "default"); | ||
|
||
RequestEntity<String> requestEntity = new RequestEntity<String>(headers, HttpMethod.GET, | ||
new URI("http://127.0.0.1:9980/registry/v3/microservices")); |
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.
It could be better if we can pass the service center address from the exec argument options.
No description provided.