Re: Regarding Sparkcontext object

2014-04-04 Thread Daniel Siegmann
On Wed, Apr 2, 2014 at 7:11 PM, yh18190  wrote:

> Is it always needed that sparkcontext object be created in Main method of
> class.Is it necessary?Can we create "sc" object in other class and try to
> use it by passing this object through function and use it?
>

The Spark context can be initialized wherever you like and passed around
just as any other object. Just don't try to create multiple contexts
against "local" (without stopping the previous one first), or you may get
ArrayStoreExceptions (I learned that one the hard way).

-- 
Daniel Siegmann, Software Developer
Velos
Accelerating Machine Learning

440 NINTH AVENUE, 11TH FLOOR, NEW YORK, NY 10001
E: daniel.siegm...@velos.io W: www.velos.io


Regarding Sparkcontext object

2014-04-02 Thread yh18190
Hi

Is it always needed that sparkcontext object be created in Main method of
class.Is it necessary?Can we create "sc" object in other class and try to
use it by passing this object through function and use it?

Please clarify..



--
View this message in context: 
http://apache-spark-user-list.1001560.n3.nabble.com/Regarding-Sparkcontext-object-tp3671.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.