MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ConfigRetriever Class Reference

Used by nodes (DB, MGM, API) to get their config from MGM server. More...

#include <ConfigRetriever.hpp>

Public Member Functions

 ConfigRetriever (const char *_connect_string, int force_nodeid, Uint32 version, ndb_mgm_node_type nodeType, const char *_bind_address=0, int timeout_ms=30000)
int do_connect (int no_retries, int retry_delay_in_seconds, int verbose)
int disconnect ()
bool is_connected ()
struct ndb_mgm_configurationgetConfig (Uint32 nodeid)
void resetError ()
int hasError ()
const char * getErrorString ()
Uint32 allocNodeId (int no_retries, int retry_delay_in_seconds)
int setNodeId (Uint32 nodeid)
struct ndb_mgm_configurationgetConfig (NdbMgmHandle handle)
struct ndb_mgm_configurationgetConfig (const char *file)
bool verifyConfig (const struct ndb_mgm_configuration *, Uint32 nodeid)
Uint32 get_mgmd_port () const
const char * get_mgmd_host () const
const char * get_connectstring (char *buf, int buf_sz) const
NdbMgmHandle get_mgmHandle ()
NdbMgmHandleget_mgmHandlePtr ()
void end_session (bool end)
Uint32 get_configuration_nodeid () const

Detailed Description

Used by nodes (DB, MGM, API) to get their config from MGM server.

Definition at line 29 of file ConfigRetriever.hpp.

Member Function Documentation

Uint32 ConfigRetriever::allocNodeId ( int  no_retries,
int  retry_delay_in_seconds 
)
Returns
Node id of this node (as stated in local config or connectString)

Definition at line 369 of file ConfigRetriever.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

struct ndb_mgm_configuration * ConfigRetriever::getConfig ( Uint32  nodeid)
read

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 to establish a connection. This is repeated until a connection is established, so the function hangs until a connection is established.

Returns
ndb_mgm_configuration object if succeeded, NULL if erroneous local config file or configuration error.

Definition at line 152 of file ConfigRetriever.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

ndb_mgm_configuration * ConfigRetriever::getConfig ( NdbMgmHandle  handle)
read

Get config using socket

Definition at line 171 of file ConfigRetriever.cpp.

Here is the call graph for this function:

ndb_mgm_configuration * ConfigRetriever::getConfig ( const char *  file)
read

Get config from file

Definition at line 191 of file ConfigRetriever.cpp.

Here is the call graph for this function:

bool ConfigRetriever::verifyConfig ( const struct ndb_mgm_configuration conf,
Uint32  nodeid 
)

Verify config

Check hostnames

Definition at line 262 of file ConfigRetriever.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: