21 #include "SignalData.hpp"
22 #include <trigger_definitions.h>
40 friend bool printLQHKEYREQ(FILE * output,
const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo);
43 STATIC_CONST( FixedSignalLength = 11 );
44 STATIC_CONST( MaxKeyInfo = 4 );
45 STATIC_CONST( MaxAttrInfo = 5);
48 STATIC_CONST( KeyInfoSectionNum = 0 );
49 STATIC_CONST( AttrInfoSectionNum = 1 );
51 STATIC_CONST( UnlockKeyLen = 2 );
61 UintR clientConnectPtr;
66 UintR tableSchemaVersion;
84 UintR variableData[10];
86 static UintR getAttrLen(
const UintR & scanInfoAttrLen);
87 static UintR getScanTakeOverFlag(
const UintR & scanInfoAttrLen);
88 static UintR getStoredProcFlag(
const UintR & scanData);
89 static UintR getDistributionKey(
const UintR & scanData);
90 static UintR getReorgFlag(
const UintR& scanData);
91 static void setReorgFlag(UintR& scanData, Uint32 val);
93 static UintR getTableId(
const UintR & tableSchemaVersion);
94 static UintR getSchemaVersion(
const UintR & tableSchemaVersion);
96 static UintR getFragmentId(
const UintR & fragmentData);
97 static UintR getNextReplicaNodeId(
const UintR & fragmentData);
99 static Uint8 getLockType(
const UintR & requestInfo);
100 static Uint8 getDirtyFlag(
const UintR & requestInfo);
101 static Uint8 getInterpretedFlag(
const UintR & requestInfo);
102 static Uint8 getSimpleFlag(
const UintR & requestInfo);
103 static Uint8 getOperation(
const UintR & requestInfo);
104 static Uint8 getSeqNoReplica(
const UintR & requestInfo);
105 static Uint8 getLastReplicaNo(
const UintR & requestInfo);
106 static Uint8 getAIInLqhKeyReq(
const UintR & requestInfo);
107 static UintR getKeyLen(
const UintR & requestInfo);
108 static UintR getSameClientAndTcFlag(
const UintR & requestInfo);
109 static UintR getReturnedReadLenAIFlag(
const UintR & requestInfo);
110 static UintR getApplicationAddressFlag(
const UintR & requestInfo);
111 static UintR getMarkerFlag(
const UintR & requestInfo);
112 static UintR getNoDiskFlag(
const UintR & requestInfo);
118 static void setAttrLen(UintR & scanInfoAttrLen, UintR val);
119 static void setScanTakeOverFlag(UintR & scanInfoAttrLen, UintR val);
120 static void setStoredProcFlag(UintR & scanData, UintR val);
121 static void setDistributionKey(UintR & scanData, UintR val);
123 static void setTableId(UintR & tableSchemaVersion, UintR val);
124 static void setSchemaVersion(UintR & tableSchemaVersion, UintR val);
126 static void setFragmentId(UintR & fragmentData, UintR val);
127 static void setNextReplicaNodeId(UintR & fragmentData, UintR val);
129 static void setLockType(UintR & requestInfo, UintR val);
130 static void setDirtyFlag(UintR & requestInfo, UintR val);
131 static void setInterpretedFlag(UintR & requestInfo, UintR val);
132 static void setSimpleFlag(UintR & requestInfo, UintR val);
133 static void setOperation(UintR & requestInfo, UintR val);
134 static void setSeqNoReplica(UintR & requestInfo, UintR val);
135 static void setLastReplicaNo(UintR & requestInfo, UintR val);
136 static void setAIInLqhKeyReq(UintR & requestInfo, UintR val);
137 static void setKeyLen(UintR & requestInfo, UintR val);
138 static void setSameClientAndTcFlag(UintR & requestInfo, UintR val);
139 static void setReturnedReadLenAIFlag(UintR & requestInfo, UintR val);
140 static void setApplicationAddressFlag(UintR & requestInfo, UintR val);
141 static void setMarkerFlag(UintR & requestInfo, UintR val);
142 static void setNoDiskFlag(UintR & requestInfo, UintR val);
144 static UintR getRowidFlag(
const UintR & requestInfo);
145 static void setRowidFlag(UintR & requestInfo, UintR val);
150 static UintR getGCIFlag(
const UintR & requestInfo);
151 static void setGCIFlag(UintR & requestInfo, UintR val);
153 static UintR getNrCopyFlag(
const UintR & requestInfo);
154 static void setNrCopyFlag(UintR & requestInfo, UintR val);
156 static UintR getQueueOnRedoProblemFlag(
const UintR & requestInfo);
157 static void setQueueOnRedoProblemFlag(UintR & requestInfo, UintR val);
162 static UintR getNormalProtocolFlag(
const UintR & requestInfo);
163 static void setNormalProtocolFlag(UintR & requestInfo, UintR val);
168 static UintR getCorrFactorFlag(
const UintR & requestInfo);
169 static void setCorrFactorFlag(UintR & requestInfo, UintR val);
174 static UintR getDeferredConstraints(
const UintR & requestInfo);
175 static void setDeferredConstraints(UintR & requestInfo, UintR val);
220 #define RI_KEYLEN_SHIFT (0)
221 #define RI_KEYLEN_MASK (1023)
222 #define RI_LAST_REPL_SHIFT (10)
223 #define RI_LAST_REPL_MASK (3)
224 #define RI_LOCK_TYPE_SHIFT (12)
225 #define RI_LOCK_TYPE_MASK (7)
226 #define RI_APPL_ADDR_SHIFT (15)
227 #define RI_DIRTY_SHIFT (16)
228 #define RI_INTERPRETED_SHIFT (17)
229 #define RI_SIMPLE_SHIFT (18)
230 #define RI_OPERATION_SHIFT (19)
231 #define RI_OPERATION_MASK (7)
232 #define RI_SEQ_REPLICA_SHIFT (22)
233 #define RI_SEQ_REPLICA_MASK (3)
234 #define RI_AI_IN_THIS_SHIFT (24)
235 #define RI_AI_IN_THIS_MASK (7)
236 #define RI_SAME_CLIENT_SHIFT (27)
237 #define RI_RETURN_AI_SHIFT (28)
238 #define RI_MARKER_SHIFT (29)
239 #define RI_NODISK_SHIFT (30)
240 #define RI_ROWID_SHIFT (31)
241 #define RI_GCI_SHIFT (12)
242 #define RI_NR_COPY_SHIFT (13)
243 #define RI_QUEUE_REDO_SHIFT (14)
244 #define RI_CORR_FACTOR_VALUE (24)
245 #define RI_NORMAL_DIRTY (25)
246 #define RI_DEFERRED_CONSTAINTS (26)
264 #define SI_ATTR_LEN_MASK (65535)
265 #define SI_ATTR_LEN_SHIFT (0)
266 #define SI_STORED_PROC_SHIFT (16)
267 #define SI_DISTR_KEY_MASK (255)
268 #define SI_DISTR_KEY_SHIFT (17)
269 #define SI_SCAN_TO_SHIFT (25)
270 #define SI_REORG_SHIFT (26)
271 #define SI_REORG_MASK (3)
275 LqhKeyReq::getAttrLen(
const UintR & scanData)
277 return (scanData >> SI_ATTR_LEN_SHIFT) & SI_ATTR_LEN_MASK;
282 LqhKeyReq::getScanTakeOverFlag(
const UintR & scanData)
284 return (scanData >> SI_SCAN_TO_SHIFT) & 1;
289 LqhKeyReq::getStoredProcFlag(
const UintR & scanData){
290 return (scanData >> SI_STORED_PROC_SHIFT) & 1;
295 LqhKeyReq::getDistributionKey(
const UintR & scanData){
296 return (scanData >> SI_DISTR_KEY_SHIFT) & SI_DISTR_KEY_MASK;
300 UintR LqhKeyReq::getTableId(
const UintR & tableSchemaVersion)
302 return tableSchemaVersion & 0xFFFF;
306 UintR LqhKeyReq::getSchemaVersion(
const UintR & tableSchemaVersion)
308 return tableSchemaVersion >> 16;
312 UintR LqhKeyReq::getFragmentId(
const UintR & fragmentData)
314 return fragmentData & 0xFFFF;
318 UintR LqhKeyReq::getNextReplicaNodeId(
const UintR & fragmentData)
320 return fragmentData >> 16;
324 Uint8 LqhKeyReq::getLastReplicaNo(
const UintR & requestInfo)
326 return (requestInfo >> RI_LAST_REPL_SHIFT) & RI_LAST_REPL_MASK;
330 Uint8 LqhKeyReq::getLockType(
const UintR & requestInfo)
332 return (requestInfo >> RI_LOCK_TYPE_SHIFT) & RI_LOCK_TYPE_MASK;
336 Uint8 LqhKeyReq::getDirtyFlag(
const UintR & requestInfo)
338 return (requestInfo >> RI_DIRTY_SHIFT) & 1;
342 Uint8 LqhKeyReq::getInterpretedFlag(
const UintR & requestInfo)
344 return (requestInfo >> RI_INTERPRETED_SHIFT) & 1;
348 Uint8 LqhKeyReq::getSimpleFlag(
const UintR & requestInfo)
350 return (requestInfo >> RI_SIMPLE_SHIFT) & 1;
354 Uint8 LqhKeyReq::getOperation(
const UintR & requestInfo)
356 return (requestInfo >> RI_OPERATION_SHIFT) & RI_OPERATION_MASK;
360 Uint8 LqhKeyReq::getSeqNoReplica(
const UintR & requestInfo)
362 return (requestInfo >> RI_SEQ_REPLICA_SHIFT) & RI_SEQ_REPLICA_MASK;
367 Uint8 LqhKeyReq::getAIInLqhKeyReq(
const UintR & requestInfo)
369 return (requestInfo >> RI_AI_IN_THIS_SHIFT) & RI_AI_IN_THIS_MASK;
373 UintR LqhKeyReq::getKeyLen(
const UintR & requestInfo)
375 return (requestInfo >> RI_KEYLEN_SHIFT) & RI_KEYLEN_MASK;
380 LqhKeyReq::getSameClientAndTcFlag(
const UintR & requestInfo)
382 return (requestInfo >> RI_SAME_CLIENT_SHIFT) & 1;
386 UintR LqhKeyReq::getReturnedReadLenAIFlag(
const UintR & requestInfo)
388 return (requestInfo >> RI_RETURN_AI_SHIFT) & 1;
393 LqhKeyReq::getApplicationAddressFlag(
const UintR & requestInfo){
394 return (requestInfo >> RI_APPL_ADDR_SHIFT) & 1;
399 LqhKeyReq::setAttrLen(UintR & scanInfoAttrLen, UintR val){
400 ASSERT_MAX(val, SI_ATTR_LEN_MASK,
"LqhKeyReq::setAttrLen");
401 scanInfoAttrLen |= (val << SI_ATTR_LEN_SHIFT);
407 LqhKeyReq::setScanTakeOverFlag(UintR & scanInfoAttrLen, UintR val){
408 ASSERT_BOOL(val,
"LqhKeyReq::setScanTakeOverFlag");
409 scanInfoAttrLen |= (val << SI_SCAN_TO_SHIFT);
414 LqhKeyReq::setStoredProcFlag(UintR & scanData, UintR val){
415 ASSERT_BOOL(val,
"LqhKeyReq::setStoredProcFlag");
416 scanData |= (val << SI_STORED_PROC_SHIFT);
421 LqhKeyReq::setDistributionKey(UintR & scanData, UintR val){
422 ASSERT_MAX(val, SI_DISTR_KEY_MASK,
"LqhKeyReq::setDistributionKey");
423 scanData |= (val << SI_DISTR_KEY_SHIFT);
428 LqhKeyReq::getReorgFlag(
const UintR & scanData){
429 return (scanData >> SI_REORG_SHIFT) & SI_REORG_MASK;
434 LqhKeyReq::setReorgFlag(UintR & scanData, UintR val){
435 ASSERT_MAX(val, SI_REORG_MASK,
"LqhKeyReq::setMovingFlag");
436 scanData |= (val << SI_REORG_SHIFT);
443 LqhKeyReq::setTableId(UintR & tableSchemaVersion, UintR val){
448 LqhKeyReq::setSchemaVersion(UintR & tableSchemaVersion, UintR val);
452 LqhKeyReq::setFragmentId(UintR & fragmentData, UintR val);
456 LqhKeyReq::setNextReplicaNodeId(UintR & fragmentData, UintR val);
461 LqhKeyReq::setLockType(UintR & requestInfo, UintR val){
462 ASSERT_MAX(val, RI_LOCK_TYPE_MASK,
"LqhKeyReq::setLockType");
463 requestInfo |= (val << RI_LOCK_TYPE_SHIFT);
468 LqhKeyReq::setDirtyFlag(UintR & requestInfo, UintR val){
469 ASSERT_BOOL(val,
"LqhKeyReq::setDirtyFlag");
470 requestInfo |= (val << RI_DIRTY_SHIFT);
475 LqhKeyReq::setInterpretedFlag(UintR & requestInfo, UintR val){
476 ASSERT_BOOL(val,
"LqhKeyReq::setInterpretedFlag");
477 requestInfo |= (val << RI_INTERPRETED_SHIFT);
482 LqhKeyReq::setSimpleFlag(UintR & requestInfo, UintR val){
483 ASSERT_BOOL(val,
"LqhKeyReq::setSimpleFlag");
484 requestInfo |= (val << RI_SIMPLE_SHIFT);
489 LqhKeyReq::setOperation(UintR & requestInfo, UintR val){
490 ASSERT_MAX(val, RI_OPERATION_MASK,
"LqhKeyReq::setOperation");
491 requestInfo |= (val << RI_OPERATION_SHIFT);
496 LqhKeyReq::setSeqNoReplica(UintR & requestInfo, UintR val){
497 ASSERT_MAX(val, RI_SEQ_REPLICA_MASK,
"LqhKeyReq::setSeqNoReplica");
498 requestInfo |= (val << RI_SEQ_REPLICA_SHIFT);
503 LqhKeyReq::setLastReplicaNo(UintR & requestInfo, UintR val){
504 ASSERT_MAX(val, RI_LAST_REPL_MASK,
"LqhKeyReq::setLastReplicaNo");
505 requestInfo |= (val << RI_LAST_REPL_SHIFT);
510 LqhKeyReq::setAIInLqhKeyReq(UintR & requestInfo, UintR val){
511 ASSERT_MAX(val, RI_AI_IN_THIS_MASK,
"LqhKeyReq::setAIInLqhKeyReq");
512 requestInfo |= (val << RI_AI_IN_THIS_SHIFT);
517 LqhKeyReq::setKeyLen(UintR & requestInfo, UintR val){
518 ASSERT_MAX(val, RI_KEYLEN_MASK,
"LqhKeyReq::setKeyLen");
519 requestInfo |= (val << RI_KEYLEN_SHIFT);
524 LqhKeyReq::setSameClientAndTcFlag(UintR & requestInfo, UintR val){
525 ASSERT_BOOL(val,
"LqhKeyReq::setSameClientAndTcFlag");
526 requestInfo |= (val << RI_SAME_CLIENT_SHIFT);
531 LqhKeyReq::setReturnedReadLenAIFlag(UintR & requestInfo, UintR val){
532 ASSERT_BOOL(val,
"LqhKeyReq::setReturnedReadLenAIFlag");
533 requestInfo |= (val << RI_RETURN_AI_SHIFT);
538 LqhKeyReq::setApplicationAddressFlag(UintR & requestInfo, UintR val){
539 ASSERT_BOOL(val,
"LqhKeyReq::setApplicationAddressFlag");
540 requestInfo |= (val << RI_APPL_ADDR_SHIFT);
547 LqhKeyReq::setMarkerFlag(UintR & requestInfo, UintR val){
548 ASSERT_BOOL(val,
"LqhKeyReq::setMarkerFlag");
549 requestInfo |= (val << RI_MARKER_SHIFT);
554 LqhKeyReq::getMarkerFlag(
const UintR & requestInfo){
555 return (requestInfo >> RI_MARKER_SHIFT) & 1;
560 LqhKeyReq::setNoDiskFlag(UintR & requestInfo, UintR val){
561 ASSERT_BOOL(val,
"LqhKeyReq::setNoDiskFlag");
562 requestInfo |= (val << RI_NODISK_SHIFT);
567 LqhKeyReq::getNoDiskFlag(
const UintR & requestInfo){
568 return (requestInfo >> RI_NODISK_SHIFT) & 1;
573 LqhKeyReq::setRowidFlag(UintR & requestInfo, UintR val){
574 ASSERT_BOOL(val,
"LqhKeyReq::setRowidFlag");
575 requestInfo |= (val << RI_ROWID_SHIFT);
580 LqhKeyReq::getRowidFlag(
const UintR & requestInfo){
581 return (requestInfo >> RI_ROWID_SHIFT) & 1;
586 LqhKeyReq::setGCIFlag(UintR & requestInfo, UintR val){
587 ASSERT_BOOL(val,
"LqhKeyReq::setGciFlag");
588 requestInfo |= (val << RI_GCI_SHIFT);
593 LqhKeyReq::getGCIFlag(
const UintR & requestInfo){
594 return (requestInfo >> RI_GCI_SHIFT) & 1;
599 LqhKeyReq::setNrCopyFlag(UintR & requestInfo, UintR val){
600 ASSERT_BOOL(val,
"LqhKeyReq::setNrCopyFlag");
601 requestInfo |= (val << RI_NR_COPY_SHIFT);
606 LqhKeyReq::getNrCopyFlag(
const UintR & requestInfo){
607 return (requestInfo >> RI_NR_COPY_SHIFT) & 1;
612 LqhKeyReq::setNormalProtocolFlag(UintR & requestInfo, UintR val){
613 ASSERT_BOOL(val,
"LqhKeyReq::setNrCopyFlag");
614 requestInfo |= (val << RI_NORMAL_DIRTY);
619 LqhKeyReq::getNormalProtocolFlag(
const UintR & requestInfo){
620 return (requestInfo >> RI_NORMAL_DIRTY) & 1;
625 LqhKeyReq::setCorrFactorFlag(UintR & requestInfo, UintR val){
626 ASSERT_BOOL(val,
"LqhKeyReq::setCorrFactorFlag");
627 requestInfo |= (val << RI_CORR_FACTOR_VALUE);
632 LqhKeyReq::getCorrFactorFlag(
const UintR & requestInfo){
633 return (requestInfo >> RI_CORR_FACTOR_VALUE) & 1;
638 LqhKeyReq::setDeferredConstraints(UintR & requestInfo, UintR val){
639 ASSERT_BOOL(val,
"LqhKeyReq::setDeferredConstraints");
640 requestInfo |= (val << RI_DEFERRED_CONSTAINTS);
645 LqhKeyReq::getDeferredConstraints(
const UintR & requestInfo){
646 return (requestInfo >> RI_DEFERRED_CONSTAINTS) & 1;
651 table_version_major_lqhkeyreq(Uint32 x)
660 LqhKeyReq::setQueueOnRedoProblemFlag(UintR & requestInfo, UintR val){
661 ASSERT_BOOL(val,
"LqhKeyReq::setQueueOnRedoProblem");
662 requestInfo |= (val << RI_QUEUE_REDO_SHIFT);
667 LqhKeyReq::getQueueOnRedoProblemFlag(
const UintR & requestInfo){
668 return (requestInfo >> RI_QUEUE_REDO_SHIFT) & 1;
689 friend bool printPACKED_SIGNAL(FILE * output,
const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo);
690 friend bool printLQHKEYCONF(FILE * output,
const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo);
693 STATIC_CONST( SignalLength = 7 );
713 Uint32 noFiredTriggers;
715 static Uint32 getFiredCount(Uint32 v) {
716 return NoOfFiredTriggers::getFiredCount(v);
718 static Uint32 getDeferredBit(Uint32 v) {
719 return NoOfFiredTriggers::getDeferredBit(v);
721 static void setDeferredBit(Uint32 & v) {
722 NoOfFiredTriggers::setDeferredBit(v);
742 friend bool printLQHKEYREF(FILE * output,
const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo);
745 STATIC_CONST( SignalLength = 5 );