swaminathanmanish commented on code in PR #10359:
URL: https://github.com/apache/pinot/pull/10359#discussion_r1134563866
##########
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:
Thanks. Updated the PR.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]