@@ -884,15 +884,18 @@ abstract class RDD[T: ClassTag](
884884 * A version of {@link #aggregate()} that passes the TaskContext to the function that does
885885 * aggregation for each partition.
886886 */
887- def aggregateWithContext [U : ClassTag ](zeroValue : U )(seqOp : ((TaskContext , U ), T ) => U , combOp : (U , U ) => U ): U = {
887+ def aggregateWithContext [U : ClassTag ](zeroValue : U )(seqOp : ((TaskContext , U ), T ) => U ,
888+ combOp : (U , U ) => U ): U = {
888889 // Clone the zero value since we will also be serializing it as part of tasks
889890 var jobResult = Utils .clone(zeroValue, sc.env.closureSerializer.newInstance())
890- // pad seqOp and combOp with taskContext to conform to aggregate's signature in TraversableOnce
891+ // pad seqOp and combOp with taskContext to conform to aggregate's signature in TraversableOnce
891892 val paddedSeqOp = (arg1 : (TaskContext , U ), item : T ) => (arg1._1, seqOp(arg1, item))
892- val paddedcombOp = (arg1 : (TaskContext , U ), arg2 : (TaskContext , U )) => (arg1._1, combOp(arg1._2, arg1._2))
893+ val paddedcombOp = (arg1 : (TaskContext , U ), arg2 : (TaskContext , U )) =>
894+ (arg1._1, combOp(arg1._2, arg1._2))
893895 val cleanSeqOp = sc.clean(paddedSeqOp)
894896 val cleanCombOp = sc.clean(paddedcombOp)
895- val aggregatePartition = (tc : TaskContext , it : Iterator [T ]) => (it.aggregate(tc, zeroValue)(cleanSeqOp, cleanCombOp))._2
897+ val aggregatePartition = (tc : TaskContext , it : Iterator [T ]) =>
898+ (it.aggregate(tc, zeroValue)(cleanSeqOp, cleanCombOp))._2
896899 val mergeResult = (index : Int , taskResult : U ) => jobResult = combOp(jobResult, taskResult)
897900 sc.runJob(this , aggregatePartition, mergeResult)
898901 jobResult
0 commit comments