Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Error while creating a DataStream using fromElements function

Solved Go to solution

Error while creating a DataStream using fromElements function

Contributor

Below is the expeption -

Caused by: java.io.IOException: Failed to deserialize an element from the source. If you are using user-defined serialization (Value and Writable types), check the serialization functions. Serializer is org.apache.flink.api.java.typeutils.runtime.kryo.KryoSerializer@599fcdda at org.apache.flink.streaming.api.functions.source.FromElementsFunction.run(FromElementsFunction.java:121) at org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:58) at org.apache.flink.streaming.runtime.tasks.SourceStreamTask.run(SourceStreamTask.java:55) at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:218) at org.apache.flink.runtime.taskmanager.Task.run(Task.java:584) at java.lang.Thread.run(Thread.java:745)

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Error while creating a DataStream using fromElements function

+ @Robert Metzger @Stephan Ewen as they are the experts on Flink streaming

@Hemant Kumar this also may provide some hints: http://stackoverflow.com/questions/34379170/error-...

View solution in original post

5 REPLIES 5
Highlighted

Re: Error while creating a DataStream using fromElements function

@Ali Bajwa have you seen sth. like this before?

Highlighted

Re: Error while creating a DataStream using fromElements function

+ @Robert Metzger @Stephan Ewen as they are the experts on Flink streaming

@Hemant Kumar this also may provide some hints: http://stackoverflow.com/questions/34379170/error-...

View solution in original post

Highlighted

Re: Error while creating a DataStream using fromElements function

Contributor

Thanks @Ali Bajwa

@Robert Metzger @Stephan Ewen I was trying to read a Web log which is accessible through a HTTP URL. I used a InputStreamReader to read the content from the HttpConnection. As InputStreamReader is not serializable, I got the above exception.

Should we prepare a custom SourceFunction to handle HTTP Streams or does Flink provide any methods/objects in order to enable users to read HTTP streams?

Highlighted

Re: Error while creating a DataStream using fromElements function

Explorer

Right now, there are not methods for reading HTTP streams. But implementing a custom "SourceFunction" (as you suggested) is the recommended appropach. Please let me know if you have further questions.

Highlighted

Re: Error while creating a DataStream using fromElements function

Mentor

@Hemant Kumar has this been resolved? Can you post your solution or accept best answer?

Don't have an account?
Coming from Hortonworks? Activate your account here