Skip to content

Commit

Permalink
refactor:extract method in AbstractCluster (sofastack#924)
Browse files Browse the repository at this point in the history
* refactor:extract method
  • Loading branch information
OrezzerO authored May 22, 2020
1 parent ed9a2fc commit 0f74f5f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ protected ProviderInfo select(SofaRequest message, List<ProviderInfo> invokedPro
* @return the provider
*/
protected ProviderInfo selectPinpointProvider(String targetIP, List<ProviderInfo> providerInfos) {
ProviderInfo tp = ProviderHelper.toProviderInfo(targetIP);
ProviderInfo tp = convertToProviderInfo(targetIP);
// 存在注册中心provider才会遍历
if (CommonUtils.isNotEmpty(providerInfos)) {
for (ProviderInfo providerInfo : providerInfos) {
Expand All @@ -476,6 +476,10 @@ protected ProviderInfo selectPinpointProvider(String targetIP, List<ProviderInfo
return tp;
}

protected ProviderInfo convertToProviderInfo(String targetIP) {
return ProviderHelper.toProviderInfo(targetIP);
}

/**
* 找不到可用的服务列表的异常
*
Expand Down

0 comments on commit 0f74f5f

Please sign in to comment.