Github user Ethanlm commented on a diff in the pull request: https://github.com/apache/storm/pull/2881#discussion_r229876743 --- Diff: storm-client/src/jvm/org/apache/storm/validation/ConfigValidation.java --- @@ -414,6 +418,34 @@ public void validateInteger(String name, Object o) { } } + public static class NumaEntryValidator extends Validator { + + @Override + public void validateField(String name, Object o) { + if (o == null) { + return; + } + Map numa = (Map<String, Object>) o; + for (String key : new String[]{NUMA_CORES, NUMA_MEMORY_IN_MB, NUMA_PORTS}) { + if (!numa.containsKey(key)) { + throw new IllegalArgumentException( + "The numa configuration key [" + key + "] is missing!" + ); + } + } + + List<Integer> cores = (List<Integer>) numa.get(NUMA_CORES); + Set coreSet = new HashSet(); + coreSet.addAll(cores); + if (coreSet.size() != cores.size()) { + throw new IllegalArgumentException( + "No duplicate cores in NUMA config" --- End diff -- Better to be "duplicate cores in NUMA config"?
---