~vadim-tk/percona-server/percona-galera-5.1.57

« back to all changes in this revision

Viewing changes to storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp

  • Committer: root
  • Date: 2011-07-10 16:09:24 UTC
  • Revision ID: root@r815.office.percona.com-20110710160924-fyffqsbaclgu6vui
Initial port

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 Cmvmi_H_
 
17
#define Cmvmi_H_
 
18
 
 
19
#include <pc.hpp>
 
20
#include <SimulatedBlock.hpp>
 
21
#include <LogLevel.hpp>
 
22
 
 
23
#include <DLList.hpp>
 
24
 
 
25
/**
 
26
 * Cmvmi class
 
27
 */
 
28
class Cmvmi : public SimulatedBlock {
 
29
public:
 
30
  Cmvmi(Block_context&);
 
31
  virtual ~Cmvmi();
 
32
  
 
33
private:
 
34
  /**
 
35
   * These methods used to be reportXXX
 
36
   *
 
37
   * But they in a nasty way intefere with the execution model
 
38
   * they been turned in to exec-Method used via prio A signals
 
39
   */
 
40
  void execDISCONNECT_REP(Signal*);
 
41
  void execCONNECT_REP(Signal*);
 
42
  
 
43
private:
 
44
  BLOCK_DEFINES(Cmvmi);
 
45
 
 
46
  // The signal processing functions
 
47
  void execNDB_TAMPER(Signal* signal);
 
48
  void execSET_LOGLEVELORD(Signal* signal);
 
49
  void execEVENT_REP(Signal* signal);
 
50
  void execREAD_CONFIG_REQ(Signal* signal);
 
51
  void execSTTOR(Signal* signal);
 
52
  void execCLOSE_COMREQ(Signal* signal);
 
53
  void execENABLE_COMORD(Signal* signal);
 
54
  void execOPEN_COMREQ(Signal* signal);
 
55
  void execSIZEALT_ACK(Signal* signal);
 
56
  void execTEST_ORD(Signal* signal);
 
57
 
 
58
  void execSTOP_ORD(Signal* signal);
 
59
  void execSTART_ORD(Signal* signal);
 
60
  void execTAMPER_ORD(Signal* signal);
 
61
 
 
62
  void execDUMP_STATE_ORD(Signal* signal);
 
63
 
 
64
  void execEVENT_SUBSCRIBE_REQ(Signal *);
 
65
  void cancelSubscription(NodeId nodeId);
 
66
 
 
67
  void execTESTSIG(Signal* signal);
 
68
  void execNODE_START_REP(Signal* signal);
 
69
  
 
70
  char theErrorMessage[256];
 
71
  void sendSTTORRY(Signal* signal);
 
72
 
 
73
  LogLevel clogLevel;
 
74
  NdbNodeBitmask c_dbNodes;
 
75
 
 
76
  /**
 
77
   * This struct defines the data needed for a EVENT_REP subscriber
 
78
   */
 
79
  struct EventRepSubscriber {
 
80
    /**
 
81
     * What log level is the subscriber using
 
82
     */
 
83
    LogLevel       logLevel;
 
84
 
 
85
    /**
 
86
     * What block reference does he use
 
87
     *   (Where should the EVENT_REP's be forwarded)
 
88
     */
 
89
    BlockReference blockRef;
 
90
 
 
91
    /**
 
92
     * Next ptr (used in pool/list)
 
93
     */
 
94
    union { Uint32 nextPool; Uint32 nextList; };
 
95
    Uint32 prevList;
 
96
  };
 
97
  typedef Ptr<EventRepSubscriber> SubscriberPtr;
 
98
  
 
99
  /**
 
100
   * Pool of EventRepSubscriber record
 
101
   */
 
102
  ArrayPool<EventRepSubscriber> subscriberPool;
 
103
  
 
104
  /**
 
105
   * List of current subscribers
 
106
   */
 
107
  DLList<EventRepSubscriber> subscribers;
 
108
 
 
109
private:
 
110
  // Declared but not defined
 
111
  Cmvmi(const Cmvmi &obj);
 
112
  void operator = (const Cmvmi &);
 
113
 
 
114
  void sendFragmentedComplete(Signal* signal, Uint32 data, Uint32 returnCode);
 
115
};
 
116
 
 
117
#endif