com.alibaba.dubbo.rpc.cluster.support
Class SwitchCluster
java.lang.Object
com.alibaba.dubbo.rpc.cluster.support.SwitchCluster
- All Implemented Interfaces:
- Cluster
public class SwitchCluster
- extends Object
- implements Cluster
SwitchCluster.
支持在多个Invoker(注册中心Invoker,内部Wrapper了多个Invoker)之间切换。
- 选用连接着(Connected)的注册中心。《br />
如果注册中心全都不是Connected的,则退化选用用是Available的注册中心(即有Available的Provider)。
这一步,可以选出多个注册中心
- 优先使用 前面配置的注册中心(即配置注册中心序列表示优先级),除非后面的注册中心的Provider数 >= 此注册中心的Provider * 比例因子。
缺省比例因子是2。
- Author:
- ding.lid
|
Method Summary |
|
join(Directory<T> directory)
Merge the directory invokers to a virtual invoker. |
NAME
public static final String NAME
- See Also:
- Constant Field Values
SwitchCluster
public SwitchCluster()
join
public <T> Invoker<T> join(Directory<T> directory)
throws RpcException
- Description copied from interface:
Cluster
- Merge the directory invokers to a virtual invoker.
- Specified by:
join in interface Cluster
- Returns:
- cluster invoker
- Throws:
RpcException
Copyright © 2012 Alibaba. All Rights Reserved.