Пример #1
0
  /**
   * Warning - do not use this constructor if you think it has been called anywhere else! This is
   * also not thread safe.
   *
   * <p>TODO(henry): Proper singleton implementation
   */
  public FlumeMaster(FlumeConfiguration cfg, boolean doHttp) {
    this.cfg = cfg;
    instance = this;

    this.uniqueMasterName = "flume-master-" + cfg.getMasterServerId();

    this.doHttp = doHttp;
    this.cmdman = new CommandManager();
    ConfigStore cfgStore = createConfigStore(FlumeConfiguration.get());
    this.statman = new StatusManager();

    // configuration manager translate user entered configs

    if (FlumeConfiguration.get().getMasterIsDistributed()) {
      LOG.info("Distributed master, disabling all config translations");
      ConfigurationManager base = new ConfigManager(cfgStore);
      this.specman = base;
    } else {
      // TODO (jon) translated configurations cause problems in multi-master
      // situations. For now we disallow translation.
      LOG.info("Single master, config translations enabled");
      ConfigurationManager base = new ConfigManager(cfgStore);
      ConfigurationManager flowedFailovers =
          new FlowConfigManager.FailoverFlowConfigManager(base, statman);
      this.specman = new LogicalConfigurationManager(flowedFailovers, new ConfigManager(), statman);
    }

    if (FlumeConfiguration.get().getMasterIsDistributed()) {
      this.ackman = new GossipedMasterAckManager(FlumeConfiguration.get());
    } else {
      this.ackman = new MasterAckManager();
    }
  }
Пример #2
0
 /**
  * Completely generic and pluggable Flume master constructor. Used for test cases. Webserver is by
  * default off.
  */
 public FlumeMaster(
     CommandManager cmd,
     ConfigurationManager cfgMan,
     StatusManager stat,
     MasterAckManager ack,
     FlumeConfiguration cfg) {
   instance = this;
   this.doHttp = false;
   this.cmdman = cmd;
   this.specman = cfgMan;
   this.statman = stat;
   this.ackman = ack;
   this.cfg = cfg;
   this.uniqueMasterName = "flume-master-" + cfg.getMasterServerId();
 }