Commit 192d562b authored by unknown's avatar unknown

ndb config ability/naming changes, see respective file


mysql-test/ndb/ndb_config_2_node.ini:
  using new naming capabilities
ndb/src/common/mgmcommon/ConfigInfo.cpp:
  fixes case insensitive
  + removed abort from config handling
ndb/src/common/mgmcommon/InitConfigFileParser.cpp:
  fixed alias handling
  some requires in config handling
ndb/src/mgmclient/CommandInterpreter.cpp:
  new printout to reflect new naming in config
parent f08215e9
[DB DEFAULT]
NoOfReplicas: 2
MaxNoOfConcurrentOperations: CHOOSE_MaxNoOfConcurrentOperations
DataMemory: CHOOSE_DataMemory
IndexMemory: CHOOSE_IndexMemory
Diskless: CHOOSE_Diskless
TimeBetweenWatchDogCheck: 30000
FileSystemPath: CHOOSE_FILESYSTEM
[ndbd default]
NoOfReplicas= 2
MaxNoOfConcurrentOperations= CHOOSE_MaxNoOfConcurrentOperations
DataMemory= CHOOSE_DataMemory
IndexMemory= CHOOSE_IndexMemory
Diskless= CHOOSE_Diskless
TimeBetweenWatchDogCheck= 30000
FileSystemPath= CHOOSE_FILESYSTEM
[COMPUTER]
Id: 1
HostName: CHOOSE_HOSTNAME_1
[computer]
Id= 1
HostName= CHOOSE_HOSTNAME_1
[COMPUTER]
Id: 2
HostName: CHOOSE_HOSTNAME_2
[computer]
Id= 2
HostName= CHOOSE_HOSTNAME_2
[DB]
ExecuteOnComputer: 1
[ndbd]
ExecuteOnComputer= 1
[DB]
ExecuteOnComputer: 2
[ndbd]
ExecuteOnComputer= 2
[MGM]
PortNumber: CHOOSE_PORT_MGM
[ndb_mgmd]
PortNumber= CHOOSE_PORT_MGM
[MYSQLD]
[mysqld]
[MYSQLD]
[mysqld]
[MYSQLD]
[mysqld]
[MYSQLD]
[mysqld]
[TCP DEFAULT]
PortNumber: CHOOSE_PORT_TRANSPORTER
[tcp default]
PortNumber= CHOOSE_PORT_TRANSPORTER
......@@ -1989,7 +1989,8 @@ const Properties *
ConfigInfo::getInfo(const char * section) const {
const Properties * p;
if(!m_info.get(section, &p)){
warning("getInfo", section);
return 0;
// warning("getInfo", section);
}
return p;
}
......@@ -1998,7 +1999,8 @@ const Properties *
ConfigInfo::getDefaults(const char * section) const {
const Properties * p;
if(!m_systemDefaults.get(section, &p)){
warning("getDefaults", section);
return 0;
//warning("getDefaults", section);
}
return p;
}
......@@ -2072,7 +2074,7 @@ ConfigInfo::isSection(const char * section) const {
const char*
ConfigInfo::getAlias(const char * section) const {
for (int i = 0; m_sectionNameAliases[i].name != 0; i++)
if(!strcmp(section, m_sectionNameAliases[i].alias))
if(!strcasecmp(section, m_sectionNameAliases[i].alias))
return m_sectionNameAliases[i].name;
return 0;
}
......
......@@ -117,8 +117,8 @@ InitConfigFileParser::parseConfig(FILE * file) {
ctx.m_sectionLineno = ctx.m_lineno;
ctx.m_currentSection = new Properties(true);
ctx.m_userDefaults = NULL;
ctx.m_currentInfo = m_info->getInfo(ctx.fname);
ctx.m_systemDefaults = m_info->getDefaults(ctx.fname);
require((ctx.m_currentInfo = m_info->getInfo(ctx.fname)) != 0);
require((ctx.m_systemDefaults = m_info->getDefaults(ctx.fname)) != 0);
continue;
}
......@@ -139,8 +139,8 @@ InitConfigFileParser::parseConfig(FILE * file) {
ctx.m_sectionLineno = ctx.m_lineno;
ctx.m_currentSection = new Properties(true);
ctx.m_userDefaults = getSection(ctx.fname, ctx.m_defaults);
ctx.m_currentInfo = m_info->getInfo(ctx.fname);
ctx.m_systemDefaults = m_info->getDefaults(ctx.fname);
require((ctx.m_currentInfo = m_info->getInfo(ctx.fname)) != 0);
require((ctx.m_systemDefaults = m_info->getDefaults(ctx.fname)) != 0);
continue;
}
......@@ -180,8 +180,8 @@ InitConfigFileParser::parseConfig(FILE * file) {
ctx.type = InitConfigFileParser::Section;
ctx.m_currentSection = tmp[j].m_sectionData;
ctx.m_userDefaults = getSection(ctx.fname, ctx.m_defaults);
ctx.m_currentInfo = m_info->getInfo(ctx.fname);
ctx.m_systemDefaults = m_info->getDefaults(ctx.fname);
require((ctx.m_currentInfo = m_info->getInfo(ctx.fname)) != 0);
require((ctx.m_systemDefaults = m_info->getDefaults(ctx.fname)) != 0);
if(!storeSection(ctx))
return 0;
}
......@@ -516,7 +516,7 @@ char*
InitConfigFileParser::parseDefaultSectionHeader(const char* line) const {
static char token1[MAX_LINE_LENGTH], token2[MAX_LINE_LENGTH];
int no = sscanf(line, "[%120[A-Za-z] %120[A-Za-z]]", token1, token2);
int no = sscanf(line, "[%120[A-Z_a-z] %120[A-Z_a-z]]", token1, token2);
// Not correct no of tokens
if (no != 2) return NULL;
......@@ -524,8 +524,12 @@ InitConfigFileParser::parseDefaultSectionHeader(const char* line) const {
// Not correct keyword at end
if (!strcasecmp(token2, "DEFAULT") == 0) return NULL;
if(m_info->getInfo(token1)){
return strdup(token1);
const char *token1_alias= m_info->getAlias(token1);
if (token1_alias == 0)
token1_alias= token1;
if(m_info->getInfo(token1_alias)){
return strdup(token1_alias);
}
// Did not find section
......
......@@ -682,12 +682,12 @@ CommandInterpreter::executeShow(char* parameters)
}
ndbout << ndb_nodes
<< " NDB Node(s)"
<< " [ndbd] node(s)"
<< endl;
for(i=0; i < state->no_of_nodes; i++) {
if(state->node_states[i].node_type == NDB_MGM_NODE_TYPE_NDB) {
ndbout << "DB node:\t" << state->node_states[i].node_id;
ndbout << "[ndbd]\t\tid=" << state->node_states[i].node_id;
if(state->node_states[i].version != 0) {
ndbout << " (Version: "
<< getMajor(state->node_states[i].version) << "."
......@@ -707,12 +707,12 @@ CommandInterpreter::executeShow(char* parameters)
ndbout << endl;
ndbout << mgm_nodes
<< " MGM Node(s)"
<< " [ndb_mgmd] node(s)"
<< endl;
for(i=0; i < state->no_of_nodes; i++) {
if(state->node_states[i].node_type == NDB_MGM_NODE_TYPE_MGM) {
ndbout << "MGM node:\t" << state->node_states[i].node_id;
ndbout << "[ndb_mgmd]\tid=" << state->node_states[i].node_id;
if(state->node_states[i].version != 0) {
ndbout << " (Version: "
<< getMajor(state->node_states[i].version) << "."
......@@ -728,12 +728,12 @@ CommandInterpreter::executeShow(char* parameters)
ndbout << endl;
ndbout << api_nodes
<< " API Node(s)"
<< " [mysqld] node(s)"
<< endl;
for(i=0; i < state->no_of_nodes; i++) {
if(state->node_states[i].node_type == NDB_MGM_NODE_TYPE_API) {
ndbout << "API node:\t" << state->node_states[i].node_id;
ndbout << "[mysqld]\tid=" << state->node_states[i].node_id;
if(state->node_states[i].version != 0) {
ndbout << " (Version: "
<< getMajor(state->node_states[i].version) << "."
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment