narendly commented on a change in pull request #751: Implement
getAllMappingUnderPath and getMetadataStoreRealm
URL: https://github.com/apache/helix/pull/751#discussion_r377847093
##########
File path:
helix-rest/src/main/java/org/apache/helix/rest/metadatastore/accessor/ZkRoutingDataReader.java
##########
@@ -85,23 +85,14 @@ public ZkRoutingDataReader(String namespace, String
zkAddress,
"Routing data directory ZNode " +
MetadataStoreRoutingConstants.ROUTING_DATA_PATH
+ " does not exist. Routing ZooKeeper address: " + _zkAddress);
}
- if (children == null || children.isEmpty()) {
- throw new InvalidRoutingDataException(
- "There are no metadata store realms defined. Routing ZooKeeper
address: " + _zkAddress);
- }
for (String child : children) {
ZNRecord record =
_zkClient.readData(MetadataStoreRoutingConstants.ROUTING_DATA_PATH +
"/" + child);
List<String> shardingKeys =
record.getListField(MetadataStoreRoutingConstants.ZNRECORD_LIST_FIELD_KEY);
- if (shardingKeys == null || shardingKeys.isEmpty()) {
- throw new InvalidRoutingDataException(
- "Realm address ZNode " +
MetadataStoreRoutingConstants.ROUTING_DATA_PATH + "/" + child
- + " does not have a value for key "
- + MetadataStoreRoutingConstants.ZNRECORD_LIST_FIELD_KEY
- + ". Routing ZooKeeper address: " + _zkAddress);
+ if (shardingKeys != null && !shardingKeys.isEmpty()) {
+ routingData.put(child, shardingKeys);
Review comment:
If shardingKeys is empty, we should still return an empty list, correct?
Otherwise the resulting map will be missing the entire realm, which would be
incorrect.
----------------------------------------------------------------
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]