Package org.apache.dubbo.rpc.cluster
Class SingleRouterChain<T>
java.lang.Object
org.apache.dubbo.rpc.cluster.SingleRouterChain<T>
Router chain
-
Constructor Summary
ConstructorsConstructorDescriptionSingleRouterChain(List<Router> routers, List<StateRouter<T>> stateRouters, boolean shouldFailFast, RouterSnapshotSwitcher routerSnapshotSwitcher) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRouters(List<Router> routers) If we use route:// protocol in version before 2.7.0, each URL will generate a Router instance, so we should keep the routers up to date, that is, each time router URLs changes, we should update the routers list, only keep the builtinRouters which are available all the time and the latest notified routers which are generated from URLs.buildRouterSnapshot(org.apache.dubbo.common.URL url, BitList<Invoker<T>> availableInvokers, Invocation invocation) Build each router's resultvoiddestroy()getLock()List<StateRouter<T>> Deprecated.voidinitWithRouters(List<Router> builtinRouters) the resident routers must being initialized before address notification.route(org.apache.dubbo.common.URL url, BitList<Invoker<T>> availableInvokers, Invocation invocation) routeAndPrint(org.apache.dubbo.common.URL url, BitList<Invoker<T>> availableInvokers, Invocation invocation) voidsetHeadStateRouter(StateRouter<T> headStateRouter) Deprecated.voidsetInvokers(BitList<Invoker<T>> invokers) Notify router chain of the initial addresses from registry at the first time.simpleRoute(org.apache.dubbo.common.URL url, BitList<Invoker<T>> availableInvokers, Invocation invocation)
-
Constructor Details
-
SingleRouterChain
public SingleRouterChain(List<Router> routers, List<StateRouter<T>> stateRouters, boolean shouldFailFast, RouterSnapshotSwitcher routerSnapshotSwitcher)
-
-
Method Details
-
initWithRouters
the resident routers must being initialized before address notification. only for ut -
addRouters
If we use route:// protocol in version before 2.7.0, each URL will generate a Router instance, so we should keep the routers up to date, that is, each time router URLs changes, we should update the routers list, only keep the builtinRouters which are available all the time and the latest notified routers which are generated from URLs.- Parameters:
routers- routers from 'router://' rules in 2.6.x or before.
-
getRouters
-
getHeadStateRouter
-
route
-
routeAndPrint
-
simpleRoute
-
buildRouterSnapshot
public RouterSnapshotNode<T> buildRouterSnapshot(org.apache.dubbo.common.URL url, BitList<Invoker<T>> availableInvokers, Invocation invocation) Build each router's result -
setInvokers
Notify router chain of the initial addresses from registry at the first time. Notify whenever addresses in registry change. -
setHeadStateRouter
Deprecated.for uts only -
getStateRouters
Deprecated.for uts only -
getLock
-
destroy
public void destroy()
-