Skip to content

Commit

Permalink
change method's name
Browse files Browse the repository at this point in the history
  • Loading branch information
surongquan committed Dec 11, 2014
1 parent 4e3f715 commit 411b287
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/src/main/scala/org/apache/spark/rdd/RDD.scala
Original file line number Diff line number Diff line change
Expand Up @@ -788,9 +788,9 @@ abstract class RDD[T: ClassTag](
}

/**
* Take all of the elements in this RDD, and print the first num elements of the RDD.
* Process all of the elements in this RDD, and take the first num elements of the RDD.
*/
def printTop (num: Int): Array[T] = {
def processAllAndTake (num: Int): Array[T] = {
val buf = new ArrayBuffer[T]
val results = sc.runJob(this, (iter: Iterator[T]) => iter.toArray)
for (partition <- results; data <- partition if buf.size <= num){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -621,9 +621,9 @@ abstract class DStream[T: ClassTag] (
/**
* Print the first specified number elements of each RDD in this DStream.
*/
def printTop(num: Int) {
def processAllAndPrintFirst(num: Int) {
def foreachFunc = (rdd: RDD[T], time: Time) => {
val first11 = rdd.printTop(num)
val first11 = rdd.processAllAndTake(num)
println ("-------------------------------------------")
println ("Time: " + time)
println ("-------------------------------------------")
Expand Down

0 comments on commit 411b287

Please sign in to comment.