Package com.dianping.cat.configuration.server.entity

Examples of com.dianping.cat.configuration.server.entity.ServerConfig


  public void initialize(File configFile) throws Exception {
    if (configFile != null && configFile.canRead()) {
      m_logger.info(String.format("Loading configuration file(%s) ...", configFile.getCanonicalPath()));

      String xml = Files.forIO().readFrom(configFile, "utf-8");
      ServerConfig config = DefaultSaxParser.parse(xml);

      // do validation
      config.accept(new ServerConfigValidator());
      m_config = config;
    } else {
      if (configFile != null) {
        m_logger.warn(String.format("Configuration file(%s) not found, IGNORED.", configFile.getCanonicalPath()));
      }

      ServerConfig config = new ServerConfig();

      // do validation
      config.accept(new ServerConfigValidator());
      m_config = config;
    }

    if (m_config.isLocalMode()) {
      m_logger.warn("CAT server is running in LOCAL mode! No HDFS or MySQL will be accessed!");
View Full Code Here

TOP

Related Classes of com.dianping.cat.configuration.server.entity.ServerConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.