@@ -26,11 +26,12 @@ import com.google.common.base.Optional
26
26
import org .apache .hadoop .conf .Configuration
27
27
import org .apache .hadoop .io .compress .CompressionCodec
28
28
import org .apache .hadoop .mapred .{JobConf , OutputFormat }
29
- import org .apache .hadoop .mapreduce .{OutputFormat => NewOutputFormat , Job }
29
+ import org .apache .hadoop .mapreduce .{OutputFormat => NewOutputFormat }
30
30
31
31
import org .apache .spark .{HashPartitioner , Partitioner }
32
32
import org .apache .spark .Partitioner ._
33
33
import org .apache .spark .SparkContext .rddToPairRDDFunctions
34
+ import org .apache .spark .annotations .Experimental
34
35
import org .apache .spark .api .java .JavaSparkContext .fakeClassTag
35
36
import org .apache .spark .api .java .function .{Function => JFunction , Function2 => JFunction2 , PairFunction }
36
37
import org .apache .spark .partial .{BoundedDouble , PartialResult }
@@ -200,16 +201,20 @@ class JavaPairRDD[K, V](val rdd: RDD[(K, V)])
200
201
def countByKey (): java.util.Map [K , Long ] = mapAsJavaMap(rdd.countByKey())
201
202
202
203
/**
203
- * (Experimental) Approximate version of countByKey that can return a partial result if it does
204
+ * :: Experimental ::
205
+ * Approximate version of countByKey that can return a partial result if it does
204
206
* not finish within a timeout.
205
207
*/
208
+ @ Experimental
206
209
def countByKeyApprox (timeout : Long ): PartialResult [java.util.Map [K , BoundedDouble ]] =
207
210
rdd.countByKeyApprox(timeout).map(mapAsJavaMap)
208
211
209
212
/**
210
- * (Experimental) Approximate version of countByKey that can return a partial result if it does
213
+ * :: Experimental ::
214
+ * Approximate version of countByKey that can return a partial result if it does
211
215
* not finish within a timeout.
212
216
*/
217
+ @ Experimental
213
218
def countByKeyApprox (timeout : Long , confidence : Double = 0.95 )
214
219
: PartialResult [java.util.Map [K , BoundedDouble ]] =
215
220
rdd.countByKeyApprox(timeout, confidence).map(mapAsJavaMap)
0 commit comments