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 */
16
#ifndef LQH_TRANS_CONF_H
17
#define LQH_TRANS_CONF_H
19
#include "SignalData.hpp"
22
* This signal is sent as response to a LQH_TRANSREQ
23
* which is sent as by a take-over TC
36
friend bool printLQH_TRANSCONF(FILE *, const Uint32 *, Uint32, Uint16);
38
STATIC_CONST( SignalLength = 15 );
42
* This type describes the state of the operation returned in this signal
44
enum OperationStatus {
45
InvalidStatus = 0, /**< This status should never be sent in a signal
46
it is only used for initializing variables so that
47
you can easily later check if they have changed */
48
LastTransConf = 4, /**< This status indicates that LQH has finished the scan
49
of operations belonging to the died TC.
50
Data 0 - 2 is valid */
55
Marker = 5 /**< This means that the only thing left is a marker,
56
Data 0 - 6 is valid */
63
Uint32 lqhNodeId; // 1
64
Uint32 operationStatus; // 2 See enum OperationStatus
81
static Uint32 getReplicaNo(Uint32 & requestInfo);
82
static Uint32 getReplicaType(Uint32 & requestInfo);
83
static Uint32 getLastReplicaNo(Uint32 & requestInfo);
84
static Uint32 getSimpleFlag(Uint32 & requestInfo);
85
static Uint32 getDirtyFlag(Uint32 & requestInfo);
86
static Uint32 getOperation(Uint32 & requestInfo);
87
static Uint32 getMarkerFlag(Uint32 & requestInfo);
89
static void setReplicaNo(UintR & requestInfo, UintR val);
90
static void setReplicaType(UintR & requestInfo, UintR val);
91
static void setLastReplicaNo(UintR & requestInfo, UintR val);
92
static void setSimpleFlag(UintR & requestInfo, UintR val);
93
static void setDirtyFlag(UintR & requestInfo, UintR val);
94
static void setOperation(UintR & requestInfo, UintR val);
95
static void setMarkerFlag(Uint32 & requestInfo, Uint32 val);
101
* t = replica type - 2 Bits (0-1)
102
* r = Replica No - 2 Bits (2-3)
103
* l = Last Replica No - 2 Bits (4-5)
104
* s = Simple - 1 Bits (6)
105
* d = Dirty - 1 Bit (7)
106
* o = Operation - 3 Bit (8-9)
107
* m = Marker present - 1 Bit (10)
109
* 1111111111222222222233
110
* 01234567890123456789012345678901
113
#define LTC_REPLICA_TYPE_SHIFT (0)
114
#define LTC_REPLICA_TYPE_MASK (3)
115
#define LTC_REPLICA_NO_SHIFT (2)
116
#define LTC_REPLICA_NO_MASK (3)
117
#define LTC_LAST_REPLICA_SHIFT (4)
118
#define LTC_LAST_REPLICA_MASK (3)
119
#define LTC_SIMPLE_SHIFT (6)
120
#define LTC_DIRTY_SHIFT (7)
121
#define LTC_OPERATION_SHIFT (8)
122
#define LTC_OPERATION_MASK (7)
123
#define LTC_MARKER_SHIFT (10)
127
LqhTransConf::getReplicaType(Uint32 & requestInfo){
128
return (requestInfo >> LTC_REPLICA_TYPE_SHIFT) & LTC_REPLICA_TYPE_MASK;
133
LqhTransConf::getReplicaNo(Uint32 & requestInfo){
134
return (requestInfo >> LTC_REPLICA_NO_SHIFT) & LTC_REPLICA_NO_MASK;
139
LqhTransConf::getLastReplicaNo(Uint32 & requestInfo){
140
return (requestInfo >> LTC_LAST_REPLICA_SHIFT) & LTC_LAST_REPLICA_MASK;
145
LqhTransConf::getSimpleFlag(Uint32 & requestInfo){
146
return (requestInfo >> LTC_SIMPLE_SHIFT) & 1;
151
LqhTransConf::getDirtyFlag(Uint32 & requestInfo){
152
return (requestInfo >> LTC_DIRTY_SHIFT) & 1;
157
LqhTransConf::getOperation(Uint32 & requestInfo){
158
return (requestInfo >> LTC_OPERATION_SHIFT) & LTC_OPERATION_MASK;
163
LqhTransConf::getMarkerFlag(Uint32 & requestInfo){
164
return (requestInfo >> LTC_MARKER_SHIFT) & 1;
170
LqhTransConf::setReplicaNo(UintR & requestInfo, UintR val){
171
ASSERT_MAX(val, LTC_REPLICA_NO_MASK, "LqhTransConf::setReplicaNo");
172
requestInfo |= (val << LTC_REPLICA_NO_SHIFT);
177
LqhTransConf::setReplicaType(UintR & requestInfo, UintR val){
178
ASSERT_MAX(val, LTC_REPLICA_TYPE_MASK, "LqhTransConf::setReplicaType");
179
requestInfo |= (val << LTC_REPLICA_TYPE_SHIFT);
184
LqhTransConf::setLastReplicaNo(UintR & requestInfo, UintR val){
185
ASSERT_MAX(val, LTC_LAST_REPLICA_MASK, "LqhTransConf::setLastReplicaNo");
186
requestInfo |= (val << LTC_LAST_REPLICA_SHIFT);
191
LqhTransConf::setSimpleFlag(UintR & requestInfo, UintR val){
192
ASSERT_BOOL(val, "LqhTransConf::setSimpleFlag");
193
requestInfo |= (val << LTC_SIMPLE_SHIFT);
198
LqhTransConf::setDirtyFlag(UintR & requestInfo, UintR val){
199
ASSERT_BOOL(val, "LqhTransConf::setDirtyFlag");
200
requestInfo |= (val << LTC_DIRTY_SHIFT);
205
LqhTransConf::setOperation(UintR & requestInfo, UintR val){
206
ASSERT_MAX(val, LTC_OPERATION_MASK, "LqhTransConf::setOperation");
207
requestInfo |= (val << LTC_OPERATION_SHIFT);
212
LqhTransConf::setMarkerFlag(UintR & requestInfo, UintR val){
213
ASSERT_BOOL(val, "LqhTransConf::setMarkerFlag");
214
requestInfo |= (val << LTC_MARKER_SHIFT);