@@ -8,8 +8,8 @@ setOldClass("jobj")
88# ' @rdname RDD
99# ' @seealso parallelize, textFile
1010# '
11- # ' @param env An R environment that stores bookkeeping states of the RDD
12- # ' @param jrdd Java object reference to the backing JavaRDD
11+ # ' @slot env An R environment that stores bookkeeping states of the RDD
12+ # ' @slot jrdd Java object reference to the backing JavaRDD
1313# ' @export
1414setClass ("RDD ",
1515 slots = list (env = " environment" ,
@@ -81,13 +81,16 @@ setMethod("initialize", "PipelinedRDD", function(.Object, prev, func, jrdd_val)
8181
8282# ' @rdname RDD
8383# ' @export
84+ # '
85+ # ' @param jrdd Java object reference to the backing JavaRDD
86+ # ' @param serialized TRUE if the RDD stores data serialized in R
87+ # ' @param isCached TRUE if the RDD is cached
88+ # ' @param isCheckpointed TRUE if the RDD has been checkpointed
8489RDD <- function (jrdd , serialized = TRUE , isCached = FALSE ,
8590 isCheckpointed = FALSE ) {
8691 new(" RDD" , jrdd , serialized , isCached , isCheckpointed )
8792}
8893
89- # ' @rdname PipelinedRDD
90- # ' @export
9194PipelinedRDD <- function (prev , func ) {
9295 new(" PipelinedRDD" , prev , func , NULL )
9396}
@@ -414,7 +417,7 @@ setMethod("lookup",
414417
415418# ' Return the number of elements in the RDD.
416419# '
417- # ' @param rdd The RDD to count
420+ # ' @param x The RDD to count
418421# ' @return number of elements in the RDD.
419422# ' @rdname count
420423# ' @export
@@ -425,17 +428,17 @@ setMethod("lookup",
425428# ' count(rdd) # 10
426429# ' length(rdd) # Same as count
427430# '}
428- setGeneric ("count ", function(rdd ) { standardGeneric("count") })
431+ setGeneric ("count ", function(x ) { standardGeneric("count") })
429432
430433# ' @rdname count
431434# ' @aliases count,RDD-method
432435setMethod ("count ",
433- signature(rdd = " RDD" ),
434- function (rdd ) {
436+ signature(x = " RDD" ),
437+ function (x ) {
435438 countPartition <- function (part ) {
436439 as.integer(length(part ))
437440 }
438- valsRDD <- lapplyPartition(rdd , countPartition )
441+ valsRDD <- lapplyPartition(x , countPartition )
439442 vals <- collect(valsRDD )
440443 sum(as.integer(vals ))
441444 })
@@ -511,6 +514,7 @@ setMethod("countByKey",
511514# ' @param FUN the transformation to apply on each element
512515# ' @return a new RDD created by the transformation.
513516# ' @rdname lapply
517+ # ' @aliases lapply
514518# ' @export
515519# ' @examples
516520# '\dontrun{
@@ -666,8 +670,8 @@ setMethod("mapPartitionsWithIndex",
666670# ' a predicate (i.e. returning TRUE in a given logical function).
667671# ' The same as `filter()' in Spark.
668672# '
669- # ' @param rdd The RDD to be filtered.
670- # ' @param filterFunc A unary predicate function.
673+ # ' @param x The RDD to be filtered.
674+ # ' @param f A unary predicate function.
671675# ' @rdname filterRDD
672676# ' @export
673677# ' @examples
@@ -677,21 +681,22 @@ setMethod("mapPartitionsWithIndex",
677681# ' unlist(collect(filterRDD(rdd, function (x) { x < 3 }))) # c(1, 2)
678682# '}
679683setGeneric ("filterRDD ",
680- function (rdd , filterFunc ) { standardGeneric(" filterRDD" ) })
684+ function (x , f ) { standardGeneric(" filterRDD" ) })
681685
682686# ' @rdname filterRDD
683687# ' @aliases filterRDD,RDD,function-method
684688setMethod ("filterRDD ",
685- signature(rdd = " RDD" , filterFunc = " function" ),
686- function (rdd , filterFunc ) {
689+ signature(x = " RDD" , f = " function" ),
690+ function (x , f ) {
687691 filter.func <- function (part ) {
688- Filter(filterFunc , part )
692+ Filter(f , part )
689693 }
690- lapplyPartition(rdd , filter.func )
694+ lapplyPartition(x , filter.func )
691695 })
692696
693697# ' @rdname filterRDD
694- # ' @aliases Filter,function,RDD-method
698+ # ' @export
699+ # ' @aliases Filter
695700setMethod ("Filter ",
696701 signature(f = " function" , x = " RDD" ),
697702 function (f , x ) {
@@ -802,9 +807,6 @@ setMethod("foreach",
802807
803808# ' Applies a function to each partition in an RDD, and force evaluation.
804809# '
805- # ' @param rdd The RDD to apply the function
806- # ' @param func The function to be applied to partitions.
807- # ' @return invisible NULL.
808810# ' @export
809811# ' @rdname foreach
810812# ' @examples
@@ -1652,7 +1654,8 @@ setMethod("join",
16521654# ' sc <- sparkR.init()
16531655# ' rdd1 <- parallelize(sc, list(list(1, 1), list(2, 4)))
16541656# ' rdd2 <- parallelize(sc, list(list(1, 2), list(1, 3)))
1655- # ' leftOuterJoin(rdd1, rdd2, 2L) # list(list(1, list(1, 2)), list(1, list(1, 3)), list(2, list(4, NULL)))
1657+ # ' leftOuterJoin(rdd1, rdd2, 2L)
1658+ # ' # list(list(1, list(1, 2)), list(1, list(1, 3)), list(2, list(4, NULL)))
16561659# '}
16571660setGeneric ("leftOuterJoin ", function(rdd1, rdd2, numPartitions) { standardGeneric("leftOuterJoin") })
16581661
@@ -1721,7 +1724,8 @@ setMethod("leftOuterJoin",
17211724# ' sc <- sparkR.init()
17221725# ' rdd1 <- parallelize(sc, list(list(1, 2), list(1, 3)))
17231726# ' rdd2 <- parallelize(sc, list(list(1, 1), list(2, 4)))
1724- # ' rightOuterJoin(rdd1, rdd2, 2L) # list(list(1, list(2, 1)), list(1, list(3, 1)), list(2, list(NULL, 4)))
1727+ # ' rightOuterJoin(rdd1, rdd2, 2L)
1728+ # ' # list(list(1, list(2, 1)), list(1, list(3, 1)), list(2, list(NULL, 4)))
17251729# '}
17261730setGeneric ("rightOuterJoin ", function(rdd1, rdd2, numPartitions) { standardGeneric("rightOuterJoin") })
17271731
0 commit comments