The above is a great example using thread. Does any one have an example using scala/Akka Future to do the same. I am looking for an example like that which uses a Akka Future and does something if the Future "Timesout"
On Tue, Mar 3, 2015 at 7:00 AM, Kartheek.R <kartheek.m...@gmail.com> wrote: > Hi TD, > "You can always run two jobs on the same cached RDD, and they can run in > parallel (assuming you launch the 2 jobs from two different threads)" > > Is this a correct way to launch jobs from two different threads? > > val threadA = new Thread(new Runnable { > def run() { > for(i<- 0 until end) > { > val numAs = logData.filter(line => line.contains("a")) > println("Lines with a: %s".format(numAs.count)) > } > } > }) > > val threadB = new Thread(new Runnable { > def run() { > for(i<- 0 until end) > { > val numBs = logData.filter(line => line.contains("b")) > println("Lines with b: %s".format(numBs.count)) > } > } > }) > > > > > -- > View this message in context: > http://apache-spark-user-list.1001560.n3.nabble.com/RDDs-tp13343p21892.html > Sent from the Apache Spark User List mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@spark.apache.org > For additional commands, e-mail: user-h...@spark.apache.org > >