-
Notifications
You must be signed in to change notification settings - Fork 86
[PLUGIN-1807] Implement Program Failure Exception Handling in GCS sink plugins to catch known errors #1445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
c98a86b to
f1294a6
Compare
f1294a6 to
a755552
Compare
src/main/java/io/cdap/plugin/gcp/gcs/sink/ForwardingOutputCommitter.java
Outdated
Show resolved
Hide resolved
10c9cf1 to
123832f
Compare
123832f to
6015db5
Compare
tivv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with minor comments
| * @param <T> the return type of the function | ||
| */ | ||
| @FunctionalInterface | ||
| public interface IOFunction<T> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Consider using Callable / Runnable instead of Function / Operation. This terms are more used in Java
| } | ||
|
|
||
| // Helper method for handling both IOException and InterruptedException | ||
| public static void invokeWithProgramFailureAndInterruptionHandling( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may be able to go with less boilerplate by using generic exceptions: https://www.mscharhag.com/java/java-exceptions-and-generic-types
|
Closing the PR based on offline discussion with @albertshau & @tivv. New approach will be addressed in #1452. |
Program Failure Exception Class: reference
Tested in CDAP Sandbox:
GCS Batch SInk:
GCS Multi Sink: