File tree Expand file tree Collapse file tree 1 file changed +1
-18
lines changed
dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support Expand file tree Collapse file tree 1 file changed +1
-18
lines changed Original file line number Diff line number Diff line change 1616 */
1717package org .apache .dubbo .rpc .cluster .support ;
1818
19- import org .apache .dubbo .rpc .Invocation ;
2019import org .apache .dubbo .rpc .Invoker ;
21- import org .apache .dubbo .rpc .Result ;
2220import org .apache .dubbo .rpc .RpcException ;
2321import org .apache .dubbo .rpc .cluster .Cluster ;
2422import org .apache .dubbo .rpc .cluster .Directory ;
25- import org .apache .dubbo .rpc .cluster .LoadBalance ;
26-
27- import java .util .List ;
2823
2924/**
3025 * AvailableCluster
@@ -36,19 +31,7 @@ public class AvailableCluster implements Cluster {
3631
3732 @ Override
3833 public <T > Invoker <T > join (Directory <T > directory ) throws RpcException {
39-
40- return new AbstractClusterInvoker <T >(directory ) {
41- @ Override
42- public Result doInvoke (Invocation invocation , List <Invoker <T >> invokers , LoadBalance loadbalance ) throws RpcException {
43- for (Invoker <T > invoker : invokers ) {
44- if (invoker .isAvailable ()) {
45- return invoker .invoke (invocation );
46- }
47- }
48- throw new RpcException ("No provider available in " + invokers );
49- }
50- };
51-
34+ return new AvailableClusterInvoker <>(directory );
5235 }
5336
5437}
You can’t perform that action at this time.
0 commit comments