今天我們通過閱讀Flume-NG的源碼來看看Flume的整個啟動流程,廢話不多說,翠花,上源碼??!
1 主類也是啟動類
在這里我貼出Application中跟啟動有關(guān)的方法,其他你們可以自己看源碼,畢竟源碼解析解的是思路。
org.apache.flume.node.Application
/*主函數(shù)*/ public static void main(String[] args) { try { boolean isZkConfigured = false; Options options = new Options(); Option option = new Option("n", "name", true, "the name of this agent"); option.setRequired(true); options.addOption(option); option = new Option("f", "conf-file", true, "specify a config file (required if -z missing)"); option.setRequired(false); options.addOption(option); option = new Option(null, "no-reload-conf", false, "do not reload config file if changed"); options.addOption(option); &n