the-other-tim-brown commented on code in PR #13399:
URL: https://github.com/apache/hudi/pull/13399#discussion_r2132129792


##########
hudi-common/src/main/java/org/apache/hudi/timeline/TimelineServiceClient.java:
##########
@@ -61,7 +61,7 @@ protected Response executeRequest(Request request) throws 
IOException {
     String url = builder.toString();
     LOG.debug("Sending request : ({})", url);
     org.apache.http.client.fluent.Response response = get(request.getMethod(), 
url, timeoutMs);
-    return new Response(response.returnContent().asString());
+    return new Response(response.returnContent().asStream());

Review Comment:
   The jackson docs mention avoiding intermediate string representation is just 
unnecessary translation of the data so switching to input stream for 
performance.



##########
hudi-common/src/main/java/org/apache/hudi/common/util/MarkerUtils.java:
##########
@@ -103,6 +103,15 @@ public static boolean 
doesMarkerTypeFileExist(HoodieStorage storage, String mark
     return storage.exists(new StoragePath(markerDir, MARKER_TYPE_FILENAME));
   }
 
+  /**
+   * @param storage   {@link HoodieStorage} to use.
+   * @param markerDir marker directory.
+   * @return {@code true} if the MARKERS.type file exists; {@code false} 
otherwise.
+   */
+  public static boolean doesMarkerTypeFileExist(HoodieStorage storage, 
StoragePath markerDir) throws IOException {

Review Comment:
   Adds an overloaded method that takes in a `StoragePath` instead of a string.



##########
hudi-timeline-service/src/main/java/org/apache/hudi/timeline/service/handlers/MarkerHandler.java:
##########
@@ -274,7 +269,7 @@ private CompletableFuture<String> 
finishCreateMarkerFuture(Context context, Stri
     MarkerCreationFuture future = new MarkerCreationFuture(context, markerDir, 
markerName);
     try {
       future.complete(jsonifyResult(
-          future.getContext(), future.isSuccessful(), metricsRegistry, new 
ObjectMapper(), LOG));

Review Comment:
   This was creating a new `ObjectMapper` per invocation which is very bad for 
performance. The object is meant to be reused across threads



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