FieldGrouping ID在Storm中意味着什么?

时间:2016-12-29 11:16:58

标签: apache-storm

这是配置:

TopologyBuilder builder = new TopologyBuilder();
builder.setSpout("1", new Produce(), 1);  
builder.setBolt("2", new Output(), 4).shuffleGrouping("1");
builder.setBolt("3", new Writer(), 8).fieldsGrouping("2", new Fields("ahah","bb"));

# And tuple "ahah" include{"aaa","bbb","ccc","ddd"}   
# tuple "bb" include {"ee","ff","gg","kk"}

3个螺栓有8个线程,分组为fieldsGrouping,字段包括" ahah"和" bb"。

而且我不知道3个螺栓的8个螺纹如何工作?

同一元组是什么意思? Field name("ahah","bb")?或字段content("aaa","bbb","ccc","ddd","ee","ff","gg","kk")

1 个答案:

答案 0 :(得分:0)

  

字段分组:流按照中指定的字段进行分区   分组。例如,如果流按“user-id”分组   字段,具有相同“user-id”的元组将始终执行相同的任务,   但是具有不同“用户ID”的元组可能会执行不同的任务。

http://storm.apache.org/releases/1.0.0/Concepts.html