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

« back to all changes in this revision

Viewing changes to storage/ndb/include/mgmcommon/IPCConfig.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 IPCConfig_H
 
17
#define IPCConfig_H
 
18
 
 
19
#include <ndb_types.h>
 
20
#include <ndb_limits.h>
 
21
#include <kernel_types.h>
 
22
#include <Properties.hpp>
 
23
 
 
24
/**
 
25
 * @class IPCConfig
 
26
 * @brief Config transporters in TransporterRegistry using Properties config
 
27
 */
 
28
class IPCConfig 
 
29
{
 
30
public:
 
31
  IPCConfig(Properties * props);
 
32
  ~IPCConfig();
 
33
 
 
34
  /** @return 0 for OK */
 
35
  int init(); 
 
36
  
 
37
  NodeId ownId() const;
 
38
  
 
39
  /** @return No of transporters configured */
 
40
  int configureTransporters(class TransporterRegistry * theTransporterRegistry);
 
41
 
 
42
  /**
 
43
   * Supply a nodeId,
 
44
   *  and get next higher node id
 
45
   * @return false if none found, true otherwise
 
46
   *
 
47
   * getREPHBFrequency and getNodeType uses the last Id supplied to 
 
48
   * getNextRemoteNodeId.
 
49
   */
 
50
  bool getNextRemoteNodeId(NodeId & nodeId) const;
 
51
  Uint32 getREPHBFrequency(NodeId id) const;
 
52
  const char* getNodeType(NodeId id) const;
 
53
  
 
54
  NodeId getNoOfRemoteNodes() const {
 
55
    return theNoOfRemoteNodes;
 
56
  }
 
57
 
 
58
  void print() const { props->print(); }
 
59
 
 
60
  static Uint32 configureTransporters(Uint32 nodeId,
 
61
                                      const struct ndb_mgm_configuration &,
 
62
                                      class TransporterRegistry &);
 
63
  
 
64
private:
 
65
  NodeId        the_ownId;
 
66
  Properties *  props;
 
67
  
 
68
  bool    addRemoteNodeId(NodeId nodeId);
 
69
  NodeId  theNoOfRemoteNodes;
 
70
  NodeId  theRemoteNodeIds[MAX_NODES];
 
71
};
 
72
 
 
73
inline 
 
74
NodeId 
 
75
IPCConfig::ownId() const
 
76
{
 
77
  return the_ownId;
 
78
}
 
79
 
 
80
 
 
81
 
 
82
#endif // IPCConfig_H