Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/10978#discussion_r52116967
--- Diff:
core/src/main/scala/org/apache/spark/api/java/JavaSparkContext.scala ---
@@ -774,6 +774,17 @@ class JavaSparkContext(val sc: SparkContext)
/** Cancel all jobs that have been scheduled or are running. */
def cancelAllJobs(): Unit = sc.cancelAllJobs()
+
+
+ /**
+ * Returns an Java map of JavaRDDs that have marked themselves as
persistent via cache() call.
+ * Note that this does not necessarily mean the caching or computation
was successful.
+ */
+ def getPersistentRDDs : JMap[java.lang.Integer, JavaRDD[_]] = {
--- End diff --
The change seems OK, but I'm not sure the casting actually works. In
particular the keys aren't actually `Integer`s. I would have though you needed
this ...
```
def getPersistentRDDs : JMap[java.lang.Integer, JavaRDD[_]] = {
sc.getPersistentRDDs.map { case (id, rdd) =>
(java.lang.Integer.valueOf(id),
JavaRDD.fromRDD(rdd).asInstanceOf[JavaRDD[_]])
}.asJava
}
```
In any event, add in a simple unit test? it will confirm it compiles and
returns what's expected.
Nit: your javadoc lines are indented one space too far on the second and
subsequent lines
---
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]