[GitHub] diecui1202 commented on issue #934: Extension of LoadBalance (a small suggestion for loadbalance policy when there's less than 2 providers)

2018-05-29 Thread GitBox
diecui1202 commented on issue #934: Extension of  LoadBalance (a small 
suggestion for loadbalance policy when there's less than 2 providers)
URL: https://github.com/apache/incubator-dubbo/issues/934#issuecomment-392725800
 
 
   Could you tell us the scenario that need to expand when only 1 invoker 
exists.


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:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org
For additional commands, e-mail: notifications-h...@dubbo.apache.org



[GitHub] diecui1202 commented on issue #934: Extension of LoadBalance (a small suggestion for loadbalance policy when there's less than 2 providers)

2018-05-07 Thread GitBox
diecui1202 commented on issue #934: Extension of  LoadBalance (a small 
suggestion for loadbalance policy when there's less than 2 providers)
URL: https://github.com/apache/incubator-dubbo/issues/934#issuecomment-386971248
 
 
   After discussing with @chickenlj , we decide to remove 140-142 lines, as the 
following shows: 
   
   ```java
   private Invoker doSelect(LoadBalance loadbalance, Invocation invocation, 
List invokers, List selected) throws RpcException {
   if (invokers == null || invokers.isEmpty())
   return null;
   if (invokers.size() == 1)
   return invokers.get(0);
   // If we only have two invokers, use round-robin instead.
   140//if (invokers.size() == 2 && selected != null && 
!selected.isEmpty()) {
   141//return selected.get(0) == invokers.get(0) ? invokers.get(1) 
: invokers.get(0);
   142//}
   if (loadbalance == null) {
   loadbalance = 
ExtensionLoader.getExtensionLoader(LoadBalance.class).getExtension(Constants.DEFAULT_LOADBALANCE);
   }
   Invoker invoker = loadbalance.select(invokers, getUrl(), 
invocation);
   
   //If the `invoker` is in the  `selected` or invoker is unavailable 
&& availablecheck is true, reselect.
   if ((selected != null && selected.contains(invoker))
   ```
   
   Because the `selected` param is only not null when retry or in 
ForkingClusterInvoker. And the reselect function will finally select a 
avaliable invoker. 
   
   So these 3 lines code seems unnecessary. 


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:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org
For additional commands, e-mail: notifications-h...@dubbo.apache.org



[GitHub] diecui1202 commented on issue #934: Extension of LoadBalance (a small suggestion for loadbalance policy when there's less than 2 providers)

2018-05-07 Thread GitBox
diecui1202 commented on issue #934: Extension of  LoadBalance (a small 
suggestion for loadbalance policy when there's less than 2 providers)
URL: https://github.com/apache/incubator-dubbo/issues/934#issuecomment-386971248
 
 
   After discussing with @chickenlj , we decide to remove 140-142 lines, as the 
following shows: 
   
   ```java
   private Invoker doSelect(LoadBalance loadbalance, Invocation invocation, 
List invokers, List selected) throws RpcException {
   if (invokers == null || invokers.isEmpty())
   return null;
   if (invokers.size() == 1)
   return invokers.get(0);
   // If we only have two invokers, use round-robin instead.
   //if (invokers.size() == 2 && selected != null && 
!selected.isEmpty()) {
   //return selected.get(0) == invokers.get(0) ? invokers.get(1) : 
invokers.get(0);
   //}
   if (loadbalance == null) {
   loadbalance = 
ExtensionLoader.getExtensionLoader(LoadBalance.class).getExtension(Constants.DEFAULT_LOADBALANCE);
   }
   Invoker invoker = loadbalance.select(invokers, getUrl(), 
invocation);
   
   //If the `invoker` is in the  `selected` or invoker is unavailable 
&& availablecheck is true, reselect.
   if ((selected != null && selected.contains(invoker))
   ```
   
   Because the `selected` param is only not null when retry or in 
ForkingClusterInvoker. And the reselect function will finally select a 
avaliable invoker. 
   
   So these 3 lines code seems unnecessary. 


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:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org
For additional commands, e-mail: notifications-h...@dubbo.apache.org



[GitHub] diecui1202 commented on issue #934: Extension of LoadBalance (a small suggestion for loadbalance policy when there's less than 2 providers)

2018-05-04 Thread GitBox
diecui1202 commented on issue #934: Extension of  LoadBalance (a small 
suggestion for loadbalance policy when there's less than 2 providers)
URL: https://github.com/apache/incubator-dubbo/issues/934#issuecomment-386523125
 
 
   Get it. I will do it in a few days.


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:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org
For additional commands, e-mail: notifications-h...@dubbo.apache.org