setSlotSharing NPE: Starting a stream consumer in a thread

Posted by jay vyas on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/setSlotSharing-NPE-Starting-a-stream-consumer-in-a-thread-tp3021.html

Hi flink !

Looks like "setSlotSharing" is throwing an NPE when I try to start a Thread  which runs a streaming job.

I'm trying to do this by creating a dataStream from env.readFileStream, and then later starting a job which writes files out ...

However, I get

Exception in thread "main" java.lang.NullPointerException
    at org.apache.flink.streaming.api.graph.StreamingJobGraphGenerator.setSlotSharing(StreamingJobGraphGenerator.java:361)

What is the right way to create a stream and batch job all in one environment?

For reference, here is a gist of the code https://gist.github.com/jayunit100/c7ab61d1833708d290df, and the offending line is the
DataStream<String> dataStream = env.readFileStream("/tmp/a",1000, FileMonitoringFunction.WatchType.ONLY_NEW_FILES);
line.

Thanks again !

--
jay vyas