Flume NG源码分析(三)使用Event接口表示数据流

本文深入探讨Flume NG中的核心组件Event,它是数据流在Source、Channel和Sink之间传递的基础。Event通过header和body两部分封装数据,常用于如ExecSource这样的组件处理本地日志数据。
摘要由CSDN通过智能技术生成

Flume NG有4个主要的组件:

Event表示在Flume各个Agent之间传递的数据流

Source表示从外部源接收Event数据流,然后传递给Channel

Channel表示对从Source传递的Event数据流的临时存储

Sink表示从Channel中接收存储的Event数据流,并传递给下游的Source或者终点仓库

这篇看一下Event接口表示的数据流。Source, Channel, Sink操作的数据流都是基于Event接口的封装。


public interface Event {

  /**
   * Returns a map of name-value pairs describing the data stored in the body.
   */
  public Map<String, String> getHeaders();

  /**
   * Set the event headers
   * @param headers Map of headers to replace the current headers.
   */
  public void setHeaders(Map<String, String> headers);

  /**
   * Returns the raw byte array of the data contained in this event.
   */
  publ
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值