#指定Agent的组件名称
name = value
a1.sources = r1
a1.sinks = k1
a1.channels = c1
#指定Flume source(要监听的路径)
a1.sources.r1.type = spooldir
a1.sources.r1.spoolDir = /home/hadoop/software/flume/lihao
#指定Flume sink
a1.sinks.k1.type = logger
#指定Flume channel
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100
#绑定source和sink到channel上
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1
~
private Map<String, Context> sourceContextMap;
private Map<String, Context> sinkContextMap;
private Map<String, Context> channelContextMap;
private Map<String, Context> sinkGroupContextMap;
sourceContextMap包含<c1,<type,spooldiry>
<spooldir,/home/hadoop/software/flume/lihao>>
....
同理其他几个类似
if (srcConf == null) {
srcConf = new Context();
sourceContextMap.put(name, srcConf);
}
srcConf.put(cnck.getConfigKey(), value);
return true;
}
Cnetext中包含的是<c1:<type,spooldiry> <spooldir,/home/hadoop/software/flume/lihao>,r1:<>,s1:<>>
private final Map<String, ComponentConfiguration> sourceConfigMap;
private final Map<String, ComponentConfiguration> sinkConfigMap;
private final Map<String, ComponentConfiguration> channelConfigMap;
private final Map<String, ComponentConfiguration> sinkgroupConfigMap;
channelConfigMap存放的是<channelName,conf(组件实例)> 其他相同