You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Sendoh <un...@gmail.com> on 2017/01/27 10:09:34 UTC

setParallelism() for addSource() in streaming

Hi Flink users,

I'd like to setup different parallelisms for different source.

I found we cannot 
DataStream<String> bigStream = env.addSource(
                new FooSource(properties, bigTopic)
        ).setParallelism(5)..rebalance();

DataStream<String> smallStream = env.addSource(
                new FooSource(properties, smallTopic)
        ).setParallelism(1)..rebalance();
   
        env.setParallelism(3);
//do .map(), window(), ...

But I can set the following:

DataStream<String> bigStream = env.setParallelism(5).addSource(
                new FooSource(properties, bigTopic)
        ).rebalance();

DataStream<String> smallStream = env.setParallelism(1).addSource(
                new FooSource(properties, smallTopic)
        ).rebalance();

        env.setParallelism(3);
//do .map(), window(), ...

Would it have the same effect?

Best,

Sendoh



--
View this message in context: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/setParallelism-for-addSource-in-streaming-tp11343.html
Sent from the Apache Flink User Mailing List archive. mailing list archive at Nabble.com.

Re: setParallelism() for addSource() in streaming

Posted by Jonas <jo...@huntun.de>.
env.setParallelism(5).addSource(???) will set the default parallelism for
this Job to 5 and then add the source.



--
View this message in context: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/setParallelism-for-addSource-in-streaming-tp11343p11356.html
Sent from the Apache Flink User Mailing List archive. mailing list archive at Nabble.com.