jaykay12 commented on code in PR #4452:
URL: https://github.com/apache/solr/pull/4452#discussion_r3270126942


##########
solr/core/src/java/org/apache/solr/handler/admin/api/ListActiveTasks.java:
##########
@@ -0,0 +1,82 @@
+package org.apache.solr.handler.admin.api;
+
+import jakarta.inject.Inject;
+import org.apache.solr.api.JerseyResource;
+import org.apache.solr.client.api.endpoint.ListActiveTasksApi;
+import org.apache.solr.client.api.model.ListActiveTaskResponse;
+import org.apache.solr.core.CoreContainer;
+import org.apache.solr.jersey.PermissionName;
+import org.apache.solr.request.SolrQueryRequest;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.lang.invoke.MethodHandles;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import static org.apache.solr.security.PermissionNameProvider.Name.READ_PERM;
+
+public class ListActiveTasks extends JerseyResource implements 
ListActiveTasksApi {
+
+  private static final Logger log = 
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+  private final SolrQueryRequest solrQueryRequest;
+
+  @Inject
+  public ListActiveTasks(
+      SolrQueryRequest solrQueryRequest) {
+    this.solrQueryRequest = solrQueryRequest;
+  }
+
+
+
+  @Override
+  @PermissionName(READ_PERM)
+  public ListActiveTaskResponse listActiveTasks(String taskUUID) throws 
Exception {
+
+    final ListActiveTaskResponse response = 
instantiateJerseyResponse(ListActiveTaskResponse.class);
+    CoreContainer coreContainer = solrQueryRequest.getCoreContainer();
+
+    if (coreContainer.isZooKeeperAware()) {
+      if (log.isDebugEnabled()) {
+        log.debug("solr cloud");
+      }
+      handleSolrCloudMode(response, taskUUID);
+    } else {

Review Comment:
   yea, i am also checking this up. 
   I have tested this endpoint by running on cloud example which we have in 
examples, it worked fine. It should work fine for standalone as well, will 
remove the current conditional branching done once that's verified.



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

Reply via email to