liubao68 commented on a change in pull request #892: [SCB-613]delete useless
EndpointsCache related classs
URL:
https://github.com/apache/incubator-servicecomb-java-chassis/pull/892#discussion_r215160805
##########
File path:
service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/IpPortManager.java
##########
@@ -100,23 +92,7 @@ private IpPort getAvailableAddress(int index) {
if (index < defaultIpPort.size()) {
return defaultIpPort.get(index);
}
- List<CacheEndpoint> endpoints = getDiscoveredIpPort();
- if (endpoints == null || (index >= defaultIpPort.size() +
endpoints.size())) {
- currentAvailableIndex.set(0);
- return defaultIpPort.get(0);
- }
- maxRetryTimes = defaultIpPort.size() + endpoints.size();
- CacheEndpoint nextEndpoint = endpoints.get(index - defaultIpPort.size());
- return new URIEndpointObject(nextEndpoint.getEndpoint());
- }
-
- private List<CacheEndpoint> getDiscoveredIpPort() {
- if (!autoDiscoveryInited ||
!this.serviceRegistryConfig.isRegistryAutoDiscovery()) {
- return null;
- }
- InstanceCache instanceCache =
instanceCacheManager.getOrCreate(REGISTRY_APP_ID,
- REGISTRY_SERVICE_NAME,
- DefinitionConst.VERSION_RULE_LATEST);
- return instanceCache.getOrCreateTransportMap().get(defaultTransport);
+ currentAvailableIndex.set(0);
Review comment:
Delete this code, the function get lost and auto discovery will not work.
Should think a solution for this.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services