Ethanlm commented on a change in pull request #3267:
URL: https://github.com/apache/storm/pull/3267#discussion_r425342801
##########
File path:
storm-server/src/main/java/org/apache/storm/daemon/supervisor/SupervisorUtils.java
##########
@@ -72,6 +75,33 @@ public static String getNumaIdForPort(Integer port,
Map<String, Object> supervis
return null;
}
+ /**
+ * gets the set of all configured numa ports for a specific supervisor.
+ * @param supervisorConf supervisorConf
+ * @return set of all numa ports
+ */
+ public static Set<Integer> getNumaPorts(Map<String, Object>
supervisorConf) {
+ Set<Integer> numaPorts = new HashSet<>();
+ Map<String, Object> validatedNumaMap = getNumaMap(supervisorConf);
+ for (Map.Entry<String, Object> numaEntry :
validatedNumaMap.entrySet()) {
+ Map<String, Object> numaMap = (Map<String, Object>)
numaEntry.getValue();
+ List<Integer> portList = (List<Integer>) numaMap.get(NUMA_PORTS);
+ numaPorts.addAll(portList);
+ }
+ return numaPorts;
+ }
+
+ public static List<Integer> getSlotsPorts(Map<String, Object>
supervisorConf) {
+ List<Integer> slotsPorts = (List<Integer>)
supervisorConf.getOrDefault(DaemonConfig.SUPERVISOR_SLOTS_PORTS,
+ new ArrayList<>());
+ // It's possible we have numaPorts specified that weren't configured
in SUPERVISOR_SLOTS_PORTS. Make
+ // sure we handle these ports as well.
+ Set<Integer> numaPorts = SupervisorUtils.getNumaPorts(supervisorConf);
+ numaPorts.removeAll(slotsPorts);
+ slotsPorts.addAll(numaPorts);
+ return slotsPorts;
Review comment:
Should we make them match?
If there are ports in `SUPERVISOR_SLOTS_PORTS` not specified in numa.ports,
will there be any issue?
One issue I can see is it will create ports that will possibly never be used.
----------------------------------------------------------------
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]