spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manas Kar <manasdebashis...@gmail.com>
Subject Re: RDDs
Date Tue, 03 Mar 2015 14:16:40 GMT
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.mbms@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-unsubscribe@spark.apache.org
> For additional commands, e-mail: user-help@spark.apache.org
>
>

Mime
View raw message