码迷,mamicode.com
首页 > 其他好文 > 详细

storm分组模式

时间:2015-10-21 18:59:01      阅读:282      评论:0      收藏:0      [点我收藏+]

标签:

  1. Shuffle grouping: Tuples被随机分配到每一个bolt’s task,以便于每一个bolt’s task获得相同数量的tuples

  2. Fields grouping: Stream被根据属性(fields)进行分组。举例:如果一个Stream根据“user-id”分组,具有相同“user-id”属性的tuples会被发往同一个bolt’s task,具有不同“user-id”的tuples有可能发往不同的bolt’s task

  3. All groupingStream会被重复的发往每一个bolt’s task,使用这个方式需要慎重。

  4. Global grouping输入流会发往bolt’s tasks中的一个。具体来说,会发往最小idtask

  5. None grouping:这种方式表示你并不关心Stream如何分组。当前版本中,它的效果等同于shuffle groupingEventually though, Storm will push down bolts with none groupings to execute in the same thread as the bolt or spout they subscribe from (when possible).

  6. Direct grouping:这是一个特殊的grouping。这种方式可以让tuple的生产者决定消费者中哪一个task能够接收这个tuple。只有当一个Stream声明是一个direct stream时,Direct grouping方式才能生效。必须使用[emitDirect](/apidocs/backtype/storm/task/OutputCollector.html#emitDirect(int, int, java.util.List)方法,才能将tuple发送到一个direct Stream中。一个bolt可以通过两种方式获取到消费者的taskid,一种是使用TopologyContext获取,另一种是通过跟踪OutputCollector中的emit方法的返回值(当tuples发送之后,会返回task ids

  7. Local or shuffle grouping:如果目标bolt在一个worker进程中有多个或一个taskstuples会随机发送到进程内的tasks。否则,这种方式与shuffle grouping相同。

storm分组模式

标签:

原文地址:http://www.cnblogs.com/chengxin1982/p/4898517.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!