Deprecated and added a few java api methods for corresponding scala api.

PR [402](https://github.com/apache/incubator-spark/pull/402) from incubator repo.