pkuwm 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_r382968195
##########
File path:
helix-rest/src/main/java/org/apache/helix/rest/metadatastore/MetadataStoreDirectory.java
##########
@@ -51,6 +52,14 @@
*/
Collection<String> getAllShardingKeys(String namespace);
+ /**
+ * Returns all path-based sharding keys by realm in the given namespace.
+ *
+ * @param namespace namespace in metadata store directory.
+ * @return Map: realm -> List of sharding keys
+ */
+ Map<String, List<String>> getShardingKeysByRealm(String namespace);
Review comment:
I initially did considered it but when implementing the method, I found the
`_realmToShardingKeysMap` returns a `Map<String, List<String>>`. If I make it
List to Collection, we have to do extra work to iterate the map, create a new
map and convert List to Collection. I just don't want to do this for
performance consideration. I always try to make Rest API respond as fast as
possible. As in this case, List is still fine over a Collection in the map.
This is my thought.
Well, if you think this kind of consistency is more important and preferred
over the performance, I am OK.
----------------------------------------------------------------
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]