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
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;
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
Just make PixelGenerator as a nested static class?
> On Nov 16, 2015, at 1:22 PM, Zhang, Jingyu wrote:
>
> Fengdong
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:
>
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,