NealSun96 commented on a change in pull request #858: Add logs and throw 
exceptions in getInstanceById
URL: https://github.com/apache/helix/pull/858#discussion_r388022876
 
 

 ##########
 File path: 
helix-rest/src/main/java/org/apache/helix/rest/server/service/InstanceServiceImpl.java
 ##########
 @@ -101,9 +103,15 @@ public InstanceInfo getInstanceInfo(String clusterId, 
String instanceName,
             _dataAccessor.keyBuilder().currentState(instanceName, sessionId, 
resourceName));
         if (currentState != null && currentState.getPartitionStateMap() != 
null) {
           partitions.addAll(currentState.getPartitionStateMap().keySet());
+        } else {
+          LOG.warn(
+              "Current state is either null or partitionStateMap is missing. 
InstanceName: {}, SessionId: {}, ResourceName: {}",
+              instanceName, sessionId, resourceName);
         }
       }
       instanceInfoBuilder.partitions(partitions);
+    } else {
+      LOG.warn("Missing instance config for {}", instanceName);
 
 Review comment:
   Oops, let me fix that. 

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