• storm分组模式


    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相同。

  • 相关阅读:
    nextTick
    git版本管理2
    git版本管理1
    生成二维码优惠券
    JavaScript 数据类型
    scoped属性与 elementui 样式
    LINUX命令学习(持续更新)
    jenkins构建触发器定时任务Build periodically和Poll SCM
    installer,source,binary版本安装包区别
    jenkins是什么
  • 原文地址:https://www.cnblogs.com/chengxin1982/p/4898517.html
Copyright © 2020-2023  润新知