-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[BEAM-3601] Switch to Java 8 futures #4595
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
f4a34cc to
6951fb4
Compare
|
So many mocks ;_; |
28fe929 to
ebe0836
Compare
|
Requested reviews from just a couple folks in the right arenas rather than targeting the authors of every touched piece of code. |
jkff
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.
Thanks, LGTM except for the easily fixed findbugs error.
| ListenableFuture<DataflowPackage> stagedPackage = | ||
| Futures.transform( | ||
| stagingResult, | ||
| CompletionStage<StagingResult> stagingResult = |
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.
Remove the TODO above?
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.
Done
| */ | ||
| public class MoreFutures { | ||
|
|
||
| /** Like {@link Runnable} but allowed to throw any 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.
Clarify: are these interfaces intended to be used only in futures-related code? (if they are intended to be used more widely, they should be outside MoreFutures; if not, ideally that should be documented, cause it's tempting)
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.
In fact, these exist within the SDK harness, among other places, already, and I don't believe all of those uses interact directly with futures; I'd rather just have them in util, or function, (or any other meaningful name)
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.
Done
tgroh
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.
Same-same comment
| */ | ||
| public class MoreFutures { | ||
|
|
||
| /** Like {@link Runnable} but allowed to throw any 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.
In fact, these exist within the SDK harness, among other places, already, and I don't believe all of those uses interact directly with futures; I'd rather just have them in util, or function, (or any other meaningful name)
b6a0b80 to
f890179
Compare
|
run java gradle precommit |
This ports the Beam codebase from Guava futures to Java 8 futures. This has been discussed at length on the Beam dev list.
The standards that I have held:
CompletionStage. They can do async chaining and can useMoreFutures.get(...)to get the result without passing through types they shouldn't be touching.CompletableFutureand return it as aCompletionStage.MoreFutureshelpers that will complete things exceptionally based on the underlying function throwing.Follow this checklist to help us incorporate your contribution quickly and easily:
[BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replaceBEAM-XXXwith the appropriate JIRA issue.mvn clean verifyto make sure basic checks pass. A more thorough check will be performed on your pull request automatically.