Re: How to passing parameters to another java class

2015-11-15 Thread Zhang, Jingyu
Thanks Fengdong, the startTime, and endTime are null in the method of call(Iterator lines). Java do not allow top-level class to be Static. >From Spark docs, I can broadcast them but I don't know how to receive them form another class. On 16 November 2015 at 16:16, Fengdong Yu

How to passing parameters to another java class

2015-11-15 Thread Zhang, Jingyu
I want to pass two parameters into new java class from rdd.mapPartitions(), the code like following. ---Source Code Main method: /*the parameters that I want to pass into the PixelGenerator.class for selecting any items between the startTime and the endTime. */ int startTime, endTime;

Re: How to passing parameters to another java class

2015-11-15 Thread Fengdong Yu
Can you try : new PixelGenerator(startTime, endTime) ? > On Nov 16, 2015, at 12:47 PM, Zhang, Jingyu wrote: > > I want to pass two parameters into new java class from rdd.mapPartitions(), > the code like following. > ---Source Code > > Main method: > > /*the

Re: How to passing parameters to another java class

2015-11-15 Thread Fengdong Yu
Just make PixelGenerator as a nested static class? > On Nov 16, 2015, at 1:22 PM, Zhang, Jingyu wrote: > > Fengdong

Re: How to passing parameters to another java class

2015-11-15 Thread Zhang, Jingyu
Thanks, that worked for local environment but not in the Spark Cluster. On 16 November 2015 at 16:05, Fengdong Yu wrote: > Can you try : new PixelGenerator(startTime, endTime) ? > > > > On Nov 16, 2015, at 12:47 PM, Zhang, Jingyu > wrote: >

Re: How to passing parameters to another java class

2015-11-15 Thread Fengdong Yu
If you got “cannot Serialized” Exception, then you need to PixelGenerator as a Static class. > On Nov 16, 2015, at 1:10 PM, Zhang, Jingyu wrote: > > Thanks, that worked for local environment but not in the Spark Cluster. > > > On 16 November 2015 at 16:05,