public class TailStateRouter<T> extends Object implements StateRouter<T>
| Modifier and Type | Method and Description |
|---|---|
String |
buildSnapshot()
Build Router's Current State Snapshot for QoS
|
static <T> TailStateRouter<T> |
getInstance() |
org.apache.dubbo.common.URL |
getUrl()
Get the router url.
|
boolean |
isForce()
To decide whether this router should take effect when none of the invoker can match the router rule, which
means the
StateRouter.route(BitList, URL, Invocation, boolean, Holder) would be empty. |
boolean |
isRuntime()
To decide whether this router need to execute every time an RPC comes or should only execute when addresses or
rule change.
|
void |
notify(BitList<Invoker<T>> invokers)
Notify the router the invoker list.
|
BitList<Invoker<T>> |
route(BitList<Invoker<T>> invokers,
org.apache.dubbo.common.URL url,
Invocation invocation,
boolean needToPrintMessage,
org.apache.dubbo.common.utils.Holder<RouterSnapshotNode<T>> nodeHolder)
Filter invokers with current routing rule and only return the invokers that comply with the rule.
|
void |
setNextRouter(StateRouter<T> nextRouter)
Notify next router node to current router.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitstoppublic static <T> TailStateRouter<T> getInstance()
public void setNextRouter(StateRouter<T> nextRouter)
StateRoutersetNextRouter in interface StateRouter<T>nextRouter - next router nodepublic org.apache.dubbo.common.URL getUrl()
StateRoutergetUrl in interface StateRouter<T>public BitList<Invoker<T>> route(BitList<Invoker<T>> invokers, org.apache.dubbo.common.URL url, Invocation invocation, boolean needToPrintMessage, org.apache.dubbo.common.utils.Holder<RouterSnapshotNode<T>> nodeHolder) throws RpcException
StateRouterroute in interface StateRouter<T>invokers - invoker bit listurl - refer urlinvocation - invocationneedToPrintMessage - whether to print router state. Such as `use router branch a`.RpcExceptionpublic boolean isRuntime()
StateRouterisRuntime in interface StateRouter<T>public boolean isForce()
StateRouterStateRouter.route(BitList, URL, Invocation, boolean, Holder) would be empty. Most of time, most router implementation would
default this value to false.isForce in interface StateRouter<T>public void notify(BitList<Invoker<T>> invokers)
StateRouterStateRouter.route(BitList, URL, Invocation, boolean, Holder) gets called.
No need to notify next node.notify in interface StateRouter<T>invokers - invoker listpublic String buildSnapshot()
StateRouterbuildSnapshot in interface StateRouter<T>Copyright © 2011–2022 The Apache Software Foundation. All rights reserved.