GitHub user ffbin opened a pull request:

    https://github.com/apache/flink/pull/932

    [FLINK-2391]Fix Storm-compatibility FlinkTopologyBuilder.createTopology bug

    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:
    where get streaming group attribute index, it get upstream operator 
outputFields.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ffbin/flink FFB_Flink

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/932.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #932
    
----
commit e9c098670a14020d38f9b5e05442a2a606d90dcb
Author: ffbin <[email protected]>
Date:   2015-07-22T09:04:45Z

    modify

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to