NealSun96 commented on a change in pull request #731: Add TrieRoutingData 
constructor
URL: https://github.com/apache/helix/pull/731#discussion_r377213249
 
 

 ##########
 File path: 
helix-rest/src/main/java/org/apache/helix/rest/metadatastore/TrieRoutingData.java
 ##########
 @@ -58,20 +71,26 @@ public TrieRoutingData(TrieNode rootNode) {
     nodeStack.push(curNode);
     while (!nodeStack.isEmpty()) {
       curNode = nodeStack.pop();
-      if (curNode._isLeaf) {
-        resultMap.put(curNode._name, curNode._realmAddress);
+      if (curNode.isLeaf()) {
+        resultMap.put(curNode.getName(), curNode.getRealmAddress());
       } else {
-        for (TrieNode child : curNode._children.values()) {
+        for (TrieNode child : curNode.getChildren().values()) {
           nodeStack.push(child);
         }
       }
     }
     return resultMap;
   }
 
-  public String getMetadataStoreRealm(String path) throws 
NoSuchElementException {
+  public String getMetadataStoreRealm(String path)
+      throws IllegalArgumentException, NoSuchElementException {
+    if (path.isEmpty() || !path.substring(0, 1).equals(DELIMITER)) {
+      throw new IllegalArgumentException(
+          "Provided path is empty or does not have a leading delimiter: " + 
path);
 
 Review comment:
   ditto

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@helix.apache.org
For additional commands, e-mail: reviews-h...@helix.apache.org

Reply via email to