|
|
@ -17,10 +17,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
package com.tencent.cloud.polaris.router;
|
|
|
|
package com.tencent.cloud.polaris.router;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.netflix.client.config.IClientConfig;
|
|
|
|
import com.netflix.client.config.IClientConfig;
|
|
|
|
import com.netflix.loadbalancer.DynamicServerListLoadBalancer;
|
|
|
|
import com.netflix.loadbalancer.DynamicServerListLoadBalancer;
|
|
|
|
import com.netflix.loadbalancer.IPing;
|
|
|
|
import com.netflix.loadbalancer.IPing;
|
|
|
@ -41,8 +37,10 @@ import com.tencent.polaris.api.pojo.ServiceKey;
|
|
|
|
import com.tencent.polaris.router.api.core.RouterAPI;
|
|
|
|
import com.tencent.polaris.router.api.core.RouterAPI;
|
|
|
|
import com.tencent.polaris.router.api.rpc.ProcessRoutersRequest;
|
|
|
|
import com.tencent.polaris.router.api.rpc.ProcessRoutersRequest;
|
|
|
|
import com.tencent.polaris.router.api.rpc.ProcessRoutersResponse;
|
|
|
|
import com.tencent.polaris.router.api.rpc.ProcessRoutersResponse;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -114,8 +112,7 @@ public class PolarisRoutingLoadBalancer extends DynamicServerListLoadBalancer<Se
|
|
|
|
serviceInfo.setMetadata(transitiveCustomMetadata);
|
|
|
|
serviceInfo.setMetadata(transitiveCustomMetadata);
|
|
|
|
processRoutersRequest.setSourceService(serviceInfo);
|
|
|
|
processRoutersRequest.setSourceService(serviceInfo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ProcessRoutersResponse processRoutersResponse = routerAPI
|
|
|
|
ProcessRoutersResponse processRoutersResponse = routerAPI.processRouters(processRoutersRequest);
|
|
|
|
.processRouters(processRoutersRequest);
|
|
|
|
|
|
|
|
ServiceInstances filteredServiceInstances = processRoutersResponse
|
|
|
|
ServiceInstances filteredServiceInstances = processRoutersResponse
|
|
|
|
.getServiceInstances();
|
|
|
|
.getServiceInstances();
|
|
|
|
List<Server> filteredInstances = new ArrayList<>();
|
|
|
|
List<Server> filteredInstances = new ArrayList<>();
|
|
|
|