public abstract class AbstractClusterRouter extends Object implements ClusterRouter
| 构造器和说明 |
|---|
AbstractClusterRouter() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
protected abstract Cluster[] |
getClusters()
获取集群列表,当前应用能使用的全部集群
|
protected abstract ClusterLoadBalancer |
getLoadBalancer(MethodMeta meta)
通过方法元数据可以获取当前调用的上下文信息,根据这个上下文信息,作为依据选择当前执行的方法应高使用那个集群,执行操作
|
Cluster |
route(MethodMeta meta)
根据入参信息选择一个集群执行操作
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitlocalhost, localhost, random, roundRobbin, single, weightedpublic void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableIOExceptionpublic Cluster route(MethodMeta meta)
ClusterRouterroute 在接口中 ClusterRoutermeta - 方法元信息protected abstract Cluster[] getClusters()
protected abstract ClusterLoadBalancer getLoadBalancer(MethodMeta meta)
meta - 方法元数据Copyright © 2020. All rights reserved.