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: 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

Reply via email to