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 Configuration_H
17
#define Configuration_H
19
#include <util/BaseString.hpp>
21
#include <ndb_types.h>
23
class ConfigRetriever;
31
* Returns false if arguments are invalid
33
bool init(int argc, char** argv);
35
void fetch_configuration();
36
void setupConfiguration();
37
void closeConfiguration(bool end_session= true);
39
Uint32 lockPagesInMainMemory() const;
41
int timeBetweenWatchDogCheck() const ;
42
void timeBetweenWatchDogCheck(int value);
44
int maxNoOfErrorLogs() const ;
45
void maxNoOfErrorLogs(int val);
47
bool stopOnError() const;
48
void stopOnError(bool val);
50
int getRestartOnErrorInsert() const;
51
void setRestartOnErrorInsert(int);
53
// Cluster configuration
54
const char * programName() const;
55
const char * fileSystemPath() const;
56
const char * backupFilePath() const;
57
const char * getConnectString() const;
58
char * getConnectStringCopy() const;
63
bool getInitialStart() const;
64
void setInitialStart(bool val);
65
bool getDaemonMode() const;
66
bool getForegroundMode() const;
68
const ndb_mgm_configuration_iterator * getOwnConfigIterator() const;
70
Uint32 get_mgmd_port() const {return m_mgmd_port;};
71
const char *get_mgmd_host() const {return m_mgmd_host.c_str();};
72
ConfigRetriever* get_config_retriever() { return m_config_retriever; };
74
class LogLevel * m_logLevel;
78
friend int reportShutdown(class Configuration *config, int error, int restart);
80
ndb_mgm_configuration_iterator * getClusterConfigIterator() const;
83
Uint32 m_restartOnErrorInsert;
85
Uint32 _lockPagesInMainMemory;
86
Uint32 _timeBetweenWatchDogCheck;
87
Uint32 _timeBetweenWatchDogCheckInitial;
89
ndb_mgm_configuration * m_ownConfig;
90
ndb_mgm_configuration * m_clusterConfig;
92
ndb_mgm_configuration_iterator * m_clusterConfigIter;
93
ndb_mgm_configuration_iterator * m_ownConfigIterator;
95
ConfigRetriever *m_config_retriever;
97
Vector<BaseString> m_mgmds;
100
* arguments to NDB process
106
char * _connectString;
108
BaseString m_mgmd_host;
109
bool _daemonMode; // if not, angel in foreground
110
bool _foregroundMode; // no angel, raw ndbd in foreground
112
void calcSizeAlt(class ConfigValues * );
117
Configuration::programName() const {
123
Configuration::fileSystemPath() const {
129
Configuration::backupFilePath() const {
135
Configuration::getInitialStart() const {
136
return _initialStart;
141
Configuration::getDaemonMode() const {
147
Configuration::getForegroundMode() const {
148
return _foregroundMode;