-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-22322][CORE] Update FutureAction for compatibility with Scala 2.12 Future #19561
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
…mpatbility, while retaining 2.11 comptability
| */ | ||
| private[spark] object FutureAction { | ||
|
|
||
| private val transformTryMethod = |
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.
Having to access this by reflection is a little annoying but keeping 2.11 + 2.12 compatibility in one source file is nice, and doesn't entail much of any runtime overhead
| <id>scala-2.12</id> | ||
| <properties> | ||
| <scala.version>2.12.3</scala.version> | ||
| <scala.version>2.12.4</scala.version> |
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.
This update picks up a fix for another scalac bug that also prevents the 2.12 build from working, but, has no effect on 2.11
| } | ||
| } | ||
| AwaitTerminationTester.test(expectedBehavior, awaitTermFunc) | ||
| AwaitTerminationTester.test(expectedBehavior, () => awaitTermFunc()) |
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.
The rest here are just 2.12 warning cleanups by the by
| // and then filled in with a real implementation in the two subclasses below. The no-op exists | ||
| // here so that those implementations can declare "override", necessary in 2.12, while working | ||
| // in 2.11, where the method doesn't exist in the superclass. | ||
| // After 2.11 support goes away, remove these two: |
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 case it wasn't clear, this change ought to have no effect at all in 2.11
|
Test build #82991 has finished for PR 19561 at commit
|
|
Merged to master |
…2.12 Future ## What changes were proposed in this pull request? Scala 2.12's `Future` defines two new methods to implement, `transform` and `transformWith`. These can be implemented naturally in Spark's `FutureAction` extension and subclasses, but, only in terms of the new methods that don't exist in Scala 2.11. To support both at the same time, reflection is used to implement these. ## How was this patch tested? Existing tests. Author: Sean Owen <sowen@cloudera.com> Closes apache#19561 from srowen/SPARK-22322.
What changes were proposed in this pull request?
Scala 2.12's
Futuredefines two new methods to implement,transformandtransformWith. These can be implemented naturally in Spark'sFutureActionextension and subclasses, but, only in terms of the new methods that don't exist in Scala 2.11. To support both at the same time, reflection is used to implement these.How was this patch tested?
Existing tests.