flume variable load storage instance

#Specify the component name of the 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>>
                    ....

Similarly, several other similar

 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 stores <channelName,conf (component instance)> Others are the same

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326920382&siteId=291194637