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

Main class for the management server. More...

#include <MgmtSrvr.hpp>

Inheritance diagram for MgmtSrvr:
Collaboration diagram for MgmtSrvr:

Classes

class  Allocated_resources
struct  MgmtOpts
 Options used to control how the management server is started. More...
struct  nodeid_and_host

Public Types

enum  LogMode { In, Out, InOut, Off }

Public Member Functions

 MgmtSrvr (const MgmtSrvr &)
 MgmtSrvr (const MgmtOpts &)
bool init ()
bool start (void)
NodeId getOwnNodeId () const
int status (int nodeId, ndb_mgm_node_status *status, Uint32 *version, Uint32 *mysql_version, Uint32 *phase, bool *systemShutdown, Uint32 *dynamicId, Uint32 *nodeGroup, Uint32 *connectCount, const char **address)
int stopNodes (const Vector< NodeId > &node_ids, int *stopCount, bool abort, bool force, int *stopSelf)
int shutdownMGM (int *stopCount, bool abort, int *stopSelf)
int shutdownDB (int *cnt=0, bool abort=false)
int enterSingleUser (int *cnt=0, Uint32 singleuserNodeId=0)
int exitSingleUser (int *cnt=0, bool abort=false)
int start (int processId)
int restartNodes (const Vector< NodeId > &node_ids, int *stopCount, bool nostart, bool initialStart, bool abort, bool force, int *stopSelf)
int restartDB (bool nostart, bool initialStart, bool abort=false, int *stopCount=0)
int startBackup (Uint32 &backupId, int waitCompleted=2, Uint32 input_backupId=0, Uint32 backuppoint=0)
int abortBackup (Uint32 backupId)
int performBackup (Uint32 *backupId)
int setEventReportingLevelImpl (int processId, const EventSubscribeReq &ll)
int setNodeLogLevelImpl (int processId, const SetLogLevelOrd &ll)
int insertError (int processId, int errorNo)
int setTraceNo (int processId, int traceNo)
int setSignalLoggingMode (int processId, LogMode mode, const Vector< BaseString > &blocks)
int setSignalLoggingMode (int processId, LogMode mode, BaseString &block)
int startSignalTracing (int processId)
int stopSignalTracing (int processId)
int dumpState (int processId, const Uint32 args[], Uint32 argNo)
int dumpState (int processId, const char *args)
bool getNextNodeId (NodeId *_nodeId, enum ndb_mgm_node_type type) const
bool alloc_node_id (NodeId *_nodeId, enum ndb_mgm_node_type type, const struct sockaddr *client_addr, SOCKET_SIZE_TYPE *client_addr_len, int &error_code, BaseString &error_string, int log_event=1, int timeout_s=20)
bool change_config (Config &new_config, BaseString &msg)
const char * getErrorText (int errorCode, char *buf, int buf_sz)
int getPort () const
int setDbParameter (int node, int parameter, const char *value, BaseString &)
int setConnectionDbParameter (int node1, int node2, int param, int value, BaseString &msg)
int getConnectionDbParameter (int node1, int node2, int param, int *value, BaseString &msg)
bool transporter_connect (NDB_SOCKET_TYPE sockfd, BaseString &errormsg)
const char * get_connect_address (Uint32 node_id)
void get_connected_nodes (NodeBitmask &connected_nodes) const
SocketServerget_socket_server ()
void updateStatus ()
int createNodegroup (int *nodes, int count, int *ng)
int dropNodegroup (int ng)
int startSchemaTrans (SignalSender &ss, NodeId &out_nodeId, Uint32 transId, Uint32 &out_transKey)
int endSchemaTrans (SignalSender &ss, NodeId nodeId, Uint32 transId, Uint32 transKey, Uint32 flags)
bool get_packed_config (ndb_mgm_node_type nodetype, BaseString &buf64, BaseString &error)
bool get_packed_config_from_node (NodeId nodeid, BaseString &buf64, BaseString &error)
void print_config (const char *section_filter=NULL, NodeId nodeid_filter=0, const char *param_filter=NULL, NdbOut &out=ndbout)
bool reload_config (const char *config_filename, bool mycnf, BaseString &msg)
void show_variables (NdbOut &out=ndbout)
int find_node_type (unsigned node_id, enum ndb_mgm_node_type type, const struct sockaddr *client_addr, NodeBitmask &nodes, NodeBitmask &exact_nodes, Vector< nodeid_and_host > &nodes_info, int &error_code, BaseString &error_string)
int try_alloc (unsigned id, const char *, enum ndb_mgm_node_type type, const struct sockaddr *client_addr, Uint32 timeout_ms)
const char * get_version_string (void) const
bool request_events (NdbNodeBitmask nodes, Uint32 reports_per_node, Uint32 dump_type, Vector< SimpleSignal > &events)
- Public Member Functions inherited from trp_client
virtual ~trp_client ()
virtual void trp_deliver_signal (const NdbApiSignal *, const LinearSectionPtr ptr[3])=0
Uint32 open (class TransporterFacade *, int blockNo=-1)
void close ()
void start_poll ()
void do_poll (Uint32)
void complete_poll ()
void wakeup ()
void do_forceSend (int val=1)
int raw_sendSignal (const NdbApiSignal *, Uint32 nodeId)
int raw_sendSignal (const NdbApiSignal *, Uint32 nodeId, const LinearSectionPtr ptr[3], Uint32 secs)
int raw_sendSignal (const NdbApiSignal *, Uint32 nodeId, const GenericSectionPtr ptr[3], Uint32 secs)
int raw_sendFragmentedSignal (const NdbApiSignal *, Uint32 nodeId, const LinearSectionPtr ptr[3], Uint32 secs)
int raw_sendFragmentedSignal (const NdbApiSignal *, Uint32 nodeId, const GenericSectionPtr ptr[3], Uint32 secs)
const trp_nodegetNodeInfo (Uint32 i) const
virtual void recordWaitTimeNanos (Uint64 nanos)
void lock ()
void unlock ()
Uint32 getOwnNodeId () const
int safe_sendSignal (const NdbApiSignal *, Uint32 nodeId)

Public Attributes

BaseString m_version_string

Friends

class Allocated_resources
class MgmApiSession
class Ndb_mgmd_event_service

Additional Inherited Members

- Private Member Functions inherited from ConfigSubscriber
virtual void config_changed (NodeId, const class Config *)=0

Detailed Description

Main class for the management server.

Definition at line 75 of file MgmtSrvr.hpp.

Member Enumeration Documentation

This enum specifies the different signal loggig modes possible to set with the setSignalLoggingMode method.

Definition at line 103 of file MgmtSrvr.hpp.

Member Function Documentation

bool MgmtSrvr::alloc_node_id ( NodeId *  _nodeId,
enum ndb_mgm_node_type  type,
const struct sockaddr *  client_addr,
SOCKET_SIZE_TYPE *  client_addr_len,
int &  error_code,
BaseString error_string,
int  log_event = 1,
int  timeout_s = 20 
)

Wait for config to get confirmed before allocating node id

set bit as reserved, release mutex, try-alloc reaquire mutex and clear bit if alloc failed

exact node tried in loop above

set bit as reserved, release mutex, try-alloc reaquire mutex and clear bit if alloc failed

Definition at line 3354 of file MgmtSrvr.cpp.

Here is the call graph for this function:

int MgmtSrvr::dumpState ( int  processId,
const Uint32  args[],
Uint32  argNo 
)

Dump State

In order to make DUMP (almost) syncronous, make a syncronous request after the NDB_TAMPER

Definition at line 2871 of file MgmtSrvr.cpp.

int MgmtSrvr::enterSingleUser ( int *  cnt = 0,
Uint32  singleuserNodeId = 0 
)

Maintenance on the system

Definition at line 1649 of file MgmtSrvr.cpp.

Here is the call graph for this function:

int MgmtSrvr::exitSingleUser ( int *  cnt = 0,
bool  abort = false 
)

Resume from maintenance on the system

Definition at line 1986 of file MgmtSrvr.cpp.

const char * MgmtSrvr::getErrorText ( int  errorCode,
char *  buf,
int  buf_sz 
)

Get error text

Parameters
errorCode,:Error code to get a match error text for.
Returns
The error text.

Definition at line 2907 of file MgmtSrvr.cpp.

bool MgmtSrvr::getNextNodeId ( NodeId *  _nodeId,
enum ndb_mgm_node_type  type 
) const

Get next node id (node id gt than _nodeId) of specified type and save it in _nodeId

Returns
false if none found

Definition at line 3555 of file MgmtSrvr.cpp.

int MgmtSrvr::getPort ( ) const
inline

Returns the port number where MgmApiService is started

Returns
port number.

Definition at line 340 of file MgmtSrvr.hpp.

int MgmtSrvr::insertError ( int  processId,
int  errorNo 
)

Insert an error in a DB process.

Parameters
processId,:Id of the DB process
errorNo,:The error number. > 0.
Returns
0 if succeeded, otherwise: as stated above, plus: INVALID_ERROR_NUMBER

In order to make NDB_TAMPER (almost) syncronous, make a syncronous request after the NDB_TAMPER

Definition at line 2348 of file MgmtSrvr.cpp.

int MgmtSrvr::restartDB ( bool  nostart,
bool  initialStart,
bool  abort = false,
int *  stopCount = 0 
)

Restart all DB nodes

Here all nodes were correctly stopped, so we wait for all nodes to be contactable

Now we start all database nodes (i.e. we make them non-idle) We ignore the result we get from the start command.

Errors from this call are deliberately ignored. Maybe the user only wanted to restart a subset of the nodes. It is also easy for the user to check which nodes have started and which nodes have not.

Definition at line 1909 of file MgmtSrvr.cpp.

Here is the call graph for this function:

int MgmtSrvr::restartNodes ( const Vector< NodeId > &  node_ids,
int *  stopCount,
bool  nostart,
bool  initialStart,
bool  abort,
bool  force,
int *  stopSelf 
)

Restart a list of nodes

Definition at line 1811 of file MgmtSrvr.cpp.

Here is the call graph for this function:

int MgmtSrvr::setDbParameter ( int  node,
int  parameter,
const char *  value,
BaseString msg 
)

Check parameter

Definition at line 3820 of file MgmtSrvr.cpp.

Here is the call graph for this function:

int MgmtSrvr::shutdownDB ( int *  cnt = 0,
bool  abort = false 
)

shutdown the DB nodes

Definition at line 1629 of file MgmtSrvr.cpp.

Here is the call graph for this function:

int MgmtSrvr::start ( int  processId)

Start DB process.

Parameters
processId,:Id of the DB process to start
Returns
0 if succeeded, otherwise: as stated above, plus:

Definition at line 977 of file MgmtSrvr.cpp.

int MgmtSrvr::startBackup ( Uint32 &  backupId,
int  waitCompleted = 2,
Uint32  input_backupId = 0,
Uint32  backuppoint = 0 
)

Backup functionallity

Definition at line 3591 of file MgmtSrvr.cpp.

Here is the call graph for this function:

int MgmtSrvr::status ( int  nodeId,
ndb_mgm_node_status status,
Uint32 *  version,
Uint32 *  mysql_version,
Uint32 *  phase,
bool *  systemShutdown,
Uint32 *  dynamicId,
Uint32 *  nodeGroup,
Uint32 *  connectCount,
const char **  address 
)

Get status on a node. address may point to a common area (e.g. from inet_addr) There is no guarentee that it is preserved across calls. Copy the string if you are not going to use it immediately.

Definition at line 2097 of file MgmtSrvr.cpp.

int MgmtSrvr::stopNodes ( const Vector< NodeId > &  node_ids,
int *  stopCount,
bool  abort,
bool  force,
int *  stopSelf 
)

Stop a list of nodes

Definition at line 1572 of file MgmtSrvr.cpp.

Here is the call graph for this function:

int MgmtSrvr::try_alloc ( unsigned  id,
const char *  config_hostname,
enum ndb_mgm_node_type  type,
const struct sockaddr *  client_addr,
Uint32  timeout_ms 
)

Make sure we're ready to accept connections from this node

Definition at line 3285 of file MgmtSrvr.cpp.

Here is the call graph for this function:


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