#include <Config.hpp>
Collaboration diagram for Config:

Public Member Functions | |
| Config () | |
| virtual | ~Config () |
| void | printConfigFile (NdbOut &out=ndbout) const |
| void | printConfigFile (OutputStream &out) const |
| const ConfigInfo * | getConfigInfo () const |
Public Attributes | |
| Properties * | m_oldConfig |
| ndb_mgm_configuration * | m_configValues |
Private Member Functions | |
| void | printAllNameValuePairs (NdbOut &out, const Properties *prop, const char *section) const |
Private Attributes | |
| ConfigInfo | m_info |
Contains all cluster configuration parameters.
The information includes all configurable parameters for a NDB cluster:
The following categories (sections) of configuration parameters exists:
Definition at line 46 of file Config.hpp.
| Config::Config | ( | ) |
Constructor which loads the object with an Properties object
Definition at line 27 of file Config.cpp.
References m_configValues, and m_oldConfig.
00027 { 00028 m_oldConfig = 0; 00029 m_configValues = 0; 00030 }
| Config::~Config | ( | ) | [virtual] |
Definition at line 32 of file Config.cpp.
References free, m_configValues, and m_oldConfig.
00032 { 00033 if(m_configValues != 0){ 00034 free(m_configValues); 00035 } 00036 00037 if(m_oldConfig != 0) 00038 delete m_oldConfig; 00039 }
| const ConfigInfo* Config::getConfigInfo | ( | ) | const [inline] |
| void Config::printAllNameValuePairs | ( | NdbOut & | out, | |
| const Properties * | prop, | |||
| const char * | section | |||
| ) | const [private] |
Definition at line 44 of file Config.cpp.
References ConfigInfo::CI_BOOL, ConfigInfo::CI_DEPRICATED, ConfigInfo::CI_INT, ConfigInfo::CI_INT64, ConfigInfo::CI_INTERNAL, ConfigInfo::CI_NOTIMPLEMENTED, ConfigInfo::CI_SECTION, ConfigInfo::CI_STRING, Properties::contains(), Properties::Iterator::first(), Properties::get(), ConfigInfo::getInfo(), ConfigInfo::getStatus(), ConfigInfo::getType(), m_info, MGM_REQUIRE, n, Properties::Iterator::next(), and NULL.
Referenced by printConfigFile().
00046 { 00047 Properties::Iterator it(prop); 00048 const Properties * section = m_info.getInfo(s); 00049 for (const char* n = it.first(); n != NULL; n = it.next()) { 00050 Uint32 int_value; 00051 const char* str_value; 00052 Uint64 int_64; 00053 00054 if(!section->contains(n)) 00055 continue; 00056 if (m_info.getStatus(section, n) == ConfigInfo::CI_INTERNAL) 00057 continue; 00058 if (m_info.getStatus(section, n) == ConfigInfo::CI_DEPRICATED) 00059 continue; 00060 if (m_info.getStatus(section, n) == ConfigInfo::CI_NOTIMPLEMENTED) 00061 continue; 00062 00063 out << n << ": "; 00064 00065 switch (m_info.getType(section, n)) { 00066 case ConfigInfo::CI_INT: 00067 MGM_REQUIRE(prop->get(n, &int_value)); 00068 out << int_value; 00069 break; 00070 00071 case ConfigInfo::CI_INT64: 00072 MGM_REQUIRE(prop->get(n, &int_64)); 00073 out << int_64; 00074 break; 00075 00076 case ConfigInfo::CI_BOOL: 00077 MGM_REQUIRE(prop->get(n, &int_value)); 00078 if (int_value) { 00079 out << "Y"; 00080 } else { 00081 out << "N"; 00082 } 00083 break; 00084 case ConfigInfo::CI_STRING: 00085 MGM_REQUIRE(prop->get(n, &str_value)); 00086 out << str_value; 00087 break; 00088 case ConfigInfo::CI_SECTION: 00089 out << "SECTION"; 00090 break; 00091 } 00092 out << endl; 00093 } 00094 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Config::printConfigFile | ( | OutputStream & | out | ) | const [inline] |
Definition at line 58 of file Config.hpp.
References ndb, and printConfigFile().
00058 { 00059 NdbOut ndb(out); 00060 printConfigFile(ndb); 00061 }
Here is the call graph for this function:

| void Config::printConfigFile | ( | NdbOut & | out = ndbout |
) | const |
Prints the configuration in configfile format
Definition at line 98 of file Config.cpp.
References Properties::Iterator::first(), Properties::get(), MGM_REQUIRE, name, Properties::Iterator::next(), NULL, printAllNameValuePairs(), strlen(), and strncasecmp.
Referenced by printConfigFile(), and MgmtSrvr::saveConfig().
00098 { 00099 #if 0 00100 Uint32 noOfNodes, noOfConnections, noOfComputers; 00101 MGM_REQUIRE(get("NoOfNodes", &noOfNodes)); 00102 MGM_REQUIRE(get("NoOfConnections", &noOfConnections)); 00103 MGM_REQUIRE(get("NoOfComputers", &noOfComputers)); 00104 00105 out << 00106 "######################################################################" << 00107 endl << 00108 "#" << endl << 00109 "# NDB Cluster System configuration" << endl << 00110 "#" << endl << 00111 "######################################################################" << 00112 endl << 00113 "# No of nodes (DB, API or MGM): " << noOfNodes << endl << 00114 "# No of connections: " << noOfConnections << endl << 00115 "######################################################################" << 00116 endl; 00117 00118 /************************** 00119 * Print COMPUTER configs * 00120 **************************/ 00121 const char * name; 00122 Properties::Iterator it(this); 00123 for(name = it.first(); name != NULL; name = it.next()){ 00124 if(strncasecmp("Computer_", name, 9) == 0){ 00125 00126 const Properties *prop; 00127 out << endl << "[COMPUTER]" << endl; 00128 MGM_REQUIRE(get(name, &prop)); 00129 printAllNameValuePairs(out, prop, "COMPUTER"); 00130 00131 out << endl << 00132 "###################################################################" << 00133 endl; 00134 00135 } else if(strncasecmp("Node_", name, 5) == 0){ 00136 /********************** 00137 * Print NODE configs * 00138 **********************/ 00139 const Properties *prop; 00140 const char *s; 00141 00142 MGM_REQUIRE(get(name, &prop)); 00143 MGM_REQUIRE(prop->get("Type", &s)); 00144 out << endl << "[" << s << "]" << endl; 00145 printAllNameValuePairs(out, prop, s); 00146 00147 out << endl << 00148 "###################################################################" << 00149 endl; 00150 } else if(strncasecmp("Connection_", name, 11) == 0){ 00151 /**************************** 00152 * Print CONNECTION configs * 00153 ****************************/ 00154 const Properties *prop; 00155 const char *s; 00156 00157 MGM_REQUIRE(get(name, &prop)); 00158 MGM_REQUIRE(prop->get("Type", &s)); 00159 out << endl << "[" << s << "]" << endl; 00160 printAllNameValuePairs(out, prop, s); 00161 00162 out << endl << 00163 "###################################################################" << 00164 endl; 00165 } else if(strncasecmp("SYSTEM", name, strlen("SYSTEM")) == 0) { 00166 /************************ 00167 * Print SYSTEM configs * 00168 ************************/ 00169 const Properties *prop; 00170 00171 MGM_REQUIRE(get(name, &prop)); 00172 out << endl << "[SYSTEM]" << endl; 00173 printAllNameValuePairs(out, prop, "SYSTEM"); 00174 00175 out << endl << 00176 "###################################################################" << 00177 endl; 00178 } 00179 } 00180 #endif 00181 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 79 of file Config.hpp.
Referenced by MgmtSrvr::alloc_node_id(), Config(), MgmtSrvr::fetchConfig(), MgmApiSession::getConfig_common(), MgmtSrvr::getConnectionDbParameter(), MgmtSrvr::getPort(), load_configuration(), MgmtSrvr::MgmtSrvr(), NDB_COMMAND(), InitConfigFileParser::run_config_rules(), MgmtSrvr::sendStopMgmd(), MgmtSrvr::setConnectionDbParameter(), MgmtSrvr::setDbParameter(), MgmtSrvr::start(), MgmtSrvr::startEventLog(), MgmtSrvr::versionNode(), and ~Config().
ConfigInfo Config::m_info [private] |
Definition at line 68 of file Config.hpp.
Referenced by getConfigInfo(), and printAllNameValuePairs().
Information about parameters (min, max values etc)
Definition at line 78 of file Config.hpp.
Referenced by Config(), MgmApiSession::getConfig_common(), InitConfigFileParser::run_config_rules(), and ~Config().
1.4.7

