Skip to content

Commit

Permalink
Adds references to KeyCommitTooLargeException docs whever we throw th…
Browse files Browse the repository at this point in the history
…e exception and also mentions --experiments=throw_exceptions_on_large_output as an option.
  • Loading branch information
acrites committed Dec 13, 2024
1 parent fca0bea commit c23c60d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
/** Indicates that an output element was too large. */
public class OutputTooLargeException extends RuntimeException {
public OutputTooLargeException(String reason) {
super(reason);
super(
reason
+ " See https://cloud.google.com/dataflow/docs/guides/common-errors#key-commit-too-large-exception.");
}

/** Returns whether an exception was caused by a {@link OutputTooLargeException}. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ public long add(WindowedValue<T> data) throws IOException {
"Trying to output too large key with size "
+ key.size()
+ ". Limit is "
+ context.getMaxOutputKeyBytes());
+ context.getMaxOutputKeyBytes()
+ ". See https://cloud.google.com/dataflow/docs/guides/common-errors#key-commit-too-large-exception."
+ " Running with --experiments=throw_exceptions_on_large_output will instead throw an OutputTooLargeException which may be caught in user code.");
}
}
if (value.size() > context.getMaxOutputValueBytes()) {
Expand All @@ -194,7 +196,9 @@ public long add(WindowedValue<T> data) throws IOException {
"Trying to output too large value with size "
+ value.size()
+ ". Limit is "
+ context.getMaxOutputValueBytes());
+ context.getMaxOutputValueBytes()
+ ". See https://cloud.google.com/dataflow/docs/guides/common-errors#key-commit-too-large-exception."
+ " Running with --experiments=throw_exceptions_on_large_output will instead throw an OutputTooLargeException which may be caught in user code.");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public static KeyCommitTooLargeException causedBy(
message.append(
". This may be caused by grouping a very "
+ "large amount of data in a single window without using Combine,"
+ " or by producing a large amount of data from a single input element.");
+ " or by producing a large amount of data from a single input element."
+ " See https://cloud.google.com/dataflow/docs/guides/common-errors#key-commit-too-large-exception.");
return new KeyCommitTooLargeException(message.toString());
}

Expand Down

0 comments on commit c23c60d

Please sign in to comment.