narendly commented on a change in pull request #731: Add TrieRoutingData 
constructor
URL: https://github.com/apache/helix/pull/731#discussion_r376730856
 
 

 ##########
 File path: 
helix-rest/src/main/java/org/apache/helix/rest/metadatastore/ZkMetadataStoreDirectory.java
 ##########
 @@ -170,20 +170,21 @@ public void refreshRoutingData(String namespace) {
     // Check if namespace exists; otherwise, return as a NOP and log it
     if (!_routingZkAddressMap.containsKey(namespace)) {
       LOG.error("Failed to refresh internally-cached routing data! Namespace 
not found: " + namespace);
+      return;
     }
 
     try {
-      _realmToShardingKeysMap.put(namespace, 
_routingDataReaderMap.get(namespace).getRoutingData());
+      Map<String, List<String>> routingData = 
_routingDataReaderMap.get(namespace).getRoutingData();
+      _realmToShardingKeysMap.put(namespace, routingData);
+
+      if (_routingDataMap != null) {
+        MetadataStoreRoutingData newRoutingData = new 
TrieRoutingData(routingData);
+        _routingDataMap.put(namespace, newRoutingData);
+      }
     } catch (InvalidRoutingDataException e) {
-      LOG.error("Failed to get routing data for namespace: " + namespace + 
"!");
+      LOG.error("Routing data construction has failed for namespace: " + 
namespace + "!");
 
 Review comment:
   Not necessarily. There are a few different places where you could get this 
exception, so your log could be misleading.
   
   You should do `LOG.error("Failed to refresh cached routing data for 
namespace {}, namespace, e);` This propagates the correct exception message.

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