chickenlj commented on a change in pull request #9424:
URL: https://github.com/apache/dubbo/pull/9424#discussion_r774912624



##########
File path: 
dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/RouterChain.java
##########
@@ -63,19 +64,16 @@
      */
     private volatile List<Router> builtinRouters = Collections.emptyList();
 
-    private volatile List<StateRouter<T>> builtinStateRouters = 
Collections.emptyList();
-    private volatile List<StateRouter<T>> stateRouters = 
Collections.emptyList();
+    private volatile StateRouter<T> headStateRouter;
+
+    private volatile List<StateRouter<T>> stateRouters;

Review comment:
       I cannot tell the design purpose of keeping both 
`RouterChain.stateRouters` and `StateRouter.setNextRouter()`.
   
   We already have a router chain with the following look:
   `HeaderRouter` -> `XxxRouter1` -> `XxxRouter2` -> `TailRouter`
   All functions like 'notify', 'route', 'destroy', 'getSnapshot' can be 
started from HeaderRouter and run automatically to the end following the chain.
   
   So what's the necessity of the list attribute in RouterChain hosting 
[XxxRouter1, XxxRouter2]




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to