narendly commented on a change in pull request #731: Add TrieRoutingData
constructor
URL: https://github.com/apache/helix/pull/731#discussion_r376730269
##########
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:
delimiter = "/"
----------------------------------------------------------------
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]