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
[BEAM-4775] mv function pkg from fn-harness to java-core #7866
Conversation
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.
Could you explain why this is necessary? I'm assuming it has to do with the dependency structure.
Yea, sorry it's not clear. I need to think more about metrics/proto package-structures in #7823 that may affect this. Let me do that and circle back. In the meantime, here's some context for the package-move, as it currently stands:
parameterizing ThrowingConsumer
|
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.
Thanks for clarifying. I think moving them to the core makes sense.
public interface ThrowingConsumer<T> { | ||
void accept(T t) throws Exception; | ||
public interface ThrowingConsumer<ExceptionT extends Exception, T> { | ||
void accept(T t) throws ExceptionT; |
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.
What is the use case for this change? It looks like you only pass Exception
as ExceptionT
. Do you want to define contracts for other subclasses of Exception
?
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.
There was a note at the end of this comment about that part.
It's not used here, but I do have a motivating case for a ThrowingConsumer<IOException, T>
in #7823.
I think this can be decoupled from metrics/module concerns, and is good to go, if you agree that java/core is a more logical place for such generic language-level helpers. Even if the metrics code that uses it ends up somewhere higher-up than java/core, having it depend on these helpers in java/core seems reasonable. Pulling things like this back out of java/core to dedicated packages later seems fine and good as well, if necessary. |
Looks good. Thanks! |
also: parameterize ThrowingConsumer by Exception type
This is factored out of #7823, where a use-case for a
ThrowingConsumer<IOException, …>
exists, in Jackson JSON serde code.R: @robertwb, @mxm
Post-Commit Tests Status (on master branch)
See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.