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