You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "pengding-stripe (via GitHub)" <gi...@apache.org> on 2024/08/02 16:55:06 UTC

Re: [PR] broker & server api for realtime table freshness [pinot]

pengding-stripe commented on code in PR #13249:
URL: https://github.com/apache/pinot/pull/13249#discussion_r1702100279


##########
pinot-broker/src/main/java/org/apache/pinot/broker/api/resources/PinotBrokerDebug.java:
##########
@@ -113,6 +115,55 @@ public TimeBoundaryInfo getTimeBoundary(
     }
   }
 
+  @GET
+  @Produces(MediaType.APPLICATION_JSON)
+  @Path("/debug/tableFreshness/{tableName}")
+  @Authorize(targetType = TargetType.TABLE, paramName = "tableName", action = Actions.Table.GET_TABLE_FRESHNESS)
+  @ApiOperation(value = "Get the minimum ingestion timestamp among consuming segments for a hybrid/realtime table.")
+  @ApiResponses(value = {
+      @ApiResponse(code = 200, message = "The minimum ingestion timestamp among consuming segments"),
+      @ApiResponse(code = 404, message = "Freshness not found"),
+      @ApiResponse(code = 500, message = "Internal server error")
+  })
+  public Map<String, Long> getTableFreshness(
+      @ApiParam(value = "Name of the table", example = "myTable | myTable_REALTIME",
+          required = true) @PathParam("tableName") String tableName,
+      @ApiParam(value = "Timeout in milliseconds") @QueryParam("timeoutMs") @DefaultValue("10000") long timeoutMs) {
+    String realtimeTableName = TableNameBuilder.REALTIME.tableNameWithType(tableName);

Review Comment:
   If you call this API with an offline table, this line will just append _REALTIME to the table name. e.g. XXX_OFFLINE -> XXX_REALTIME
   Then it will pass the offline check on line 134
   I think we should check if it's an offline table first



-- 
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-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org