saurabhd336 commented on code in PR #9356:
URL: https://github.com/apache/pinot/pull/9356#discussion_r981049829


##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTableRestletResource.java:
##########
@@ -843,6 +849,106 @@ public Map<String, Map<String, String>> getControllerJobs(
     return result;
   }
 
+  @POST
+  @Path("table/{tableName}/enforceQueryTimeBoundary")
+  @ApiOperation(value = "Set hybrid table query time boundary based on offline 
segments' metadata",
+      notes = "Set hybrid table query time boundary based on offline segments' 
metadata")
+  public SuccessResponse setEnforcedQueryTimeBoundary(
+      @ApiParam(value = "Name of the table", required = true) 
@PathParam("tableName") String tableName)
+      throws Exception {
+    // Validate its a hybrid table
+    if (!_pinotHelixResourceManager.hasRealtimeTable(tableName) || 
!_pinotHelixResourceManager.hasOfflineTable(
+        tableName)) {
+      throw new ControllerApplicationException(LOGGER, "Table isn't a hybrid 
table", Response.Status.BAD_REQUEST);
+    }
+
+    String offlineTableName = 
TableNameBuilder.OFFLINE.tableNameWithType(tableName);
+
+    // Call all servers to validate offline table state
+    Map<String, List<String>> serverToSegments = 
_pinotHelixResourceManager.getServerToSegmentsMap(offlineTableName);
+    BiMap<String, String> serverEndPoints =
+        
_pinotHelixResourceManager.getDataInstanceAdminEndpoints(serverToSegments.keySet());
+    CompletionServiceHelper completionServiceHelper =
+        new CompletionServiceHelper(_executor, _connectionManager, 
serverEndPoints);
+    List<String> serverUrls = new ArrayList<>();
+    BiMap<String, String> endpointsToServers = serverEndPoints.inverse();
+    for (String endpoint : endpointsToServers.keySet()) {
+      String reloadTaskStatusEndpoint = endpoint + "/tables/" + 
offlineTableName + "/validate";

Review Comment:
   Could you elaborate this one? You mean not have the validate API return the 
maxTimestamps?



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