1 /* Copyright (c) 2003, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
16 #ifndef ClusterConfiguration_H
17 #define ClusterConfiguration_H
19 #include <kernel_types.h>
20 #include <ndb_limits.h>
21 #include <Properties.hpp>
22 #include <ErrorReporter.hpp>
23 #include <signaldata/CmvmiCfgConf.hpp>
24 #include <signaldata/SetLogLevelOrd.hpp>
25 #include <NodeInfo.hpp>
27 // MaxNumber of sizealteration records in each block
28 // MaxNumber of blocks with sizealteration, (size of array)
29 #define MAX_SIZEALT_RECORD 16
30 #define MAX_SIZEALT_BLOCKS 8
32 enum NdbBlockName
{ ACC
= 0, DICT
, DIH
, LQH
, TC
, TUP
, TUX
, NDB_SIZEALT_OFF
};
33 // NDB_SIZEALT_OFF is used for block without sizealteration
34 // IMPORTANT to assign NDB_SIZEALT_OFF as largest value
42 unsigned int noOfTables
;
43 unsigned int noOfIndexes
;
44 unsigned int noOfReplicas
;
45 unsigned int noOfNDBNodes
;
46 unsigned int noOfAPINodes
;
47 unsigned int noOfMGMNodes
;
48 unsigned int noOfNodes
;
49 unsigned int noOfDiskLessNodes
;
50 unsigned int noOfAttributes
;
51 unsigned int noOfOperations
;
52 unsigned int noOfTransactions
;
53 unsigned int noOfIndexPages
;
54 unsigned int noOfDataPages
;
55 unsigned int noOfDiskBufferPages
;
56 unsigned int noOfFreeClusters
;
57 unsigned int noOfDiskClusters
;
58 unsigned int noOfScanRecords
;
60 VarSize varSize
[MAX_SIZEALT_BLOCKS
][MAX_SIZEALT_RECORD
];
61 unsigned short blockNo
[MAX_SIZEALT_BLOCKS
];
66 class ClusterConfiguration
73 nodeType
= NodeInfo::INVALID
;
77 NodeInfo::NodeType nodeType
;
84 NodeData nodeData
[MAX_NODES
];
85 Uint32 ispValues
[5][CmvmiCfgConf::NO_OF_WORDS
];
88 ClusterConfiguration();
89 ~ClusterConfiguration();
90 const ClusterData
& clusterData() const;
92 void init(const Properties
& p
, const Properties
& db
);
97 ClusterData the_clusterData
;
99 void calcSizeAlteration();
103 #endif // ClusterConfiguration_H