首页 > Web开发 > 详细

Flume Channel Selector

时间:2015-06-08 16:28:10      阅读:908      评论:0      收藏:0      [点我收藏+]

Flume 基于Channel Selector可以实现扇入、扇出。

同一个数据源分发到不同的目的,如下图。

  技术分享


在source上可以定义channel selector:

1
2
3
4
5
6
7
8
9
a1.sources=r1
...
a1.channels=c1 c2
...
a1.sources.r1.selector.type=multiplexing
a1.sources.r1.selector.header=type
a1.sources.r1.selector.mapping.type1=c1
a1.sources.r1.selector.mapping.type2=c2
...

但是这个type变量从哪里来呢?

解决方法:

1、修改用到的那个source的源码,应用到client端,不同的数据类型添加不同的type

2、在source端配置interceptor,通过interceptor在header上设置变量type

比如:

使用regex_extractor,对传过来的数据进行处理,提取出type值(如果可以的话,可以在client端的数据格式添加type值,方便使用regex_extractor提取出来)。

3、在source端自定义interceptor,在interceptor里对处理变量type









Flume Channel Selector

原文:http://www.cnblogs.com/lishouguang/p/4560918.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!