narendly commented on a change in pull request #799: [MSDS] Add REST endpoint 
to get mapping of all sharding keys by realm
URL: https://github.com/apache/helix/pull/799#discussion_r382965685
 
 

 ##########
 File path: 
helix-rest/src/main/java/org/apache/helix/rest/metadatastore/ZkMetadataStoreDirectory.java
 ##########
 @@ -111,6 +111,16 @@ public ZkMetadataStoreDirectory(Map<String, String> 
routingZkAddressMap)
     return allShardingKeys;
   }
 
+  @Override
+  public Map<String, List<String>> getShardingKeysByRealm(String namespace) {
+    Map<String, List<String>> shardingKeysByRealmMap = 
_realmToShardingKeysMap.get(namespace);
+    if (shardingKeysByRealmMap == null) {
+      throw new NoSuchElementException("Namespace " + namespace + " does not 
exist!");
+    }
+
+    return shardingKeysByRealmMap;
 
 Review comment:
   ```
   if (!_realmToShardingKeysMap.contains(namespace)) {
     throw Exception(~~~);
   }
   return  _realmToShardingKeys.get(namespace);
   ```
   
   seems like a more concise way of expressing this.

----------------------------------------------------------------
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