xinglin commented on code in PR #5860:
URL: https://github.com/apache/hadoop/pull/5860#discussion_r1270233735
##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterClientProtocol.java:
##########
@@ -194,6 +202,18 @@ public class RouterClientProtocol implements
ClientProtocol {
this.routerCacheAdmin = new RouterCacheAdmin(rpcServer);
this.securityManager = rpcServer.getRouterSecurityManager();
this.rbfRename = new RouterFederationRename(rpcServer, conf);
+
+ this.crsNameservicesCache = CacheBuilder.newBuilder()
Review Comment:
I misread the implementation: I thought the key was a nameservice and then
the value is whether that nameservice has an observer node or not.
There are some inconsistency in what we are trying to achieve here. In one
hand, we are leveraging static config in determining whether a nameservice has
an observerNode or not. On the other hand, we are leveraging a dynamic cache
with a size of 1 here, assuming the set of namespaces would actually be
changed. It is better to be consistent here, either based on fixed static info
or dynamic.
If we are leveraging static config in determining observerNode, we can
assume we are using a static fixed set of nameservices as well. We can just do
the check once and then assume the nameservices won't change. Or is this
proposal too naive? 😂
##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterClientProtocol.java:
##########
@@ -194,6 +202,18 @@ public class RouterClientProtocol implements
ClientProtocol {
this.routerCacheAdmin = new RouterCacheAdmin(rpcServer);
this.securityManager = rpcServer.getRouterSecurityManager();
this.rbfRename = new RouterFederationRename(rpcServer, conf);
+
+ this.crsNameservicesCache = CacheBuilder.newBuilder()
Review Comment:
I misread the implementation: I thought the key was a nameservice and then
the value is whether that nameservice has an observer node or not.
There are some inconsistency in what we are trying to achieve here. In one
hand, we are leveraging static config in determining whether a nameservice has
an observerNode or not. On the other hand, we are leveraging a dynamic cache
with a size of 1 here, assuming the set of namespaces would actually be
changed. It is better to be consistent here, either based on fixed static info
or dynamic.
If we are leveraging static config in determining observerNode, we can
assume we are using a static fixed set of nameservices as well. We can just do
the check once and then assume the nameservices won't change. Or is this
proposal too naive? 😂
--
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]