narendly commented on a change in pull request #844: Implement setRoutingData
for MetadataStoreDirectoryService
URL: https://github.com/apache/helix/pull/844#discussion_r386765344
##########
File path:
helix-rest/src/main/java/org/apache/helix/rest/metadatastore/ZkMetadataStoreDirectory.java
##########
@@ -169,19 +186,31 @@ private void init(String namespace, String zkAddress)
throws InvalidRoutingDataE
@Override
public Map<String, String> getAllMappingUnderPath(String namespace, String
path) {
- if (!_routingDataMap.containsKey(namespace)) {
+ // Check _routingZkAddressMap first to see if namespace is included
+ if (!_routingZkAddressMap.containsKey(namespace)) {
throw new NoSuchElementException(
"Failed to get all mapping under path: Namespace " + namespace + "
is not found!");
}
+ // If namespace is included but not routing data, it means the routing
data is invalid
+ if (!_routingDataMap.containsKey(namespace)) {
+ throw new IllegalStateException("Failed to get all mapping under path:
Namespace " + namespace
+ + " contains invalid routing data!");
Review comment:
Could we rephrase this to say, the routing data is either _empty_ or invalid?
----------------------------------------------------------------
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]