Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/2760#discussion_r18853766
--- Diff: core/src/main/scala/org/apache/spark/FutureAction.scala ---
@@ -271,3 +274,55 @@ class ComplexFutureAction[T] extends FutureAction[T] {
def jobIds = jobs
}
+
+private[spark]
+class JavaFutureActionWrapper[S, T](futureAction: FutureAction[S],
converter: S => T)
+ extends JavaFutureAction[T] {
+
+ import scala.collection.JavaConverters._
+
+ override def isCancelled: Boolean = futureAction.isCancelled
+
+ override def isDone: Boolean = {
+ // According to java.util.Future's Javadoc, this returns True if the
task was completed,
+ // whether that completion was due to succesful execution, an
exception, or a cancellation.
+ futureAction.isCancelled || futureAction.isCompleted
+ }
+
+ override def jobIds(): java.util.List[java.lang.Integer] = {
+ new java.util.ArrayList(futureAction.jobIds.map(x => new
Integer(x)).asJava)
--- End diff --
Hmmm... kinda sucks you have to make the conversion manually.
I'd use `Collections.unmodifiableList()` and `Integer.valueOf()` here,
though.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]