1 /*
2    Copyright (c) 2003, 2021, Oracle and/or its affiliates.
3 
4    This program is free software; you can redistribute it and/or modify
5    it under the terms of the GNU General Public License, version 2.0,
6    as published by the Free Software Foundation.
7 
8    This program is also distributed with certain software (including
9    but not limited to OpenSSL) that is licensed under separate terms,
10    as designated in a particular file or component or in included license
11    documentation.  The authors of MySQL hereby grant you an additional
12    permission to link the program and your derivative works with the
13    separately licensed software that they have included with MySQL.
14 
15    This program is distributed in the hope that it will be useful,
16    but WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18    GNU General Public License, version 2.0, for more details.
19 
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
23 */
24 
25 #ifndef SCAN_FRAG_HPP
26 #define SCAN_FRAG_HPP
27 
28 #include "SignalData.hpp"
29 #include "ndb_limits.h"
30 
31 #define JAM_FILE_ID 134
32 
33 
34 class ScanFragReq {
35   /**
36    * Sender(s)
37    */
38   friend class Dbtc;
39   friend class Backup;
40   friend class Suma;
41 
42   /**
43    * Reciver(s)
44    */
45   friend class Dblqh;
46   friend class Dbspj;
47 public:
48   STATIC_CONST( SignalLength = 12 );
49 
50   STATIC_CONST( AttrInfoSectionNum = 0 );
51   STATIC_CONST( KeyInfoSectionNum = 1 );
52 
53   friend bool printSCAN_FRAGREQ(FILE *, const Uint32*, Uint32, Uint16);
54   friend bool printSCAN_FRAGCONF(FILE *, const Uint32*, Uint32, Uint16);
55 
56 public:
57   enum ReorgFlag
58   {
59     REORG_ALL = 0
60     ,REORG_NOT_MOVED = 1 // Only return not moved rows
61     ,REORG_MOVED = 2    // Only return moved rows
62   };
63 
64   Uint32 senderData;
65   Uint32 resultRef;       // Where to send the result
66   Uint32 savePointId;
67   Uint32 requestInfo;
68   Uint32 tableId;
69   Uint32 fragmentNoKeyLen;
70   Uint32 schemaVersion;
71   Uint32 transId1;
72   Uint32 transId2;
73   union {
74     Uint32 clientOpPtr;
75     Uint32 resultData;
76   };
77   Uint32 batch_size_rows;
78   Uint32 batch_size_bytes;
79   Uint32 variableData[1];
80 
81   static Uint32 getLockMode(const Uint32 & requestInfo);
82   static Uint32 getHoldLockFlag(const Uint32 & requestInfo);
83   static Uint32 getKeyinfoFlag(const Uint32 & requestInfo);
84   static Uint32 getReadCommittedFlag(const Uint32 & requestInfo);
85   static Uint32 getRangeScanFlag(const Uint32 & requestInfo);
86   static Uint32 getDescendingFlag(const Uint32 & requestInfo);
87   static Uint32 getTupScanFlag(const Uint32 & requestInfo);
88   static Uint32 getAttrLen(const Uint32 & requestInfo);
89   static Uint32 getScanPrio(const Uint32 & requestInfo);
90   static Uint32 getNoDiskFlag(const Uint32 & requestInfo);
91   static Uint32 getLcpScanFlag(const Uint32 & requestInfo);
92   static Uint32 getStatScanFlag(const Uint32 & requestInfo);
93   static Uint32 getPrioAFlag(const Uint32 & requestInfo);
94   /**
95    * To ensure backwards compatibility we set the flag when NOT using
96    * interpreted mode, previously scans always used interpreted mode. Now
97    * it is possible to perform scans (especially LCP scans and Backup
98    * scans) without using the interpreted programs. This way the code will
99    * interact nicely with old code that always set this flag to 0 and want
100    * to use interpreted execution based on that.
101    */
102   static Uint32 getNotInterpretedFlag(const Uint32 & requestInfo);
103 
104   static void setLockMode(Uint32 & requestInfo, Uint32 lockMode);
105   static void setHoldLockFlag(Uint32 & requestInfo, Uint32 holdLock);
106   static void setKeyinfoFlag(Uint32 & requestInfo, Uint32 keyinfo);
107   static void setReadCommittedFlag(Uint32 & requestInfo, Uint32 readCommitted);
108   static void setRangeScanFlag(Uint32 & requestInfo, Uint32 rangeScan);
109   static void setDescendingFlag(Uint32 & requestInfo, Uint32 descending);
110   static void setTupScanFlag(Uint32 & requestInfo, Uint32 tupScan);
111   static void setAttrLen(Uint32 & requestInfo, Uint32 attrLen);
112   static void clearAttrLen(Uint32 & requestInfo);
113   static void setScanPrio(Uint32& requestInfo, Uint32 prio);
114   static void setNoDiskFlag(Uint32& requestInfo, Uint32 val);
115   static void setLcpScanFlag(Uint32 & requestInfo, Uint32 val);
116   static void setStatScanFlag(Uint32 & requestInfo, Uint32 val);
117   static void setPrioAFlag(Uint32 & requestInfo, Uint32 val);
118   static void setNotInterpretedFlag(Uint32 & requestInfo, Uint32 val);
119 
120   static void setReorgFlag(Uint32 & requestInfo, Uint32 val);
121   static Uint32 getReorgFlag(const Uint32 & requestInfo);
122 
123   static void setCorrFactorFlag(Uint32 & requestInfo, Uint32 val);
124   static Uint32 getCorrFactorFlag(const Uint32 & requestInfo);
125 };
126 
127 /*
128   The KEYINFO20 signal is sent from LQH to API for each row in a scan when the
129   ScanTabReq::getKeyinfoFlag() is set in requestInfo in the SCAN_TABREQ signal.
130 
131   The '20' in the signal name refers to the number of keyInfo data words in
132   the signal, which is actually a bit misleading since now it is sent as a
133   single long signal if the keyinfo has more than 20 words.
134 
135   The information in this signal is used in the NDB API to request the take
136   over of a lock from the scan with a TCKEYREQ, using the primary key info
137   sent as data and the scanInfo_Node word to identify the lock.
138 */
139 class KeyInfo20 {
140   /**
141    * Sender(s)
142    */
143   friend class Dblqh;
144 
145   /**
146    * Reciver(s)
147    */
148   friend class Backup;
149   friend class NdbOperation;
150   friend class NdbScanReceiver;
151 public:
152   STATIC_CONST( HeaderLength = 5);
153   STATIC_CONST( DataLength = 20 );
154 
155 
156   static Uint32 setScanInfo(Uint32 noOfOps, Uint32 scanNo);
157   static Uint32 getScanNo(Uint32 scanInfo);
158   static Uint32 getScanOp(Uint32 scanInfo);
159 
160 public:
161   Uint32 clientOpPtr;
162   Uint32 keyLen;
163   /*
164     The scanInfo_Node word contains the information needed to identify the
165     row and lock to take over in the TCKEYREQ signal. It has two parts:
166      1. ScanInfo      Lower 20 bits
167      2. ScanFragment  Upper 14 bits
168   */
169   Uint32 scanInfo_Node;
170   Uint32 transId1;
171   Uint32 transId2;
172   Uint32 keyData[DataLength];
173   /*
174     Note that if the key info data does not fit within the maximum of 20
175     in-signal words, the entire key info is instead sent in long signal
176     section 0.
177     The data here is a word string suitable for sending as KEYINFO in
178     the TCKEYREQ signal.
179   */
180 };
181 
182 class ScanFragConf {
183   /**
184    * Sender(s)
185    */
186   friend class Dblqh;
187 
188   /**
189    * Reciver(s)
190    */
191   friend class Dbtc;
192   friend class Backup;
193   friend class Suma;
194 public:
195   STATIC_CONST( SignalLength = 6 );
196 
197 public:
198   Uint32 senderData;
199   Uint32 completedOps;
200   Uint32 fragmentCompleted;
201   Uint32 transId1;
202   Uint32 transId2;
203   Uint32 total_len;  // Total #Uint32 returned as TRANSID_AI
204 };
205 
206 class ScanFragRef {
207   /**
208    * Sender(s)
209    */
210   friend class Dblqh;
211 
212   /**
213    * Reciver(s)
214    */
215   friend class Dbtc;
216   friend class Backup;
217   friend class Suma;
218 public:
219   STATIC_CONST( SignalLength = 4 );
220 public:
221   enum ErrorCode {
222     ZNO_FREE_TC_CONREC_ERROR = 484,
223     ZTOO_FEW_CONCURRENT_OPERATIONS = 485,
224     ZTOO_MANY_CONCURRENT_OPERATIONS = 486,
225     ZSCAN_NO_FRAGMENT_ERROR = 487,
226     ZTOO_MANY_ACTIVE_SCAN_ERROR = 488,
227     ZNO_FREE_SCANREC_ERROR = 489,
228     TABLE_NOT_DEFINED_ERROR = 723,
229     DROP_TABLE_IN_PROGRESS_ERROR = 1226, /* Reported on LCP scans */
230     ZWRONG_BATCH_SIZE = 1230,
231     ZSTANDBY_SCAN_ERROR = 1209,
232     NO_TC_CONNECT_ERROR = 1217,
233     ZSCAN_BOOK_ACC_OP_ERROR = 1219,
234     ZUNKNOWN_TRANS_ERROR = 1227
235   };
236 
237   Uint32 senderData;
238   Uint32 transId1;
239   Uint32 transId2;
240   Uint32 errorCode;
241 };
242 
243 /**
244  * This is part of Scan Fragment protocol
245  *
246  * Not to be confused with ScanNextReq in Scan Table protocol
247  */
248 class ScanFragNextReq {
249   /**
250    * Sender(s)
251    */
252   friend class Dbtc;
253   friend class Backup;
254   friend class Suma;
255 
256   /**
257    * Reciver(s)
258    */
259   friend class Dblqh;
260 
261   friend bool printSCANFRAGNEXTREQ(FILE * output, const Uint32 * theData,
262 				   Uint32 len, Uint16 receiverBlockNo);
263 public:
264   STATIC_CONST( SignalLength = 6 );
265 
266 public:
267   Uint32 senderData;
268   Uint32 requestInfo;
269   Uint32 transId1;
270   Uint32 transId2;
271   Uint32 batch_size_rows;
272   Uint32 batch_size_bytes;
273   Uint32 variableData[1];
274 
275   static Uint32 getCloseFlag(const Uint32&);
276   static void setCloseFlag(Uint32&, Uint32);
277 
278   static Uint32 getPrioAFlag(const Uint32&);
279   static void setPrioAFlag(Uint32&, Uint32);
280 
281   static Uint32 getCorrFactorFlag(const Uint32&);
282   static void setCorrFactorFlag(Uint32&);
283 };
284 
285 /**
286  * Request Info (SCANFRAGREQ)
287  *
288  * a = Length of attrinfo    - 16 Bits (16-31) (Short only)
289  * c = LCP scan              - 1  Bit 3
290  * d = No disk               - 1  Bit 4
291  * l = Lock Mode             - 1  Bit 5
292  * h = Hold lock             - 1  Bit 7
293  * k = Keyinfo               - 1  Bit 8
294  * r = read committed        - 1  Bit 9
295  * x = range scan            - 1  Bit 6
296  * z = descending            - 1  Bit 10
297  * t = tup scan              - 1  Bit 11 (implies x=z=0)
298  * p = Scan prio             - 4  Bits (12-15) -> max 15
299  * r = Reorg flag            - 2  Bits (1-2)
300  * C = corr value flag       - 1  Bit  (16)
301  * s = Stat scan             - 1  Bit 17
302  * a = Prio A scan           - 1  Bit 18
303  * i = Not interpreted flag  - 1  Bit 19
304  *
305  *           1111111111222222222233
306  * 01234567890123456789012345678901
307  *  rrcdlxhkrztppppaaaaaaaaaaaaaaaa   Short variant ( < 6.4.0)
308  *  rrcdlxhkrztppppCs                 Long variant (6.4.0 +)
309  */
310 #define SF_LOCK_MODE_SHIFT   (5)
311 #define SF_LOCK_MODE_MASK    (1)
312 
313 #define SF_NO_DISK_SHIFT     (4)
314 #define SF_HOLD_LOCK_SHIFT   (7)
315 #define SF_KEYINFO_SHIFT     (8)
316 #define SF_READ_COMMITTED_SHIFT  (9)
317 #define SF_RANGE_SCAN_SHIFT (6)
318 #define SF_DESCENDING_SHIFT (10)
319 #define SF_TUP_SCAN_SHIFT   (11)
320 #define SF_LCP_SCAN_SHIFT   (3)
321 
322 #define SF_ATTR_LEN_SHIFT    (16)
323 #define SF_ATTR_LEN_MASK     (65535)
324 
325 #define SF_PRIO_SHIFT 12
326 #define SF_PRIO_MASK 15
327 
328 #define SF_REORG_SHIFT      (1)
329 #define SF_REORG_MASK       (3)
330 
331 #define SF_CORR_FACTOR_SHIFT  (16)
332 
333 #define SF_STAT_SCAN_SHIFT  (17)
334 #define SF_PRIO_A_SHIFT     (18)
335 #define SF_NOT_INTERPRETED_SHIFT (19)
336 
337 inline
338 Uint32
getLockMode(const Uint32 & requestInfo)339 ScanFragReq::getLockMode(const Uint32 & requestInfo){
340   return (requestInfo >> SF_LOCK_MODE_SHIFT) & SF_LOCK_MODE_MASK;
341 }
342 
343 inline
344 Uint32
getHoldLockFlag(const Uint32 & requestInfo)345 ScanFragReq::getHoldLockFlag(const Uint32 & requestInfo){
346   return (requestInfo >> SF_HOLD_LOCK_SHIFT) & 1;
347 }
348 
349 inline
350 Uint32
getKeyinfoFlag(const Uint32 & requestInfo)351 ScanFragReq::getKeyinfoFlag(const Uint32 & requestInfo){
352   return (requestInfo >> SF_KEYINFO_SHIFT) & 1;
353 }
354 
355 inline
356 Uint32
getRangeScanFlag(const Uint32 & requestInfo)357 ScanFragReq::getRangeScanFlag(const Uint32 & requestInfo){
358   return (requestInfo >> SF_RANGE_SCAN_SHIFT) & 1;
359 }
360 
361 inline
362 Uint32
getDescendingFlag(const Uint32 & requestInfo)363 ScanFragReq::getDescendingFlag(const Uint32 & requestInfo){
364   return (requestInfo >> SF_DESCENDING_SHIFT) & 1;
365 }
366 
367 inline
368 Uint32
getTupScanFlag(const Uint32 & requestInfo)369 ScanFragReq::getTupScanFlag(const Uint32 & requestInfo){
370   return (requestInfo >> SF_TUP_SCAN_SHIFT) & 1;
371 }
372 
373 inline
374 Uint32
getReadCommittedFlag(const Uint32 & requestInfo)375 ScanFragReq::getReadCommittedFlag(const Uint32 & requestInfo){
376   return (requestInfo >> SF_READ_COMMITTED_SHIFT) & 1;
377 }
378 
379 inline
380 Uint32
getAttrLen(const Uint32 & requestInfo)381 ScanFragReq::getAttrLen(const Uint32 & requestInfo){
382   return (requestInfo >> SF_ATTR_LEN_SHIFT) & SF_ATTR_LEN_MASK;
383 }
384 
385 inline
386 Uint32
getScanPrio(const Uint32 & requestInfo)387 ScanFragReq::getScanPrio(const Uint32 & requestInfo){
388   return (requestInfo >> SF_PRIO_SHIFT) & SF_PRIO_MASK;
389 }
390 
391 inline
392 void
setScanPrio(UintR & requestInfo,UintR val)393 ScanFragReq::setScanPrio(UintR & requestInfo, UintR val){
394   ASSERT_MAX(val, SF_PRIO_MASK, "ScanFragReq::setScanPrio");
395   requestInfo |= (val << SF_PRIO_SHIFT);
396 }
397 
398 inline
399 void
setLockMode(UintR & requestInfo,UintR val)400 ScanFragReq::setLockMode(UintR & requestInfo, UintR val){
401   ASSERT_MAX(val, SF_LOCK_MODE_MASK, "ScanFragReq::setLockMode");
402   requestInfo |= (val << SF_LOCK_MODE_SHIFT);
403 }
404 
405 inline
406 void
setHoldLockFlag(UintR & requestInfo,UintR val)407 ScanFragReq::setHoldLockFlag(UintR & requestInfo, UintR val){
408   ASSERT_BOOL(val, "ScanFragReq::setHoldLockFlag");
409   requestInfo |= (val << SF_HOLD_LOCK_SHIFT);
410 }
411 
412 inline
413 void
setKeyinfoFlag(UintR & requestInfo,UintR val)414 ScanFragReq::setKeyinfoFlag(UintR & requestInfo, UintR val){
415   ASSERT_BOOL(val, "ScanFragReq::setKeyinfoFlag");
416   requestInfo |= (val << SF_KEYINFO_SHIFT);
417 }
418 
419 inline
420 void
setReadCommittedFlag(UintR & requestInfo,UintR val)421 ScanFragReq::setReadCommittedFlag(UintR & requestInfo, UintR val){
422   ASSERT_BOOL(val, "ScanFragReq::setReadCommittedFlag");
423   requestInfo |= (val << SF_READ_COMMITTED_SHIFT);
424 }
425 
426 inline
427 void
setRangeScanFlag(UintR & requestInfo,UintR val)428 ScanFragReq::setRangeScanFlag(UintR & requestInfo, UintR val){
429   ASSERT_BOOL(val, "ScanFragReq::setRangeScanFlag");
430   requestInfo |= (val << SF_RANGE_SCAN_SHIFT);
431 }
432 
433 inline
434 void
setDescendingFlag(UintR & requestInfo,UintR val)435 ScanFragReq::setDescendingFlag(UintR & requestInfo, UintR val){
436   ASSERT_BOOL(val, "ScanFragReq::setDescendingFlag");
437   requestInfo |= (val << SF_DESCENDING_SHIFT);
438 }
439 
440 inline
441 void
setTupScanFlag(UintR & requestInfo,UintR val)442 ScanFragReq::setTupScanFlag(UintR & requestInfo, UintR val){
443   ASSERT_BOOL(val, "ScanFragReq::setTupScanFlag");
444   requestInfo |= (val << SF_TUP_SCAN_SHIFT);
445 }
446 
447 inline
448 void
setAttrLen(UintR & requestInfo,UintR val)449 ScanFragReq::setAttrLen(UintR & requestInfo, UintR val){
450   ASSERT_MAX(val, SF_ATTR_LEN_MASK, "ScanFragReq::setAttrLen");
451   requestInfo |= (val << SF_ATTR_LEN_SHIFT);
452 }
453 
454 inline
455 void
clearAttrLen(Uint32 & requestInfo)456 ScanFragReq::clearAttrLen(Uint32 & requestInfo)
457 {
458   requestInfo &= ~((Uint32)SF_ATTR_LEN_MASK << SF_ATTR_LEN_SHIFT);
459 }
460 
461 inline
462 Uint32
getNoDiskFlag(const Uint32 & requestInfo)463 ScanFragReq::getNoDiskFlag(const Uint32 & requestInfo){
464   return (requestInfo >> SF_NO_DISK_SHIFT) & 1;
465 }
466 
467 inline
468 void
setNoDiskFlag(UintR & requestInfo,UintR val)469 ScanFragReq::setNoDiskFlag(UintR & requestInfo, UintR val){
470   ASSERT_BOOL(val, "ScanFragReq::setNoDiskFlag");
471   requestInfo |= (val << SF_NO_DISK_SHIFT);
472 }
473 
474 inline
475 Uint32
getLcpScanFlag(const Uint32 & requestInfo)476 ScanFragReq::getLcpScanFlag(const Uint32 & requestInfo){
477   return (requestInfo >> SF_LCP_SCAN_SHIFT) & 1;
478 }
479 
480 inline
481 void
setLcpScanFlag(UintR & requestInfo,UintR val)482 ScanFragReq::setLcpScanFlag(UintR & requestInfo, UintR val){
483   ASSERT_BOOL(val, "ScanFragReq::setLcpScanFlag");
484   requestInfo |= (val << SF_LCP_SCAN_SHIFT);
485 }
486 
487 inline
488 Uint32
setScanInfo(Uint32 opNo,Uint32 scanNo)489 KeyInfo20::setScanInfo(Uint32 opNo, Uint32 scanNo){
490   ASSERT_MAX(opNo, 1023, "KeyInfo20::setScanInfo");
491   ASSERT_MAX(scanNo, 255, "KeyInfo20::setScanInfo");
492   return (opNo << 8) + scanNo;
493 }
494 
495 inline
496 Uint32
getScanNo(Uint32 scanInfo)497 KeyInfo20::getScanNo(Uint32 scanInfo){
498   return scanInfo & 0xFF;
499 }
500 
501 inline
502 Uint32
getScanOp(Uint32 scanInfo)503 KeyInfo20::getScanOp(Uint32 scanInfo){
504   return (scanInfo >> 8) & 0x3FF;
505 }
506 
507 inline
508 Uint32
getReorgFlag(const Uint32 & requestInfo)509 ScanFragReq::getReorgFlag(const Uint32 & requestInfo){
510   return (requestInfo >> SF_REORG_SHIFT) & SF_REORG_MASK;
511 }
512 
513 inline
514 void
setReorgFlag(UintR & requestInfo,UintR val)515 ScanFragReq::setReorgFlag(UintR & requestInfo, UintR val){
516   ASSERT_MAX(val, SF_REORG_MASK, "ScanFragReq::setLcpScanFlag");
517   requestInfo |= (val << SF_REORG_SHIFT);
518 }
519 
520 inline
521 Uint32
getCorrFactorFlag(const Uint32 & requestInfo)522 ScanFragReq::getCorrFactorFlag(const Uint32 & requestInfo){
523   return (requestInfo >> SF_CORR_FACTOR_SHIFT) & 1;
524 }
525 
526 inline
527 void
setCorrFactorFlag(UintR & requestInfo,UintR val)528 ScanFragReq::setCorrFactorFlag(UintR & requestInfo, UintR val){
529   ASSERT_BOOL(val, "ScanFragReq::setCorrFactorFlag");
530   requestInfo |= (val << SF_CORR_FACTOR_SHIFT);
531 }
532 
533 inline
534 Uint32
getStatScanFlag(const Uint32 & requestInfo)535 ScanFragReq::getStatScanFlag(const Uint32 & requestInfo){
536   return (requestInfo >> SF_STAT_SCAN_SHIFT) & 1;
537 }
538 
539 inline
540 void
setStatScanFlag(UintR & requestInfo,UintR val)541 ScanFragReq::setStatScanFlag(UintR & requestInfo, UintR val){
542   ASSERT_BOOL(val, "ScanFragReq::setStatScanFlag");
543   requestInfo |= (val << SF_STAT_SCAN_SHIFT);
544 }
545 
546 inline
547 Uint32
getPrioAFlag(const Uint32 & requestInfo)548 ScanFragReq::getPrioAFlag(const Uint32 & requestInfo){
549   return (requestInfo >> SF_PRIO_A_SHIFT) & 1;
550 }
551 
552 inline
553 void
setPrioAFlag(UintR & requestInfo,UintR val)554 ScanFragReq::setPrioAFlag(UintR & requestInfo, UintR val){
555   ASSERT_BOOL(val, "ScanFragReq::setPrioAFlag");
556   requestInfo |= (val << SF_PRIO_A_SHIFT);
557 }
558 
559 inline
560 Uint32
getNotInterpretedFlag(const Uint32 & requestInfo)561 ScanFragReq::getNotInterpretedFlag(const Uint32 & requestInfo)
562 {
563   return (requestInfo >> SF_NOT_INTERPRETED_SHIFT) & 1;
564 }
565 
566 inline
567 void
setNotInterpretedFlag(UintR & requestInfo,UintR val)568 ScanFragReq::setNotInterpretedFlag(UintR & requestInfo, UintR val)
569 {
570   ASSERT_BOOL(val, "ScanFragReq::setStatScanFlag");
571   requestInfo |= (val << SF_NOT_INTERPRETED_SHIFT);
572 }
573 
574 /**
575  * Request Info (SCAN_NEXTREQ)
576  *
577  * c = close                 - 1  Bit 0
578  * C = corr value flag       - 1  Bit 1
579  *
580  *           1111111111222222222233
581  * 01234567890123456789012345678901
582  * cC
583  */
584 #define SFN_CLOSE_SHIFT 0
585 #define SFN_CORR_SHIFT  1
586 #define SFN_PRIO_A_SHIFT 2
587 
588 inline
589 Uint32
getCorrFactorFlag(const Uint32 & ri)590 ScanFragNextReq::getCorrFactorFlag(const Uint32 & ri)
591 {
592   return (ri >> SFN_CORR_SHIFT) & 1;
593 }
594 
595 inline
596 void
setCorrFactorFlag(Uint32 & ri)597 ScanFragNextReq::setCorrFactorFlag(Uint32 & ri)
598 {
599   ri |= (1 << SFN_CORR_SHIFT);
600 }
601 
602 inline
603 Uint32
getCloseFlag(const Uint32 & requestInfo)604 ScanFragNextReq::getCloseFlag(const Uint32 & requestInfo){
605   return requestInfo & 1;
606 }
607 
608 inline
609 void
setCloseFlag(UintR & requestInfo,UintR val)610 ScanFragNextReq::setCloseFlag(UintR & requestInfo, UintR val){
611   ASSERT_BOOL(val, "ScanFragReq::setCloseFlag");
612   requestInfo |= val;
613 }
614 
615 inline
616 Uint32
getPrioAFlag(const Uint32 & requestInfo)617 ScanFragNextReq::getPrioAFlag(const Uint32 & requestInfo){
618   return (requestInfo >> SFN_PRIO_A_SHIFT) & 1;
619 }
620 
621 inline
622 void
setPrioAFlag(UintR & requestInfo,UintR val)623 ScanFragNextReq::setPrioAFlag(UintR & requestInfo, UintR val){
624   ASSERT_BOOL(val, "ScanFragReq::setPrioAFlag");
625   requestInfo |= (val << SFN_PRIO_A_SHIFT);
626 }
627 
628 #undef JAM_FILE_ID
629 
630 #endif
631