How to customize schedule mode and result partition type?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to customize schedule mode and result partition type?

tison
Hi all,

Here I prefer to forcing a task running in LAZY_FROM_SOURCE schedule mode with all ResultPartitionType be BLOCKING.

But I cannot find options to config that in StreamExecutionEnvironment, thus using below as a workaround, quite triky.

inal StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

env.addSource(new InfiniteSourceFunction())
.setParallelism(2)
.shuffle()
.addSink(new DiscardingSink<>())
.setParallelism(2);

Field field = env.getClass().getSuperclass().getDeclaredField("transformations");
field.setAccessible(true);
List<StreamTransformation<?>> transformations = (List<StreamTransformation<?>>) field.get(env);

StreamGraph streamGraph = StreamGraphGenerator.generate(env, transformations);
streamGraph.getCustomConfiguration().setString(ScheduleMode.class.getName(), LAZY_FROM_SOURCES.toString());
streamGraph.setJobName(testname);
streamGraph.getStreamEdges(1, 3)
.get(0).setResultPartitionType(ResultPartitionType.BLOCKING);

Best,
tison.
Reply | Threaded
Open this post in threaded view
|

Re: How to customize schedule mode and result partition type?

tison
Sorry to attach this message here, but if someone see this email please reply an ack. Without any reply I wonder if this email has been received by someone in the mail list.

Best,
tison.

Reply | Threaded
Open this post in threaded view
|

Re: How to customize schedule mode and result partition type?

Renjie Liu
Hi:
1. I'm wondering in which case you need this LAZY_FROM_SROUCE schedule mode?
2. It seems that this can't be changed for streaming jobs, and it's worth a discussion for an api that changes the schedule mode

On Fri, Sep 7, 2018 at 6:25 PM 陈梓立 <[hidden email]> wrote:
Sorry to attach this message here, but if someone see this email please reply an ack. Without any reply I wonder if this email has been received by someone in the mail list.

Best,
tison.

--
Liu, Renjie
Software Engineer, MVAD