MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EventReport.hpp
1 /*
2  Copyright (C) 2003-2006, 2008 MySQL AB
3  All rights reserved. Use is subject to license terms.
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; version 2 of the License.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
19 #ifndef SD_EVENT_REPORT_H
20 #define SD_EVENT_REPORT_H
21 
22 #include <ndb_logevent.h>
23 #include "SignalData.hpp"
24 
31 class EventReport {
32  friend class SimulatedBlock;
33  friend class Cmvmi;
34  friend class SimblockMissra;
35  friend class Dbacc;
36  friend class Dblqh;
37  friend class Dbtup;
38  friend class Dbtc;
39  friend class Ndbcntr;
40  friend class Qmgr;
41  friend class Dbdih;
42  friend class Dbdict;
43  friend class MgmtSrvr;
44 
45 public:
46  /*
47  EventType defines what event reports to send.
48 
49  The ORDER is NOT important anymore. //ejonore 2003-07-24 15:03
50 
51  HOW TO ADD A NEW EVENT
52  --------------------
53  1) Add SentHeartbeat EventType in the category where it belongs.
54  ...
55  // INFO
56  SentHeartbeat,
57  InfoEvent
58  ...
59 
60  2) remeber to update # of events below. Just to keep count...
61  Number of event types = 53
62 
63  3) Add a new SentHeartBeat entry to EventLogger::matrix[].
64  ...
65  // INFO
66  { EventReport::SentHeartbeat, LogLevel::llInfo, 11, INFO },
67  { EventReport::InfoEvent, LogLevel::llInfo, 2, INFO }
68  ...
69 
70  4) Add SentHeartbeat in EventLogger::getText()
71 
72  */
73  void setNodeId(Uint32 nodeId);
74  Uint32 getNodeId() const;
75  void setEventType(Ndb_logevent_type type);
76  Ndb_logevent_type getEventType() const;
77  UintR eventType; // DATA 0
78 };
79 
80 inline
81 void
82 EventReport::setNodeId(Uint32 nodeId){
83  eventType = (nodeId << 16) | (eventType & 0xFFFF);
84 }
85 
86 inline
87 Uint32
88 EventReport::getNodeId() const {
89  return eventType >> 16;
90 }
91 
92 inline
93 void
94 EventReport::setEventType(Ndb_logevent_type type){
95  eventType = (eventType & 0xFFFF0000) | (((UintR) type) & 0xFFFF);
96 }
97 
98 inline
100 EventReport::getEventType() const {
101  return (Ndb_logevent_type)(eventType & 0xFFFF);
102 }
103 
104 #endif