MCPcopy Create free account
hub / github.com/Tencent/phxsql / ReadConfig

Method ReadConfig

phxsqlproxy/phxsqlproxyconfig.cpp:33–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33void PHXSqlProxyConfig::ReadConfig() {
34 svr_port_ = GetInteger("Server", "Port", 0);
35 svr_ip_ = Get("Server", "IP", "");
36 if (svr_ip_ == "$InnerIP") {
37 svr_ip_ = GetInnerIP();
38 }
39 phxsql_plugin_config_ = Get("Server", "PluginConfigFile", "");
40 is_open_debug_mode_ = GetInteger("Server", "OpenDebugMode", 0);
41 is_only_proxy_ = GetInteger("Server", "OnlyProxy", 0);
42 is_master_enable_read_port_ = GetInteger("Server", "MasterEnableReadPort", 0);
43 is_enable_try_best_ = GetInteger("Server", "TryBestIfBinlogsvrDead", 0);
44 freqctrl_config_ = Get("Server", "FreqCtrlConfig", "");
45 log_level_ = GetInteger("Server", "LogLevel", 3);
46 log_file_max_size_ = GetInteger("Server", "LogFileMaxSize", 1600);
47 log_path_ = Get("Server", "LogFilePath", "/tmp/");
48 sleep_ = GetInteger("Server", "Sleep", 0);
49 connect_timeout_ms_ = GetInteger("Server", "ConnectTimeoutMs", 200);
50 write_timeout_ms_ = GetInteger("Server", "WriteTimeoutMs", 1000);
51 proxy_protocol_ = GetInteger("Server", "ProxyProtocol", 0);
52 proxy_protocol_timeout_ms_ = GetInteger("Server", "ProxyProtocolTimeoutMs", 1000);
53
54 /*
55 phxsql_config_ = PhxMySqlConfig :: GetDefault();
56 if ( phxsql_plugin_config_ != "" )
57 {
58 phxsql_config_->ReadFileWithConfigDirPath( phxsql_plugin_config_.c_str() );
59 }
60 */
61 ReadMasterWorkerConfig(&master_worker_config_);
62 ReadSlaveWorkerConfig(&slave_worker_config_);
63 LogWarning("read plugin config [%s]", phxsql_plugin_config_.c_str());
64}
65
66const char * PHXSqlProxyConfig::GetMysqlIP() {
67 return Option::GetDefault()->GetMySqlConfig()->GetMySQLIP();

Callers

nothing calls this directly

Calls 1

LogWarningFunction · 0.85

Tested by

no test coverage detected