Merge remote-tracking branch 'upstream/master'

Rebasing fork from source.
Changed partitions() to getNumPartitions()

Change the definition of this method per Patrick’s comments
[here](https://github.com/apache/spark/pull/218).