NealSun96 commented on a change in pull request #788: Implement request 
forwarding for ZkRoutingDataWriter
URL: https://github.com/apache/helix/pull/788#discussion_r384652452
 
 

 ##########
 File path: 
helix-rest/src/main/java/org/apache/helix/rest/metadatastore/accessor/ZkRoutingDataWriter.java
 ##########
 @@ -77,8 +103,9 @@ public synchronized boolean addMetadataStoreRealm(String 
realm) {
       return createZkRealm(realm);
     }
 
-    // TODO: Forward the request to leader
-    return true;
+    String url_suffix = "namespaces/" + _namespace + "/metadata-store-realms/" 
+ realm;
 
 Review comment:
   1. I wanted to include the url creation as a part of 
`forwardRequestToLeader`, but I do not see a good way to generalize url 
construction. The 4 endpoints require 2 different urls; refactoring it results 
in an if statement, which isn't generalization. On the other hand, leaving url 
construction logic in the methods also clearly indicates which urls each 
endpoints correspond to, which is good for maintenance. 
   2. In `MetadataStoreRoutingConstants`, the constants are not quite the same 
as the strings in these urls. (`shardingKeys` vs `sharding-keys`, 
`metadataStoreRealms` vs `metadata-store-realms`)

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to