#include <ndb_global.h>#include <ctype.h>#include <uucode.h>#include <socket_io.h>#include <ndb_version.h>#include <mgmapi.h>#include <EventLogger.hpp>#include <signaldata/SetLogLevelOrd.hpp>#include <LogLevel.hpp>#include <BaseString.hpp>#include <ConfigValues.hpp>#include <mgmapi_configuration.hpp>#include <Vector.hpp>#include "Services.hpp"#include "../mgmapi/ndb_logevent.hpp"#include <base64.h>Include dependency graph for Services.cpp:

Go to the source code of this file.
Classes | |
| struct | PurgeStruct |
Defines | |
| #define | MGM_CMD(name, fun, desc) |
| #define | MGM_ARG(name, type, opt, desc) |
| #define | MGM_ARG2(name, type, opt, min, max, desc) |
| #define | MGM_END() |
| #define | MGM_CMD_ALIAS(name, realName, fun) |
| #define | MGM_ARG_ALIAS(name, realName, fun) |
Functions | |
| static Properties * | backward (const char *base, const Properties *reply) |
| static void | printNodeStatus (OutputStream *output, MgmtSrvr &mgmsrv, enum ndb_mgm_node_type type) |
| static NdbOut & | operator<< (NdbOut &out, const LogLevel &ll) |
Variables | |
| bool | g_StopServer |
| bool | g_RestartServer |
| EventLogger | g_eventLogger |
| static const unsigned int | MAX_READ_TIMEOUT = 1000 |
| static const unsigned int | MAX_WRITE_TIMEOUT = 100 |
| const ParserRow< MgmApiSession > | commands [] |
| #define MGM_ARG | ( | name, | |||
| type, | |||||
| opt, | |||||
| desc | ) |
Value:
{ name, \
0, \
ParserRow<MgmApiSession>::Arg, \
ParserRow<MgmApiSession>::type, \
ParserRow<MgmApiSession>::opt, \
ParserRow<MgmApiSession>::IgnoreMinMax, \
0, 0, \
0, \
desc, 0 }
Definition at line 68 of file Services.cpp.
| #define MGM_ARG2 | ( | name, | |||
| type, | |||||
| opt, | |||||
| min, | |||||
| max, | |||||
| desc | ) |
Value:
{ name, \
0, \
ParserRow<MgmApiSession>::Arg, \
ParserRow<MgmApiSession>::type, \
ParserRow<MgmApiSession>::opt, \
ParserRow<MgmApiSession>::IgnoreMinMax, \
min, max, \
0, \
desc, 0 }
Definition at line 79 of file Services.cpp.
| #define MGM_ARG_ALIAS | ( | name, | |||
| realName, | |||||
| fun | ) |
Value:
{ name, \
realName, \
ParserRow<MgmApiSession>::ArgAlias, \
ParserRow<MgmApiSession>::Int, \
ParserRow<MgmApiSession>::Optional, \
ParserRow<MgmApiSession>::IgnoreMinMax, \
0, 0, \
0, \
0, 0 }
Definition at line 112 of file Services.cpp.
| #define MGM_CMD | ( | name, | |||
| fun, | |||||
| desc | ) |
Value:
{ name, \
0, \
ParserRow<MgmApiSession>::Cmd, \
ParserRow<MgmApiSession>::String, \
ParserRow<MgmApiSession>::Optional, \
ParserRow<MgmApiSession>::IgnoreMinMax, \
0, 0, \
fun, \
desc, 0 }
Definition at line 57 of file Services.cpp.
| #define MGM_CMD_ALIAS | ( | name, | |||
| realName, | |||||
| fun | ) |
Value:
{ name, \
realName, \
ParserRow<MgmApiSession>::CmdAlias, \
ParserRow<MgmApiSession>::Int, \
ParserRow<MgmApiSession>::Optional, \
ParserRow<MgmApiSession>::IgnoreMinMax, \
0, 0, \
0, \
0, 0 }
Definition at line 101 of file Services.cpp.
| #define MGM_END | ( | ) |
Value:
{ 0, \
0, \
ParserRow<MgmApiSession>::Arg, \
ParserRow<MgmApiSession>::Int, \
ParserRow<MgmApiSession>::Optional, \
ParserRow<MgmApiSession>::IgnoreMinMax, \
0, 0, \
0, \
0, 0 }
Definition at line 90 of file Services.cpp.
| static Properties* backward | ( | const char * | base, | |
| const Properties * | reply | |||
| ) | [static] |
Definition at line 386 of file Services.cpp.
References Properties::Iterator::first(), Properties::get(), Properties::getTypeOf(), name, Properties::Iterator::next(), PropertiesType_char, PropertiesType_Properties, PropertiesType_Uint32, PropertiesType_Uint64, Properties::put(), recurse(), and strcmp().
Referenced by MgmApiSession::getConfig_common().
00386 { 00387 Properties * ret = new Properties(); 00388 Properties::Iterator it(reply); 00389 for(const char * name = it.first(); name != 0; name=it.next()){ 00390 PropertiesType type; 00391 reply->getTypeOf(name, &type); 00392 switch(type){ 00393 case PropertiesType_Uint32:{ 00394 Uint32 val; 00395 reply->get(name, &val); 00396 ret->put(name, val); 00397 } 00398 break; 00399 case PropertiesType_char: 00400 { 00401 const char * val; 00402 reply->get(name, &val); 00403 ret->put(name, val); 00404 if(!strcmp(name, "Type") && !strcmp(val, "DB")){ 00405 ret->put("NoOfDiskBufferPages", (unsigned)0); 00406 ret->put("NoOfDiskFiles", (unsigned)0); 00407 ret->put("NoOfDiskClusters", (unsigned)0); 00408 ret->put("NoOfFreeDiskClusters", (unsigned)0); 00409 ret->put("NoOfDiskClustersPerDiskFile", (unsigned)0); 00410 ret->put("NoOfConcurrentCheckpointsDuringRestart", (unsigned)1); 00411 ret->put("NoOfConcurrentCheckpointsAfterRestart", (unsigned)1); 00412 ret->put("NoOfConcurrentProcessesHandleTakeover", (unsigned)1); 00413 } 00414 } 00415 break; 00416 case PropertiesType_Properties: 00417 { 00418 const Properties * recurse; 00419 reply->get(name, &recurse); 00420 Properties * val = backward(name, recurse); 00421 ret->put(name, val); 00422 } 00423 break; 00424 case PropertiesType_Uint64: 00425 break; 00426 } 00427 } 00428 return ret; 00429 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static NdbOut& operator<< | ( | NdbOut & | out, | |
| const LogLevel & | ll | |||
| ) | [static] |
Definition at line 1278 of file Services.cpp.
References LogLevel::getLogLevel().
01279 { 01280 out << "[LogLevel: "; 01281 for(size_t i = 0; i<LogLevel::LOGLEVEL_CATEGORIES; i++) 01282 out << ll.getLogLevel((LogLevel::EventCategory)i) << " "; 01283 out << "]"; 01284 return out; 01285 }
Here is the call graph for this function:

| static void printNodeStatus | ( | OutputStream * | output, | |
| MgmtSrvr & | mgmsrv, | |||
| enum ndb_mgm_node_type | type | |||
| ) | [static] |
Definition at line 971 of file Services.cpp.
References MgmtSrvr::getNextNodeId(), ndb_mgm_get_node_status_string(), ndb_mgm_get_node_type_string(), NULL, OutputStream::println(), MgmtSrvr::status(), and status.
00973 { 00974 NodeId nodeId = 0; 00975 while(mgmsrv.getNextNodeId(&nodeId, type)) { 00976 enum ndb_mgm_node_status status; 00977 Uint32 startPhase = 0, 00978 version = 0, 00979 dynamicId = 0, 00980 nodeGroup = 0, 00981 connectCount = 0; 00982 bool system; 00983 const char *address= NULL; 00984 mgmsrv.status(nodeId, &status, &version, &startPhase, 00985 &system, &dynamicId, &nodeGroup, &connectCount, 00986 &address); 00987 output->println("node.%d.type: %s", 00988 nodeId, 00989 ndb_mgm_get_node_type_string(type)); 00990 output->println("node.%d.status: %s", 00991 nodeId, 00992 ndb_mgm_get_node_status_string(status)); 00993 output->println("node.%d.version: %d", nodeId, version); 00994 output->println("node.%d.startphase: %d", nodeId, startPhase); 00995 output->println("node.%d.dynamic_id: %d", nodeId, dynamicId); 00996 output->println("node.%d.node_group: %d", nodeId, nodeGroup); 00997 output->println("node.%d.connect_count: %d", nodeId, connectCount); 00998 output->println("node.%d.address: %s", nodeId, address ? address : ""); 00999 } 01000 01001 }
Here is the call graph for this function:

| const ParserRow<MgmApiSession> commands[] |
Definition at line 124 of file Services.cpp.
Global variables
Definition at line 134 of file main.cpp.
Referenced by main(), and MgmApiSession::~MgmApiSession().
const unsigned int MAX_READ_TIMEOUT = 1000 [static] |
Definition at line 41 of file Services.cpp.
const unsigned int MAX_WRITE_TIMEOUT = 100 [static] |
Definition at line 42 of file Services.cpp.
Referenced by Ndb_mgmd_event_service::check_listeners(), MgmApiSession::getConfig_common(), and Ndb_mgmd_event_service::log().
1.4.7

