@@ -55,7 +55,7 @@ import org.apache.spark.SparkConf
5555Spark {{site.SPARK_VERSION}} works with Java 6 and higher. If you are using Java 8, Spark supports
5656[ lambda expressions] ( http://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html )
5757for concisely writing functions, otherwise you can use the classes in the
58- [ org.apache.spark.api.java.function] ( api/java/org/apache/spark/api/java/function/package-summary.html ) package.
58+ [ org.apache.spark.api.java.function] ( api/java/index.html? org/apache/spark/api/java/function/package-summary.html ) package.
5959
6060To write a Spark application in Java, you need to add a dependency on Spark. Spark is available through Maven Central at:
6161
@@ -126,8 +126,8 @@ new SparkContext(conf)
126126
127127<div data-lang =" java " markdown =" 1 " >
128128
129- The first thing a Spark program must do is to create a [ JavaSparkContext] ( api/java/org/apache/spark/api/java/JavaSparkContext.html ) object, which tells Spark
130- how to access a cluster. To create a ` SparkContext ` you first need to build a [ SparkConf] ( api/java/org/apache/spark/SparkConf.html ) object
129+ The first thing a Spark program must do is to create a [ JavaSparkContext] ( api/java/index.html? org/apache/spark/api/java/JavaSparkContext.html ) object, which tells Spark
130+ how to access a cluster. To create a ` SparkContext ` you first need to build a [ SparkConf] ( api/java/index.html? org/apache/spark/SparkConf.html ) object
131131that contains information about your application.
132132
133133{% highlight java %}
@@ -265,7 +265,7 @@ We describe operations on distributed datasets later on.
265265
266266** Note:** * In this guide, we'll often use the concise Java 8 lambda syntax to specify Java functions, but
267267in older versions of Java you can implement the interfaces in the
268- [ org.apache.spark.api.java.function] ( api/java/org/apache/spark/api/java/function/package-summary.html ) package.
268+ [ org.apache.spark.api.java.function] ( api/java/index.html? org/apache/spark/api/java/function/package-summary.html ) package.
269269We describe [ passing functions to Spark] ( #passing-functions-to-spark ) in more detail below.*
270270
271271</div >
@@ -546,7 +546,7 @@ def doStuff(rdd: RDD[String]): RDD[String] = {
546546
547547Spark's API relies heavily on passing functions in the driver program to run on the cluster.
548548In Java, functions are represented by classes implementing the interfaces in the
549- [ org.apache.spark.api.java.function] ( api/java/org/apache/spark/api/java/function/package-summary.html ) package.
549+ [ org.apache.spark.api.java.function] ( api/java/index.html? org/apache/spark/api/java/function/package-summary.html ) package.
550550There are two ways to create such functions:
551551
552552* Implement the Function interfaces in your own class, either as an anonymous inner class or a named one,
@@ -697,7 +697,7 @@ from the Scala standard library. You can simply call `new Tuple2(a, b)` to creat
697697its fields later with ` tuple._1() ` and ` tuple._2() ` .
698698
699699RDDs of key-value pairs are represented by the
700- [ JavaPairRDD] ( api/java/org/apache/spark/api/java/JavaPairRDD.html ) class. You can construct
700+ [ JavaPairRDD] ( api/java/index.html? org/apache/spark/api/java/JavaPairRDD.html ) class. You can construct
701701JavaPairRDDs from JavaRDDs using special versions of the ` map ` operations, like
702702` mapToPair ` and ` flatMapToPair ` . The JavaPairRDD will have both standard RDD functions and special
703703key-value ones.
@@ -749,11 +749,11 @@ We could also use `counts.sortByKey()`, for example, to sort the pairs alphabeti
749749The following table lists some of the common transformations supported by Spark. Refer to the
750750RDD API doc
751751([ Scala] ( api/scala/index.html#org.apache.spark.rdd.RDD ) ,
752- [ Java] ( api/java/org/apache/spark/api/java/JavaRDD.html ) ,
752+ [ Java] ( api/java/index.html? org/apache/spark/api/java/JavaRDD.html ) ,
753753 [ Python] ( api/python/pyspark.rdd.RDD-class.html ) )
754754and pair RDD functions doc
755755([ Scala] ( api/scala/index.html#org.apache.spark.rdd.PairRDDFunctions ) ,
756- [ Java] ( api/java/org/apache/spark/api/java/JavaPairRDD.html ) )
756+ [ Java] ( api/java/index.html? org/apache/spark/api/java/JavaPairRDD.html ) )
757757for details.
758758
759759<table class =" table " >
@@ -852,11 +852,11 @@ for details.
852852The following table lists some of the common actions supported by Spark. Refer to the
853853RDD API doc
854854([ Scala] ( api/scala/index.html#org.apache.spark.rdd.RDD ) ,
855- [ Java] ( api/java/org/apache/spark/api/java/JavaRDD.html ) ,
855+ [ Java] ( api/java/index.html? org/apache/spark/api/java/JavaRDD.html ) ,
856856 [ Python] ( api/python/pyspark.rdd.RDD-class.html ) )
857857and pair RDD functions doc
858858([ Scala] ( api/scala/index.html#org.apache.spark.rdd.PairRDDFunctions ) ,
859- [ Java] ( api/java/org/apache/spark/api/java/JavaPairRDD.html ) )
859+ [ Java] ( api/java/index.html? org/apache/spark/api/java/JavaPairRDD.html ) )
860860for details.
861861
862862<table class =" table " >
@@ -931,7 +931,7 @@ to persist the dataset on disk, persist it in memory but as serialized Java obje
931931replicate it across nodes, or store it off-heap in [ Tachyon] ( http://tachyon-project.org/ ) .
932932These levels are set by passing a
933933` StorageLevel ` object ([ Scala] ( api/scala/index.html#org.apache.spark.storage.StorageLevel ) ,
934- [ Java] ( api/java/org/apache/spark/storage/StorageLevel.html ) ,
934+ [ Java] ( api/java/index.html? org/apache/spark/storage/StorageLevel.html ) ,
935935[ Python] ( api/python/pyspark.storagelevel.StorageLevel-class.html ) )
936936to ` persist() ` . The ` cache() ` method is a shorthand for using the default storage level,
937937which is ` StorageLevel.MEMORY_ONLY ` (store deserialized objects in memory). The full set of
@@ -1150,7 +1150,7 @@ accum.value();
11501150{% endhighlight %}
11511151
11521152While this code used the built-in support for accumulators of type Integer, programmers can also
1153- create their own types by subclassing [ AccumulatorParam] ( api/java/org/apache/spark/AccumulatorParam.html ) .
1153+ create their own types by subclassing [ AccumulatorParam] ( api/java/index.html? org/apache/spark/AccumulatorParam.html ) .
11541154The AccumulatorParam interface has two methods: ` zero ` for providing a "zero value" for your data
11551155type, and ` addInPlace ` for adding two values together. For example, supposing we had a ` Vector ` class
11561156representing mathematical vectors, we could write:
@@ -1166,10 +1166,10 @@ class VectorAccumulatorParam implements AccumulatorParam<Vector> {
11661166}
11671167
11681168// Then, create an Accumulator of this type:
1169- Accumulator<Vector > vecAccum = sc.accumulator(new Vector(...))( new VectorAccumulatorParam());
1169+ Accumulator<Vector > vecAccum = sc.accumulator(new Vector(...), new VectorAccumulatorParam());
11701170{% endhighlight %}
11711171
1172- In Java, Spark also supports the more general [ Accumulable] ( api/java/org/apache/spark/Accumulable.html )
1172+ In Java, Spark also supports the more general [ Accumulable] ( api/java/index.html? org/apache/spark/Accumulable.html )
11731173interface to accumulate data where the resulting type is not the same as the elements added (e.g. build
11741174a list by collecting together elements).
11751175
@@ -1205,7 +1205,7 @@ class VectorAccumulatorParam(AccumulatorParam):
12051205 return v1
12061206
12071207# Then, create an Accumulator of this type:
1208- vecAccum = sc.accumulator(Vector(...))( VectorAccumulatorParam())
1208+ vecAccum = sc.accumulator(Vector(...), VectorAccumulatorParam())
12091209{% endhighlight %}
12101210
12111211</div >
0 commit comments