arunpandianp commented on code in PR #39316:
URL: https://github.com/apache/beam/pull/39316#discussion_r3589753906


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/streaming/KeyCommitTooLargeException.java:
##########
@@ -18,16 +18,29 @@
 package org.apache.beam.runners.dataflow.worker.streaming;
 
 import org.apache.beam.runners.dataflow.worker.windmill.Windmill;
+import org.apache.beam.vendor.grpc.v1p69p0.com.google.protobuf.TextFormat;
 
 public final class KeyCommitTooLargeException extends Exception {
 
   public static KeyCommitTooLargeException causedBy(
-      String computationId, long byteLimit, Windmill.WorkItemCommitRequest 
request) {
+      String stageName, long byteLimit, Windmill.WorkItemCommitRequest 
request) {
+    return causedBy(stageName, byteLimit, request, false);
+  }
+
+  public static KeyCommitTooLargeException causedBy(
+      String stageName,
+      long byteLimit,
+      Windmill.WorkItemCommitRequest request,
+      boolean hotKeyLoggingEnabled) {
     StringBuilder message = new StringBuilder();
     message.append("Commit request for stage ");
-    message.append(computationId);
+    message.append(stageName);
     message.append(" and sharding key ");
-    message.append(request.getShardingKey());
+    message.append(Long.toUnsignedString(request.getShardingKey()));
+    if (hotKeyLoggingEnabled && !request.getKey().isEmpty()) {
+      message.append(" and key ");
+      message.append(TextFormat.escapeBytes(request.getKey()));

Review Comment:
   can we log the decoded key? 
   
   see calls to `hotKeyLogger.logHotKeyDetection(stepName, hotKeyAge, 
decodedKey)`



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