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 */
20
#include <kernel_types.h>
21
#include <Properties.hpp>
22
#include <ndb_limits.h>
24
#include "InitConfigFileParser.hpp"
25
#endif /* NDB_MGMAPI */
28
* A MANDATORY parameters must be specified in the config file
29
* An UNDEFINED parameter may or may not be specified in the config file
32
// Default value for mandatory params.
33
#define MANDATORY ((char*)~(UintPtr)0)
34
// Default value for undefined params.
35
#define UNDEFINED ((char*) 0)
39
* @brief Metainformation about ALL cluster configuration parameters
41
* Use the getters to find out metainformation about parameters.
45
enum Type { CI_BOOL, CI_INT, CI_INT64, CI_STRING, CI_SECTION };
46
enum Status { CI_USED, ///< Active
47
CI_DEPRICATED, ///< Can be, but shouldn't
48
CI_NOTIMPLEMENTED, ///< Is ignored.
49
CI_INTERNAL ///< Not configurable by the user
53
* Entry for one configuration parameter
59
const char* _description;
75
* Entry for one section rule
78
const char * m_section;
79
bool (* m_sectionRule)(struct InitConfigFileParser::Context &,
80
const char * m_ruleData);
81
const char * m_ruleData;
85
* Entry for config rule
87
struct ConfigRuleSection {
88
BaseString m_sectionType;
89
Properties * m_sectionData;
93
bool (* m_configRule)(Vector<ConfigRuleSection>&,
94
struct InitConfigFileParser::Context &,
95
const char * m_ruleData);
96
const char * m_ruleData;
102
* Checks if the suggested value is valid for the suggested parameter
103
* (i.e. if it is >= than min and <= than max).
105
* @param section Init Config file section name
106
* @param fname Name of parameter
107
* @param value Value to check
108
* @return true if parameter value is valid.
110
* @note Result is not defined if section/name are wrong!
112
bool verify(const Properties* secti, const char* fname, Uint64 value) const;
113
static const char* nameToAlias(const char*);
114
static const char* getAlias(const char*);
115
bool isSection(const char*) const;
117
const char* getDescription(const Properties * sec, const char* fname) const;
118
Type getType(const Properties * section, const char* fname) const;
119
Status getStatus(const Properties* section, const char* fname) const;
120
Uint64 getMin(const Properties * section, const char* fname) const;
121
Uint64 getMax(const Properties * section, const char* fname) const;
122
Uint64 getDefault(const Properties * section, const char* fname) const;
124
const Properties * getInfo(const char * section) const;
125
const Properties * getDefaults(const char * section) const;
128
void print(const char* section) const;
129
void print(const Properties * section, const char* parameter) const;
133
Properties m_systemDefaults;
135
static const AliasPair m_sectionNameAliases[];
136
static const char* m_sectionNames[];
137
static const int m_noOfSectionNames;
138
#endif /* NDB_MGMAPI */
141
static const ParamInfo m_ParamInfo[];
142
static const int m_NoOfParams;
145
static const SectionRule m_SectionRules[];
146
static const ConfigRule m_ConfigRules[];
147
static const int m_NoOfRules;
148
#endif /* NDB_MGMAPI */
151
#endif // ConfigInfo_H