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

Public Member Functions | |
| IPCConfig (Properties *props) | |
| ~IPCConfig () | |
| int | init () |
| NodeId | ownId () const |
| int | configureTransporters (class TransporterRegistry *theTransporterRegistry) |
| bool | getNextRemoteNodeId (NodeId &nodeId) const |
| Uint32 | getREPHBFrequency (NodeId id) const |
| const char * | getNodeType (NodeId id) const |
| NodeId | getNoOfRemoteNodes () const |
| void | print () const |
Static Public Member Functions | |
| static Uint32 | configureTransporters (Uint32 nodeId, const struct ndb_mgm_configuration &, class TransporterRegistry &) |
Private Member Functions | |
| bool | addRemoteNodeId (NodeId nodeId) |
Private Attributes | |
| NodeId | the_ownId |
| Properties * | props |
| NodeId | theNoOfRemoteNodes |
| NodeId | theRemoteNodeIds [MAX_NODES] |
Definition at line 29 of file IPCConfig.hpp.
| IPCConfig::IPCConfig | ( | Properties * | props | ) |
Definition at line 36 of file IPCConfig.cpp.
References p, props, the_ownId, and theNoOfRemoteNodes.
00037 { 00038 theNoOfRemoteNodes = 0; 00039 the_ownId = 0; 00040 if(p != 0) 00041 props = new Properties(* p); 00042 else 00043 props = 0; 00044 }
| IPCConfig::~IPCConfig | ( | ) |
Definition at line 104 of file IPCConfig.cpp.
References theNoOfRemoteNodes, and theRemoteNodeIds.
Referenced by init().
00104 { 00105 for(int i = 0; i<theNoOfRemoteNodes; i++) 00106 if(theRemoteNodeIds[i] == nodeId) 00107 return false; 00108 theRemoteNodeIds[theNoOfRemoteNodes] = nodeId; 00109 theNoOfRemoteNodes++; 00110 return true; 00111 }
Here is the caller graph for this function:

| static Uint32 IPCConfig::configureTransporters | ( | Uint32 | nodeId, | |
| const struct ndb_mgm_configuration & | , | |||
| class TransporterRegistry & | ||||
| ) | [static] |
| int IPCConfig::configureTransporters | ( | class TransporterRegistry * | theTransporterRegistry | ) |
Referenced by TransporterFacade::init(), and Configuration::setupConfiguration().
Here is the caller graph for this function:

Supply a nodeId, and get next higher node id
Definition at line 119 of file IPCConfig.cpp.
References MAX_NODES, theNoOfRemoteNodes, and theRemoteNodeIds.
00119 { 00120 NodeId returnNode = MAX_NODES + 1; 00121 for(int i = 0; i<theNoOfRemoteNodes; i++) 00122 if(theRemoteNodeIds[i] > nodeId){ 00123 if(theRemoteNodeIds[i] < returnNode){ 00124 returnNode = theRemoteNodeIds[i]; 00125 } 00126 } 00127 if(returnNode == (MAX_NODES + 1)) 00128 return false; 00129 nodeId = returnNode; 00130 return true; 00131 }
| const char * IPCConfig::getNodeType | ( | NodeId | id | ) | const |
Definition at line 152 of file IPCConfig.cpp.
References DEBUG, Properties::get(), and props.
00152 { 00153 const char * out; 00154 const Properties * tmp; 00155 00156 if (!props->get("Node", id, &tmp) || !tmp->get("Type", &out)) { 00157 DEBUG("Illegal Node or NodeType in config."); 00158 out = "Unknown"; 00159 } 00160 00161 return out; 00162 }
Here is the call graph for this function:

| NodeId IPCConfig::getNoOfRemoteNodes | ( | ) | const [inline] |
Definition at line 55 of file IPCConfig.hpp.
References theNoOfRemoteNodes.
00055 { 00056 return theNoOfRemoteNodes; 00057 }
Definition at line 135 of file IPCConfig.cpp.
References DEBUG, Properties::get(), and props.
00135 { 00136 const Properties * tmp; 00137 Uint32 out; 00138 00142 if (!props->get("Node", id, &tmp) || 00143 !tmp->get("HeartbeatIntervalRepRep", &out)) { 00144 DEBUG("Illegal Node or HeartbeatIntervalRepRep in config."); 00145 out = 10000; 00146 } 00147 00148 return out; 00149 }
Here is the call graph for this function:

| int IPCConfig::init | ( | ) |
Definition at line 55 of file IPCConfig.cpp.
References addRemoteNodeId(), DEBUG, Properties::get(), props, and the_ownId.
00055 { 00056 Uint32 nodeId; 00057 00058 if(props == 0) return -1; 00059 if(!props->get("LocalNodeId", &nodeId)) { 00060 DEBUG( "Did not find local node id." ); 00061 return -1; 00062 } 00063 the_ownId = nodeId; 00064 00065 Uint32 noOfConnections; 00066 if(!props->get("NoOfConnections", &noOfConnections)) { 00067 DEBUG( "Did not find noOfConnections." ); 00068 return -1; 00069 } 00070 00071 for(Uint32 i = 0; i<noOfConnections; i++){ 00072 const Properties * tmp; 00073 Uint32 node1, node2; 00074 00075 if(!props->get("Connection", i, &tmp)) { 00076 DEBUG( "Did not find Connection." ); 00077 return -1; 00078 } 00079 if(!tmp->get("NodeId1", &node1)) { 00080 DEBUG( "Did not find NodeId1." ); 00081 return -1; 00082 } 00083 if(!tmp->get("NodeId2", &node2)) { 00084 DEBUG( "Did not find NodeId2." ); 00085 return -1; 00086 } 00087 00088 if(node1 == the_ownId && node2 != the_ownId) 00089 if(!addRemoteNodeId(node2)) { 00090 DEBUG( "addRemoteNodeId(node2) failed." ); 00091 return -1; 00092 } 00093 00094 if(node1 != the_ownId && node2 == the_ownId) 00095 if(!addRemoteNodeId(node1)) { 00096 DEBUG( "addRemoteNodeId(node2) failed." ); 00097 return -1; 00098 } 00099 } 00100 return 0; 00101 }
Here is the call graph for this function:

| NodeId IPCConfig::ownId | ( | ) | const [inline] |
Definition at line 76 of file IPCConfig.hpp.
References the_ownId.
00077 { 00078 return the_ownId; 00079 }
| void IPCConfig::print | ( | ) | const [inline] |
Definition at line 59 of file IPCConfig.hpp.
References Properties::print(), and props.
Here is the call graph for this function:

Properties* IPCConfig::props [private] |
Definition at line 67 of file IPCConfig.hpp.
Referenced by getNodeType(), getREPHBFrequency(), init(), IPCConfig(), print(), and ~IPCConfig().
NodeId IPCConfig::the_ownId [private] |
NodeId IPCConfig::theNoOfRemoteNodes [private] |
Definition at line 70 of file IPCConfig.hpp.
Referenced by addRemoteNodeId(), getNextRemoteNodeId(), getNoOfRemoteNodes(), and IPCConfig().
NodeId IPCConfig::theRemoteNodeIds[MAX_NODES] [private] |
Definition at line 71 of file IPCConfig.hpp.
Referenced by addRemoteNodeId(), and getNextRemoteNodeId().
1.4.7

