This page documents the design and internals of Spark's Java API and is intended for those developing Spark itself; if you are a user and want to learn to use Spark from Java, please see the Java programming guide.

This page is a draft; I'm still completing it. - Josh Rosen

Why a Java API?

Scala and Java are fairly interoperable, but there are several subtleties that make it difficult to directly call Spark's Scala APIs from Java:

These difficulties made for an unpleasant user experience. To address this, the Spark 0.7 release introduced a Java API that hides these Scala <-> Java interoperability concerns.

Implementation

Function Classes

Workarounds for compiler bugs

TODO: describe the Java/Scala compiler bugs that were reported while developing the Java API, and the workarounds for them.

Keeping the Java API up-to-date

TODO: Describe JavaAPICompletenessChecker