diff options
Diffstat (limited to 'ndb/include/mgmcommon/ConfigRetriever.hpp')
-rw-r--r-- | ndb/include/mgmcommon/ConfigRetriever.hpp | 46 |
1 files changed, 16 insertions, 30 deletions
diff --git a/ndb/include/mgmcommon/ConfigRetriever.hpp b/ndb/include/mgmcommon/ConfigRetriever.hpp index 396ce24308c..6c32255e921 100644 --- a/ndb/include/mgmcommon/ConfigRetriever.hpp +++ b/ndb/include/mgmcommon/ConfigRetriever.hpp @@ -28,19 +28,13 @@ */ class ConfigRetriever { public: - ConfigRetriever(Uint32 version, Uint32 nodeType); + ConfigRetriever(LocalConfig &local_config, Uint32 version, Uint32 nodeType); ~ConfigRetriever(); - /** - * Read local config - * @return Own node id, -1 means fail - */ - int init(); - - int do_connect(); + int do_connect(int exit_on_connect_failure= false); /** - * Get configuration for current (nodeId given in local config file) node. + * Get configuration for current node. * * Configuration is fetched from one MGM server configured in local config * file. The method loops over all the configured MGM servers and tries @@ -55,16 +49,6 @@ public: const char * getErrorString(); /** - * Sets connectstring which can be used instead of local config file - */ - void setConnectString(const char * connectString); - - /** - * Sets name of local config file (usually not needed) - */ - void setLocalConfigFileName(const char * connectString); - - /** * @return Node id of this node (as stated in local config or connectString) */ Uint32 allocNodeId(); @@ -78,6 +62,14 @@ public: * Get config from file */ struct ndb_mgm_configuration * getConfig(const char * file); + + /** + * Verify config + */ + bool verifyConfig(const struct ndb_mgm_configuration *, Uint32 nodeid); + + Uint32 get_mgmd_port() const {return m_mgmd_port;}; + const char *get_mgmd_host() const {return m_mgmd_host;}; private: BaseString errorString; enum ErrorType { @@ -88,20 +80,14 @@ private: void setError(ErrorType, const char * errorMsg); - BaseString _localConfigFileName; - struct LocalConfig _localConfig; - int _ownNodeId; - - BaseString m_connectString; - + struct LocalConfig& _localConfig; + Uint32 _ownNodeId; + Uint32 m_mgmd_port; + const char *m_mgmd_host; + Uint32 m_version; Uint32 m_node_type; NdbMgmHandle m_handle; - - /** - * Verify config - */ - bool verifyConfig(const struct ndb_mgm_configuration *); }; #endif |