saurabhd336 commented on code in PR #10359: URL: https://github.com/apache/pinot/pull/10359#discussion_r1133524764
########## pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTableRestletResource.java: ########## @@ -864,10 +902,28 @@ public Map<String, Map<String, String>> getControllerJobs( Set<String> jobTypesToFilter = null; if (StringUtils.isNotEmpty(jobTypesString)) { jobTypesToFilter = new HashSet<>(java.util.Arrays.asList(StringUtils.split(jobTypesString, ','))); + } + // Validate inputs + Set<String> validJobTypes = + java.util.Arrays.stream(ControllerJobType.values()).map(ControllerJobType::name) + .collect(Collectors.toSet()); + if (jobTypesToFilter != null) { + for (String jobTypeFilterInput : jobTypesToFilter) { + if (!validJobTypes.contains(jobTypeFilterInput)) { + throw new IllegalArgumentException("Valid jobTypes are: " + validJobTypes); + } + } + if (jobTypesToFilter.contains(ControllerJobType.RELOAD_ALL_SEGMENTS.name())) { + // We want to get rid of RELOAD_ALL_SEGMENTS given both the reload types map to + // the same jobType RELOAD_SEGMENT . This is to be backwards compatible until we've removed + // all uses (eg: UI) of RELOAD_ALL_SEGMENTS Review Comment: I think that should only be this, https://github.com/apache/pinot/blob/master/pinot-controller/src/main/resources/app/pages/TenantDetails.tsx#L387 -- 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. To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org