1
/* Copyright (C) 2003 MySQL AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
16
#ifndef NDBT_RESTARTER_HPP
17
#define NDBT_RESTARTER_HPP
21
#include <BaseString.hpp>
25
NdbRestarter(const char* _addr = 0);
28
int getDbNodeId(int _i);
36
int restartOneDbNode(int _nodeId,
41
int restartOneDbNode2(int _nodeId, Uint32 flags){
42
return restartOneDbNode(_nodeId,
48
int restartAll(bool initial = false,
52
int restartAll2(Uint32 flags){
53
return restartAll(flags & NRRF_INITIAL,
59
int startNodes(const int * _nodes, int _num_nodes);
60
int waitClusterStarted(unsigned int _timeout = 120);
61
int waitClusterSingleUser(unsigned int _timeout = 120);
62
int waitClusterStartPhase(int _startphase, unsigned int _timeout = 120);
63
int waitClusterNoStart(unsigned int _timeout = 120);
64
int waitNodesStarted(const int * _nodes, int _num_nodes,
65
unsigned int _timeout = 120);
66
int waitNodesStartPhase(const int * _nodes, int _num_nodes,
67
int _startphase, unsigned int _timeout = 120);
68
int waitNodesNoStart(const int * _nodes, int _num_nodes,
69
unsigned int _timeout = 120);
73
int insertErrorInNode(int _nodeId, int error);
74
int insertErrorInAllNodes(int error);
76
int enterSingleUserMode(int _nodeId);
77
int exitSingleUserMode();
79
int dumpStateOneNode(int _nodeId, const int * _args, int _num_args);
80
int dumpStateAllNodes(const int * _args, int _num_args);
82
int getMasterNodeId();
83
int getNextMasterNodeId(int nodeId);
84
int getNodeGroup(int nodeId);
85
int getRandomNodeSameNodeGroup(int nodeId, int randomNumber);
86
int getRandomNodeOtherNodeGroup(int nodeId, int randomNumber);
87
int getRandomNotMasterNodeId(int randomNumber);
93
int waitClusterState(ndb_mgm_node_status _status,
94
unsigned int _timeout,
95
int _startphase = -1);
97
int waitNodesState(const int * _nodes, int _num_nodes,
98
ndb_mgm_node_status _status,
99
unsigned int _timeout,
100
int _startphase = -1);
107
Vector<ndb_mgm_node_state> mgmNodes;
108
Vector<ndb_mgm_node_state> apiNodes;
112
ndb_mgm_configuration * m_config;
114
ndb_mgm_configuration * getConfig();
117
Vector<ndb_mgm_node_state> ndbNodes;