libra
数据处理引擎
去年用java写的一个支持分布式的数据处理引擎小框架,然而今年才知道apache有一个类似的项目叫nifi,果然你能想到的大概率前人都想到了哈哈哈
如上图所示
整个数据处理引擎分为以下三个概念
- task:任务,一个任务可以有多个处理器进行处理,处理器之间可以并行
- processer:处理器,一个处理器可以有多个行为,只能串行执行
- performance: 行为,每个行为都需要配置一个classpath,标识这个行为需要运行怎样的逻辑
所有的节点(performance支持自定义传值,可以在此配置需要的自定义参数) 如:
<performance name="lowerField" class="LowerField" fieldKey="table_name"></performance>
其中name
和class
必填, 后面fieldKey
为自定义参数,会在map中存入,使用时可在map中根据table_name
获取
processer
<processor name="getHBase">
<performance name="lowerField"/>
<performance name="getHBase"/>
</processor>
name为对应performance的name
task
<task name="siteTask" rabbitType="topic" exchangeName="common" routingKey="common.site" queueName="common.site" qos="2" autoAck="false">
<processor name="getHBase"/>
<processor name="FreshSite"/>
</task>
name为对应processor的name
rabbitmq
框架集成了rabbitmq
在task后加上自定义的参数
<task name="commonTask" rabbitType="normal" queueName="common" qos="8" autoAck="false">
<processor name="formatContent"/>
<processor name="sendMq"/>
</task>
发送则是在performance后加上自定义参数
<performance name="sendMq" class="SendMQ" exchangeName="topic" routingKey="topic." rabbitType="topic" exchangeDurable="true"></performance>