Ethanlm commented on a change in pull request #3365:
URL: https://github.com/apache/storm/pull/3365#discussion_r546944696



##########
File path: 
storm-server/src/main/java/org/apache/storm/daemon/supervisor/SupervisorUtils.java
##########
@@ -92,8 +92,13 @@ public static String getNumaIdForPort(Integer port, 
Map<String, Object> supervis
     }
 
     public static List<Integer> getSlotsPorts(Map<String, Object> 
supervisorConf) {
-        List<Integer> slotsPorts = (List<Integer>) 
supervisorConf.getOrDefault(DaemonConfig.SUPERVISOR_SLOTS_PORTS,
+        List<Integer> slotsPorts = new ArrayList<>();
+        List<Number> ports = (List<Number>) 
supervisorConf.getOrDefault(DaemonConfig.SUPERVISOR_SLOTS_PORTS,
                 new ArrayList<>());
+        for (Number port : ports) {
+            slotsPorts.add(port.intValue());

Review comment:
       This would may involve rounding or truncation which isn't really what we 
wanted.  
   
   A port by definition is no larger than 65535. So logically it will be 
Integers.
   
   There is an Integer check here 
https://github.com/apache/storm/blob/6e3707242e0e6835085d358bec0abee4f62b1426/storm-server/src/main/java/org/apache/storm/DaemonConfig.java#L742-L743.
 Not sure why it was not properly enforced. 
   
   




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


Reply via email to