voonhous commented on code in PR #13147:
URL: https://github.com/apache/hudi/pull/13147#discussion_r3401682731


##########
hudi-timeline-service/src/main/java/org/apache/hudi/timeline/service/RequestHandler.java:
##########
@@ -240,6 +252,30 @@ private void registerTimelineAPI() {
       TimelineDTO dto = instantHandler.getTimeline(getBasePathParam(ctx));
       writeValueAsString(ctx, dto);
     }, false));
+
+    app.get(RemoteHoodieTableFileSystemView.TIMELINE_V2_URL, new 
ViewHandler(ctx -> {
+      metricsRegistry.add("TIMELINE_V2", 1);
+      org.apache.hudi.common.table.timeline.dto.v2.TimelineDTO dto = 
instantHandler.getTimelineV2(getBasePathParam(ctx));
+      writeValueAsString(ctx, dto);
+    }, false));
+
+    app.get(RemoteHoodieTableFileSystemView.INSTANT_DETAILS_URL, new 
ViewHandler(ctx -> {
+      metricsRegistry.add("INSTANT_DETAILS", 1);
+      Object instantDetailsObj = 
instantHandler.getInstantDetails(getBasePathParam(ctx),
+          getInstantParam(ctx), getInstantActionParam(ctx), 
getInstantStateParam(ctx));
+      writeValueAsString(ctx, instantDetailsObj);
+    }, false));
+
+    app.get("/v2/hoodie/view/table/config", new ViewHandler(ctx -> {
+      metricsRegistry.add("TABLE_CONFIG", 1);
+      writeValueAsString(ctx, 
instantHandler.getTableConfig(getBasePathParam(ctx)));
+    }, false));
+
+    app.get("/v2/hoodie/view/table/schema/history", new ViewHandler(ctx -> {
+      metricsRegistry.add("SCHEMA_HISTORY", 1);
+      int limit = Integer.parseInt(ctx.queryParamAsClass("limit", 
String.class).getOrDefault("200"));
+      writeValueAsString(ctx, 
instantHandler.getSchemaHistory(getBasePathParam(ctx), limit));

Review Comment:
   Agreed. The `limit` param is now parsed safely and bounded: a non-numeric 
value returns a 400 (`BadRequestResponse`) instead of a raw 
`NumberFormatException`/500, and values outside 1..1000 are rejected with a 
400. Still defaults to 200 when omitted.
   



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

Reply via email to