#include <ndb_global.h>#include <NdbMain.h>#include <mgmapi.h>#include <ConfigRetriever.hpp>#include <Properties.hpp>#include <NdbOut.hpp>Include dependency graph for printConfig.cpp:

Go to the source code of this file.
Functions | |
| void | usage (const char *prg) |
| NDB_COMMAND (printConfig,"printConfig","printConfig","Prints configuration", 16384) | |
| NDB_COMMAND | ( | printConfig | , | |
| "printConfig" | , | |||
| "printConfig" | , | |||
| "Prints configuration" | , | |||
| 16384 | ||||
| ) |
Definition at line 38 of file printConfig.cpp.
References atoi(), free, ConfigRetriever::getConfig(), ConfigRetriever::getErrorString(), ndbout(), p, strcmp(), and usage().
00039 { 00040 if(argc < 4){ 00041 usage(argv[0]); 00042 return 0; 00043 } 00044 if(strcmp("file", argv[1]) != 0 && strcmp("host", argv[1]) != 0){ 00045 usage(argv[0]); 00046 return 0; 00047 } 00048 00049 if(strcmp("host", argv[1]) == 0 && argc < 5){ 00050 usage(argv[0]); 00051 return 0; 00052 } 00053 00054 ConfigRetriever c; 00055 struct ndb_mgm_configuration * p = 0; 00056 00057 if(strcmp("host", argv[1]) == 0){ 00058 int verId = 0; 00059 if(argc > 5) 00060 verId = atoi(argv[5]); 00061 00062 ndbout << "Getting config from: " << argv[2] << ":" << atoi(argv[3]) 00063 << " NodeId =" << atoi(argv[4]) 00064 << " VersionId = " << verId << endl; 00065 00066 p = c.getConfig(argv[2], 00067 atoi(argv[3]), 00068 verId); 00069 } else if (strcmp("file", argv[1]) == 0){ 00070 int verId = 0; 00071 if(argc > 4) 00072 verId = atoi(argv[4]); 00073 00074 ndbout << "Getting config from: " << argv[2] 00075 << " NodeId =" << atoi(argv[3]) 00076 << " VersionId = " << verId << endl; 00077 00078 p = c.getConfig(argv[2], atoi(argv[3]), verId); 00079 } 00080 00081 if(p != 0){ 00082 // 00083 free(p); 00084 } else { 00085 ndbout << "Configuration not found: " << c.getErrorString() << endl; 00086 } 00087 00088 return 0; 00089 }
Here is the call graph for this function:

| void usage | ( | const char * | prg | ) |
Definition at line 26 of file printConfig.cpp.
00026 { 00027 ndbout << "Usage " << prg 00028 << " host <mgm host> <mgm port> <node id> [<ver id>]" << endl; 00029 00030 char buf[255]; 00031 for(unsigned i = 0; i<strlen(prg); i++) 00032 buf[i] = ' '; 00033 buf[strlen(prg)] = 0; 00034 ndbout << " " << buf << " file <filename> <node id> [<ver id>]" 00035 << endl; 00036 }
1.4.7

