~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to storage/ndb/src/kernel/vm/Configuration.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2003 MySQL AB
 
2
 
 
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.
 
6
 
 
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.
 
11
 
 
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 */
 
15
 
 
16
#ifndef Configuration_H
 
17
#define Configuration_H
 
18
 
 
19
#include <util/BaseString.hpp>
 
20
#include <mgmapi.h>
 
21
#include <ndb_types.h>
 
22
 
 
23
class ConfigRetriever;
 
24
 
 
25
class Configuration {
 
26
public:
 
27
  Configuration();
 
28
  ~Configuration();
 
29
 
 
30
  /**
 
31
   * Returns false if arguments are invalid
 
32
   */
 
33
  bool init(int argc, char** argv);
 
34
 
 
35
  void fetch_configuration();
 
36
  void setupConfiguration();
 
37
  void closeConfiguration(bool end_session= true);
 
38
  
 
39
  Uint32 lockPagesInMainMemory() const;
 
40
  
 
41
  int timeBetweenWatchDogCheck() const ;
 
42
  void timeBetweenWatchDogCheck(int value);
 
43
  
 
44
  int maxNoOfErrorLogs() const ;
 
45
  void maxNoOfErrorLogs(int val);
 
46
 
 
47
  bool stopOnError() const;
 
48
  void stopOnError(bool val);
 
49
  
 
50
  int getRestartOnErrorInsert() const;
 
51
  void setRestartOnErrorInsert(int);
 
52
  
 
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;
 
59
 
 
60
  /**
 
61
   * 
 
62
   */
 
63
  bool getInitialStart() const;
 
64
  void setInitialStart(bool val);
 
65
  bool getDaemonMode() const;
 
66
  bool getForegroundMode() const;
 
67
 
 
68
  const ndb_mgm_configuration_iterator * getOwnConfigIterator() const;
 
69
 
 
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; };
 
73
 
 
74
  class LogLevel * m_logLevel;
 
75
private:
 
76
  friend class Cmvmi;
 
77
  friend class Qmgr;
 
78
  friend int reportShutdown(class Configuration *config, int error, int restart);
 
79
 
 
80
  ndb_mgm_configuration_iterator * getClusterConfigIterator() const;
 
81
 
 
82
  Uint32 _stopOnError;
 
83
  Uint32 m_restartOnErrorInsert;
 
84
  Uint32 _maxErrorLogs;
 
85
  Uint32 _lockPagesInMainMemory;
 
86
  Uint32 _timeBetweenWatchDogCheck;
 
87
  Uint32 _timeBetweenWatchDogCheckInitial;
 
88
 
 
89
  ndb_mgm_configuration * m_ownConfig;
 
90
  ndb_mgm_configuration * m_clusterConfig;
 
91
 
 
92
  ndb_mgm_configuration_iterator * m_clusterConfigIter;
 
93
  ndb_mgm_configuration_iterator * m_ownConfigIterator;
 
94
  
 
95
  ConfigRetriever *m_config_retriever;
 
96
 
 
97
  Vector<BaseString> m_mgmds;
 
98
 
 
99
  /**
 
100
   * arguments to NDB process
 
101
   */
 
102
  char * _programName;
 
103
  char * _fsPath;
 
104
  char * _backupPath;
 
105
  bool _initialStart;
 
106
  char * _connectString;
 
107
  Uint32 m_mgmd_port;
 
108
  BaseString m_mgmd_host;
 
109
  bool _daemonMode; // if not, angel in foreground
 
110
  bool _foregroundMode; // no angel, raw ndbd in foreground
 
111
 
 
112
  void calcSizeAlt(class ConfigValues * );
 
113
};
 
114
 
 
115
inline
 
116
const char *
 
117
Configuration::programName() const {
 
118
  return _programName;
 
119
}
 
120
 
 
121
inline
 
122
const char *
 
123
Configuration::fileSystemPath() const {
 
124
  return _fsPath;
 
125
}
 
126
 
 
127
inline
 
128
const char *
 
129
Configuration::backupFilePath() const {
 
130
  return _backupPath;
 
131
}
 
132
 
 
133
inline
 
134
bool
 
135
Configuration::getInitialStart() const {
 
136
  return _initialStart;
 
137
}
 
138
 
 
139
inline
 
140
bool
 
141
Configuration::getDaemonMode() const {
 
142
  return _daemonMode;
 
143
}
 
144
 
 
145
inline
 
146
bool
 
147
Configuration::getForegroundMode() const {
 
148
  return _foregroundMode;
 
149
}
 
150
 
 
151
#endif