Re: Kafka Producer - Null Pointer Exception when processing by element

2017-07-19 Thread Tzu-Li (Gordon) Tai
Our parser.parse() function has a one-to-one mapping between an input byte[]  to a List Ideally, this should be handled within the KeyedDeserializationSchema passed to your Kafka consumer. That would then avoid the need of an extra “parser map function” after the source. Were you suggesting a fl

Re: Kafka Producer - Null Pointer Exception when processing by element

2017-07-17 Thread earellano
Tzu-Li (Gordon) Tai wrote > Basically, when two operators are chained together, the output of the > first operator is immediately chained to the processElement of the next > operator; it’s therefore just a consecutive invocation of processElements > on the chained operators. There will be no thread

Re: Kafka Producer - Null Pointer Exception when processing by element

2017-07-17 Thread Tzu-Li (Gordon) Tai
With task chaining as you're saying, could you help clarify how it works  please? Operator can be chained to be executed by a single task thread. See [1] for more details on that. Basically, when two operators are chained together, the output of the first operator is immediately chained to the p

Re: Kafka Producer - Null Pointer Exception when processing by element

2017-07-16 Thread earellano
Hi, Tzu-Li (Gordon) Tai wrote > These seems odd. Are your events intended to be a list? If not, this > should be a `DataStream > > `. > > From the code snippet you’ve attached in the first post, it seems like > you’ve initialized your source incorrectly. > > `env.fromElements(List<...>)` will

Re: Kafka Producer - Null Pointer Exception when processing by element

2017-07-16 Thread Tzu-Li (Gordon) Tai
Hi, void output(DataStream> inputStream) { These seems odd. Are your events intended to be a list? If not, this should be a `DataStream`. From the code snippet you’ve attached in the first post, it seems like you’ve initialized your source incorrectly. `env.fromElements(List<...>)` will take t

Re: Kafka Producer - Null Pointer Exception when processing by element

2017-07-16 Thread earellano
Tzu-Li (Gordon) Tai wrote > It seems like you’ve misunderstood how to use the FlinkKafkaProducer, or > is there any specific reason why you want to emit elements to Kafka in a > map function? > > The correct way to use it is to add it as a sink function to your > pipeline, i.e. > > DataStream >

Re: Kafka Producer - Null Pointer Exception when processing by element

2017-07-14 Thread Tzu-Li (Gordon) Tai
Hi, It seems like you’ve misunderstood how to use the FlinkKafkaProducer, or is there any specific reason why you want to emit elements to Kafka in a map function? The correct way to use it is to add it as a sink function to your pipeline, i.e. DataStream someStream = … someStream.addSink(new