diff options
Diffstat (limited to 'storage/ndb/include/mgmcommon/IPCConfig.hpp')
-rw-r--r-- | storage/ndb/include/mgmcommon/IPCConfig.hpp | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/storage/ndb/include/mgmcommon/IPCConfig.hpp b/storage/ndb/include/mgmcommon/IPCConfig.hpp new file mode 100644 index 00000000000..1e23cdf9807 --- /dev/null +++ b/storage/ndb/include/mgmcommon/IPCConfig.hpp @@ -0,0 +1,83 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef IPCConfig_H +#define IPCConfig_H + +#include <ndb_types.h> +#include <ndb_limits.h> +#include <kernel_types.h> +#include <Properties.hpp> + +/** + * @class IPCConfig + * @brief Config transporters in TransporterRegistry using Properties config + */ +class IPCConfig +{ +public: + IPCConfig(Properties * props); + ~IPCConfig(); + + /** @return 0 for OK */ + int init(); + + NodeId ownId() const; + + /** @return No of transporters configured */ + int configureTransporters(class TransporterRegistry * theTransporterRegistry); + + /** + * Supply a nodeId, + * and get next higher node id + * @return false if none found, true otherwise + * + * getREPHBFrequency and getNodeType uses the last Id supplied to + * getNextRemoteNodeId. + */ + bool getNextRemoteNodeId(NodeId & nodeId) const; + Uint32 getREPHBFrequency(NodeId id) const; + const char* getNodeType(NodeId id) const; + + NodeId getNoOfRemoteNodes() const { + return theNoOfRemoteNodes; + } + + void print() const { props->print(); } + + static Uint32 configureTransporters(Uint32 nodeId, + const struct ndb_mgm_configuration &, + class TransporterRegistry &); + +private: + NodeId the_ownId; + Properties * props; + + bool addRemoteNodeId(NodeId nodeId); + NodeId theNoOfRemoteNodes; + NodeId theRemoteNodeIds[MAX_NODES]; +}; + +inline +NodeId +IPCConfig::ownId() const +{ + return the_ownId; +} + + + +#endif // IPCConfig_H |