This is an automated email from the ASF dual-hosted git repository.

somandal pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 39cdeecf215 Add a new API GET /tenants/{tenantName}/rebalanceJobs 
(#16376)
39cdeecf215 is described below

commit 39cdeecf215da6be413633a1cec0889f4ff8d4d2
Author: Jhow <[email protected]>
AuthorDate: Thu Jul 17 17:08:47 2025 -0700

    Add a new API GET /tenants/{tenantName}/rebalanceJobs (#16376)
---
 .../api/resources/PinotTenantRestletResource.java         | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git 
a/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTenantRestletResource.java
 
b/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTenantRestletResource.java
index 94a1b125c1b..ba36ff74ddd 100644
--- 
a/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTenantRestletResource.java
+++ 
b/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTenantRestletResource.java
@@ -32,6 +32,7 @@ import io.swagger.annotations.SecurityDefinition;
 import io.swagger.annotations.SwaggerDefinition;
 import java.io.IOException;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
@@ -82,6 +83,7 @@ import org.apache.pinot.spi.config.table.TableType;
 import org.apache.pinot.spi.config.table.assignment.InstancePartitionsType;
 import org.apache.pinot.spi.config.tenant.Tenant;
 import org.apache.pinot.spi.config.tenant.TenantRole;
+import org.apache.pinot.spi.utils.CommonConstants;
 import org.apache.pinot.spi.utils.JsonUtils;
 import org.apache.pinot.spi.utils.StringUtil;
 import org.slf4j.Logger;
@@ -800,4 +802,17 @@ public class PinotTenantRestletResource {
     
tenantRebalanceJobStatusResponse.setTimeElapsedSinceStartInSeconds(timeSinceStartInSecs);
     return tenantRebalanceJobStatusResponse;
   }
+
+  @GET
+  @Path("/tenants/{tenantName}/rebalanceJobs")
+  @Authorize(targetType = TargetType.CLUSTER, action = 
Actions.Cluster.GET_REBALANCE_STATUS)
+  @Produces(MediaType.APPLICATION_JSON)
+  @ApiOperation(value = "Get list of rebalance jobs for this tenant",
+      notes = "Get list of rebalance jobs for this tenant")
+  public Map<String, Map<String, String>> getControllerJobs(
+      @ApiParam(value = "Name of the tenant", required = true) 
@PathParam("tenantName") String tenantName) {
+    return 
_pinotHelixResourceManager.getAllJobs(Collections.singleton(ControllerJobTypes.TENANT_REBALANCE),
+        jobMetadata -> 
jobMetadata.get(CommonConstants.ControllerJob.TENANT_NAME)
+            .equals(tenantName));
+  }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to