dlwh / smr fork watch download tarball
public
Description: Scala Map Reduce
Homepage: http://www.stanford.edu/~dlwh/index.html
Clone URL: git://github.com/dlwh/smr.git
things work better!
David Leo Wright Hall (author)
Thu Jun 05 16:26:49 -0700 2008
commit  5bf1be1a71c23ff671322f363b1e8e3a537e9f3b
tree    2bf59f13393323df5c58a34083a87b7303b0715f
parent  7aa04fe12985055ad801f907c68c94113adca005
...
57
58
59
60
 
61
62
63
...
57
58
59
 
60
61
62
63
0
@@ -57,7 +57,7 @@ object defaults {
0
     } else {
0
       val sz = x.size / numShards.n;
0
       val arrs = new ArrayBuffer[Iterable[T]]
0
- arrs ++= (for(val i <- 0 until numShards.n ) yield x.drop(sz * i).take(sz));
0
+ arrs ++= (for(val i <- 0 until numShards.n ) yield x.drop(sz * i).take(sz).toList);
0
       arrs.toList
0
     }
0
     case _ =>
...
297
298
299
300
 
301
302
...
297
298
299
 
300
301
302
0
@@ -297,6 +297,6 @@ private[smr] object InternalIterable {
0
 
0
   private def handleReduce[T,B>:T](self : InternalIterable[T], f : (B,B)=>B) = {
0
     val b = handleGather[T,Iterable[T],Option[B]](self,(x : Iterable[B])=> if (x.isEmpty) None else Some(x.reduceLeft(f)))
0
- b.filter(None!=).map( (x : (Int,Option[B])) => x._2.get).reduceLeft(f);
0
+ b.filter(None!=).map{ (x : (Int,Option[B])) => println(x._1); x._2.get}.reduceLeft(f);
0
   }
0
 }

Comments

    No one has commented yet.