diff options
Diffstat (limited to 'ndb/src/ndbapi/ClusterMgr.hpp')
-rw-r--r-- | ndb/src/ndbapi/ClusterMgr.hpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ndb/src/ndbapi/ClusterMgr.hpp b/ndb/src/ndbapi/ClusterMgr.hpp index cc3cf66c8aa..d75b820e9cb 100644 --- a/ndb/src/ndbapi/ClusterMgr.hpp +++ b/ndb/src/ndbapi/ClusterMgr.hpp @@ -80,6 +80,7 @@ public: Uint32 getNoOfConnectedNodes() const; private: + Uint32 noOfAliveNodes; Uint32 noOfConnectedNodes; Node theNodes[MAX_NODES]; NdbThread* theClusterMgrThread; @@ -100,6 +101,19 @@ private: void execAPI_REGREF (const Uint32 * theData); void execNODE_FAILREP (const Uint32 * theData); void execNF_COMPLETEREP(const Uint32 * theData); + + inline void set_node_alive(Node& node, bool alive){ + if(node.m_alive && !alive) + { + assert(noOfAliveNodes); + noOfAliveNodes--; + } + else if(!node.m_alive && alive) + { + noOfAliveNodes++; + } + node.m_alive = alive; + } }; inline |