22 #include "SignalData.hpp"
47 friend bool printSCANTABREQ(FILE * output,
const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo);
81 UintR tableSchemaVersion;
86 UintR batch_byte_size;
87 UintR first_batch_size;
92 Uint32 distributionKey;
97 static Uint8 getParallelism(
const UintR & requestInfo);
98 static Uint8 getLockMode(
const UintR & requestInfo);
99 static Uint8 getHoldLockFlag(
const UintR & requestInfo);
100 static Uint8 getReadCommittedFlag(
const UintR & requestInfo);
101 static Uint8 getRangeScanFlag(
const UintR & requestInfo);
102 static Uint8 getDescendingFlag(
const UintR & requestInfo);
103 static Uint8 getTupScanFlag(
const UintR & requestInfo);
104 static Uint8 getKeyinfoFlag(
const UintR & requestInfo);
105 static Uint16 getScanBatch(
const UintR & requestInfo);
106 static Uint8 getDistributionKeyFlag(
const UintR & requestInfo);
107 static UintR getNoDiskFlag(
const UintR & requestInfo);
108 static Uint32 getViaSPJFlag(
const Uint32 & requestInfo);
109 static Uint32 getPassAllConfsFlag(
const Uint32 & requestInfo);
110 static Uint32 get4WordConf(
const Uint32&);
115 static void clearRequestInfo(UintR & requestInfo);
116 static void setParallelism(UintR & requestInfo, Uint32 flag);
117 static void setLockMode(UintR & requestInfo, Uint32 flag);
118 static void setHoldLockFlag(UintR & requestInfo, Uint32 flag);
119 static void setReadCommittedFlag(UintR & requestInfo, Uint32 flag);
120 static void setRangeScanFlag(UintR & requestInfo, Uint32 flag);
121 static void setDescendingFlag(UintR & requestInfo, Uint32 flag);
122 static void setTupScanFlag(UintR & requestInfo, Uint32 flag);
123 static void setKeyinfoFlag(UintR & requestInfo, Uint32 flag);
124 static void setScanBatch(Uint32& requestInfo, Uint32 sz);
125 static void setDistributionKeyFlag(Uint32& requestInfo, Uint32 flag);
126 static void setNoDiskFlag(UintR & requestInfo, UintR val);
127 static void setViaSPJFlag(Uint32 & requestInfo, Uint32 val);
128 static void setPassAllConfsFlag(Uint32 & requestInfo, Uint32 val);
129 static void set4WordConf(Uint32 & requestInfo, Uint32 val);
159 #define PARALLEL_SHIFT (0)
160 #define PARALLEL_MASK (255)
162 #define LOCK_MODE_SHIFT (8)
163 #define LOCK_MODE_MASK (1)
165 #define HOLD_LOCK_SHIFT (10)
166 #define HOLD_LOCK_MASK (1)
168 #define KEYINFO_SHIFT (12)
169 #define KEYINFO_MASK (1)
171 #define READ_COMMITTED_SHIFT (11)
172 #define READ_COMMITTED_MASK (1)
174 #define RANGE_SCAN_SHIFT (15)
175 #define RANGE_SCAN_MASK (1)
177 #define DESCENDING_SHIFT (14)
178 #define DESCENDING_MASK (1)
180 #define TUP_SCAN_SHIFT (13)
181 #define TUP_SCAN_MASK (1)
183 #define SCAN_BATCH_SHIFT (16)
184 #define SCAN_BATCH_MASK (1023)
186 #define SCAN_DISTR_KEY_SHIFT (26)
187 #define SCAN_DISTR_KEY_MASK (1)
189 #define SCAN_NODISK_SHIFT (9)
190 #define SCAN_NODISK_MASK (1)
192 #define SCAN_SPJ_SHIFT (27)
193 #define SCAN_PASS_CONF_SHIFT (28)
194 #define SCAN_4WORD_CONF_SHIFT (29)
198 ScanTabReq::getParallelism(
const UintR & requestInfo){
199 return (Uint8)((requestInfo >> PARALLEL_SHIFT) & PARALLEL_MASK);
204 ScanTabReq::getLockMode(
const UintR & requestInfo){
205 return (Uint8)((requestInfo >> LOCK_MODE_SHIFT) &
LOCK_MODE_MASK);
210 ScanTabReq::getHoldLockFlag(
const UintR & requestInfo){
211 return (Uint8)((requestInfo >> HOLD_LOCK_SHIFT) & HOLD_LOCK_MASK);
216 ScanTabReq::getReadCommittedFlag(
const UintR & requestInfo){
217 return (Uint8)((requestInfo >> READ_COMMITTED_SHIFT) & READ_COMMITTED_MASK);
222 ScanTabReq::getRangeScanFlag(
const UintR & requestInfo){
223 return (Uint8)((requestInfo >> RANGE_SCAN_SHIFT) & RANGE_SCAN_MASK);
228 ScanTabReq::getDescendingFlag(
const UintR & requestInfo){
229 return (Uint8)((requestInfo >> DESCENDING_SHIFT) & DESCENDING_MASK);
234 ScanTabReq::getTupScanFlag(
const UintR & requestInfo){
235 return (Uint8)((requestInfo >> TUP_SCAN_SHIFT) & TUP_SCAN_MASK);
240 ScanTabReq::getScanBatch(
const Uint32 & requestInfo){
241 return (Uint16)((requestInfo >> SCAN_BATCH_SHIFT) & SCAN_BATCH_MASK);
246 ScanTabReq::clearRequestInfo(UintR & requestInfo){
252 ScanTabReq::setParallelism(UintR & requestInfo, Uint32
type){
253 ASSERT_MAX(type, PARALLEL_MASK,
"ScanTabReq::setParallelism");
254 requestInfo= (requestInfo & ~(PARALLEL_MASK << PARALLEL_SHIFT)) |
255 ((type & PARALLEL_MASK) << PARALLEL_SHIFT);
260 ScanTabReq::setLockMode(UintR & requestInfo, Uint32
mode){
262 requestInfo= (requestInfo & ~(
LOCK_MODE_MASK << LOCK_MODE_SHIFT)) |
268 ScanTabReq::setHoldLockFlag(UintR & requestInfo, Uint32 flag){
269 ASSERT_BOOL(flag,
"ScanTabReq::setHoldLockFlag");
270 requestInfo= (requestInfo & ~(HOLD_LOCK_MASK << HOLD_LOCK_SHIFT)) |
271 ((flag & HOLD_LOCK_MASK) << HOLD_LOCK_SHIFT);
276 ScanTabReq::setReadCommittedFlag(UintR & requestInfo, Uint32 flag){
277 ASSERT_BOOL(flag,
"ScanTabReq::setReadCommittedFlag");
278 requestInfo= (requestInfo & ~(READ_COMMITTED_MASK << READ_COMMITTED_SHIFT)) |
279 ((flag & READ_COMMITTED_MASK) << READ_COMMITTED_SHIFT);
284 ScanTabReq::setRangeScanFlag(UintR & requestInfo, Uint32 flag){
285 ASSERT_BOOL(flag,
"ScanTabReq::setRangeScanFlag");
286 requestInfo= (requestInfo & ~(RANGE_SCAN_MASK << RANGE_SCAN_SHIFT)) |
287 ((flag & RANGE_SCAN_MASK) << RANGE_SCAN_SHIFT);
292 ScanTabReq::setDescendingFlag(UintR & requestInfo, Uint32 flag){
293 ASSERT_BOOL(flag,
"ScanTabReq::setDescendingFlag");
294 requestInfo= (requestInfo & ~(DESCENDING_MASK << DESCENDING_SHIFT)) |
295 ((flag & DESCENDING_MASK) << DESCENDING_SHIFT);
300 ScanTabReq::setTupScanFlag(UintR & requestInfo, Uint32 flag){
301 ASSERT_BOOL(flag,
"ScanTabReq::setTupScanFlag");
302 requestInfo= (requestInfo & ~(TUP_SCAN_MASK << TUP_SCAN_SHIFT)) |
303 ((flag & TUP_SCAN_MASK) << TUP_SCAN_SHIFT);
308 ScanTabReq::setScanBatch(Uint32 & requestInfo, Uint32 flag){
309 ASSERT_MAX(flag, SCAN_BATCH_MASK,
"ScanTabReq::setScanBatch");
310 requestInfo= (requestInfo & ~(SCAN_BATCH_MASK << SCAN_BATCH_SHIFT)) |
311 ((flag & SCAN_BATCH_MASK) << SCAN_BATCH_SHIFT);
316 ScanTabReq::getKeyinfoFlag(
const UintR & requestInfo){
317 return (Uint8)((requestInfo >> KEYINFO_SHIFT) & KEYINFO_MASK);
322 ScanTabReq::setKeyinfoFlag(UintR & requestInfo, Uint32 flag){
323 ASSERT_BOOL(flag,
"ScanTabReq::setKeyinfoFlag");
324 requestInfo= (requestInfo & ~(KEYINFO_MASK << KEYINFO_SHIFT)) |
325 ((flag & KEYINFO_MASK) << KEYINFO_SHIFT);
330 ScanTabReq::getDistributionKeyFlag(
const UintR & requestInfo){
331 return (Uint8)((requestInfo >> SCAN_DISTR_KEY_SHIFT) & SCAN_DISTR_KEY_MASK);
336 ScanTabReq::setDistributionKeyFlag(UintR & requestInfo, Uint32 flag){
337 ASSERT_BOOL(flag,
"ScanTabReq::setKeyinfoFlag");
338 requestInfo= (requestInfo & ~(SCAN_DISTR_KEY_MASK << SCAN_DISTR_KEY_SHIFT)) |
339 ((flag & SCAN_DISTR_KEY_MASK) << SCAN_DISTR_KEY_SHIFT);
344 ScanTabReq::getNoDiskFlag(
const UintR & requestInfo){
345 return (requestInfo >> SCAN_NODISK_SHIFT) & SCAN_NODISK_MASK;
350 ScanTabReq::setNoDiskFlag(UintR & requestInfo, Uint32 flag){
351 ASSERT_BOOL(flag,
"TcKeyReq::setNoDiskFlag");
352 requestInfo= (requestInfo & ~(SCAN_NODISK_MASK << SCAN_NODISK_SHIFT)) |
353 ((flag & SCAN_NODISK_MASK) << SCAN_NODISK_SHIFT);
358 ScanTabReq::getViaSPJFlag(
const UintR & requestInfo){
359 return (requestInfo >> SCAN_SPJ_SHIFT) & 1;
364 ScanTabReq::setViaSPJFlag(UintR & requestInfo, Uint32 flag){
365 ASSERT_BOOL(flag,
"TcKeyReq::setViaSPJFlag");
366 requestInfo |= (flag << SCAN_SPJ_SHIFT);
371 ScanTabReq::getPassAllConfsFlag(
const UintR & requestInfo){
372 return (requestInfo >> SCAN_PASS_CONF_SHIFT) & 1;
377 ScanTabReq::setPassAllConfsFlag(UintR & requestInfo, Uint32 flag){
378 ASSERT_BOOL(flag,
"TcKeyReq::setPassAllConfs");
379 requestInfo |= (flag << SCAN_PASS_CONF_SHIFT);
384 ScanTabReq::get4WordConf(
const UintR & requestInfo){
385 return (requestInfo >> SCAN_4WORD_CONF_SHIFT) & 1;
390 ScanTabReq::set4WordConf(UintR & requestInfo, Uint32 flag){
391 ASSERT_BOOL(flag,
"TcKeyReq::setPassAllConfs");
392 requestInfo |= (flag << SCAN_4WORD_CONF_SHIFT);
414 friend bool printSCANTABCONF(FILE * output,
const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo);
449 static Uint32 getLength(Uint32 opDataInfo) {
return opDataInfo >> 10; };
450 static Uint32 getRows(Uint32 opDataInfo) {
return opDataInfo & 1023;}
464 #define OPERATIONS_SHIFT (0)
465 #define OPERATIONS_MASK (0xFF)
467 #define STATUS_SHIFT (8)
468 #define STATUS_MASK (0xFF)
490 friend bool printSCANTABREF(FILE * output,
const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo);
548 friend bool printSCANNEXTREQ(FILE * output,
const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo);