[FLINK-2391]Fix Storm-compatibility FlinkTopologyBuilder.createTopology bug - #940
[FLINK-2391]Fix Storm-compatibility FlinkTopologyBuilder.createTopology bug#940ffbin wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
typo: prodDeclarer (not procDeclarer)
|
LGTM. Let's see if Travis passes. Before merging, you need to update your commit message to be meaningful. |
|
Your commit message is still not ok. You update the GitHub description, but not the commit message. It is still "modify". You need to do a |
|
By the way, you don't need to open another pull request for updating it. |
…teTopology() throws java.lang.NullPointerException bug
|
Thank you very much! |
|
+1 for merging |
|
Will merge this... |
|
Thanks for reporting the bug and providing a fix. |
…teTopology() throws java.lang.NullPointerException bug This closes apache#940
…teTopology() throws java.lang.NullPointerException bug This closes apache#940
1.Error Scene:
Error happend in program like this:
builder.setSpout("source0", new Generator(pt), pt.getInt("sourceParallelism"));
builder.setBolt("sa", new RepartPassThroughBolt(pt), pt.getInt("sinkParallelism")).fieldsGrouping("source0", new Fields("id"));
builder.setBolt("sink", new Sink(pt), pt.getInt("sinkParallelism")).fieldsGrouping("sa", new Fields("id"));
final FlinkLocalCluster cluster = FlinkLocalCluster.getLocalCluster();
cluster.submitTopology("throughput", conf, builder.createTopology());
if the last bolt use fieldsGrouping, createTopology will throw NullPointerException.
2.Reason:
where get streaming group attribute index, it get downstream operator outputFields,this is error。Because the last bolt has no
outputFields, so the outputSchema of declarer in null and throw NullPointerException.
3.Modify:
Save operator declarer in one hashmap. Get producer declarer from hashmap when get upstream operator outputFields.