narendly commented on a change in pull request #844: Implement setRoutingData 
for MetadataStoreDirectoryService
URL: https://github.com/apache/helix/pull/844#discussion_r386764843
 
 

 ##########
 File path: 
helix-rest/src/main/java/org/apache/helix/rest/metadatastore/ZkMetadataStoreDirectory.java
 ##########
 @@ -113,10 +113,14 @@ private void init(String namespace, String zkAddress) 
throws InvalidRoutingDataE
           _routingDataWriterMap.put(namespace, new 
ZkRoutingDataWriter(namespace, zkAddress));
 
           // Populate realmToShardingKeys with ZkRoutingDataReader
-          _realmToShardingKeysMap
-              .put(namespace, 
_routingDataReaderMap.get(namespace).getRoutingData());
-          _routingDataMap
-              .put(namespace, new 
TrieRoutingData(_realmToShardingKeysMap.get(namespace)));
+          Map<String, List<String>> rawRoutingData =
+              _routingDataReaderMap.get(namespace).getRoutingData();
+          _realmToShardingKeysMap.put(namespace, rawRoutingData);
+          try {
+            _routingDataMap.put(namespace, new 
TrieRoutingData(rawRoutingData));
+          } catch (InvalidRoutingDataException e) {
+            // Do not create TrieRoutingData if the routing data is invalid
 
 Review comment:
   Great that you've considered possible log pollution! I think a WARN log 
would be okay to add here. Note that we are not expecting very frequent writes 
:) 

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