Github user kanzhang commented on the pull request:
https://github.com/apache/spark/pull/1082#issuecomment-46072447
This patch may require some careful review as it is adding new public APIs.
The rationale is the following.
Users asked for scala API ```sc.getPersistentRDDs()``` to be added to
Python. However, the scala method returns a map from RDD id to RDD itself.
Without knowing python serializer used, it is hard going from underlying Java
RDD back to Python RDD. For Java API, it is possible to return the right Java
RDD type by figuring out the element type, but still require some work.
Instead, I choose to return the set of RDD ids, which could be used to
unpersist them if so desired. That leads to ```sc.unpersistRDD```, which is
private[spark] in Scala and I now expose it as public in Java and Python, since
I need a way to unpersist by only knowing the id. I can imagine it would be
safer to hide the ids and let users call ```RDD.unpersist```. However, RDD ids
are already exposed publicly and we just need to remind users ids are
per-SparkContext.
Let me know if the above makes sense. Thx.
---
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.
---