You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/06/08 23:49:06 UTC

[GitHub] [incubator-pinot] jackjlli commented on a change in pull request #7033: Include null check for setting minion tag.

jackjlli commented on a change in pull request #7033:
URL: https://github.com/apache/incubator-pinot/pull/7033#discussion_r647868700



##########
File path: pinot-minion/src/main/java/org/apache/pinot/minion/MinionStarter.java
##########
@@ -284,7 +284,8 @@ private void addInstanceTagIfNeeded() {
     HelixAdmin helixAdmin = _helixManager.getClusterManagmentTool();
     String clusterName = _helixManager.getClusterName();
     InstanceConfig instanceConfig = helixAdmin.getInstanceConfig(clusterName, _instanceId);
-    if (instanceConfig.getTags().isEmpty()) {
+    List<String> instanceTags = instanceConfig.getTags();

Review comment:
       The returned instanceConfig could be null if record is null. @amrishlal Please add the check `instanceConfig == null ` as well.
   
   ```
     public static <T extends HelixProperty> T convertToTypedInstance(Class<T> clazz, ZNRecord record) {
       if (record == null) {
         return null;
       }
   
       try {
         Constructor<T> constructor = clazz.getConstructor(ZNRecord.class);
         return constructor.newInstance(record);
       } catch (Exception e) {
         LOG.error("Exception convert znrecord: " + record + " to class: " + clazz, e);
       }
   
       return null;
     }
   ```




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org