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!");