CCF
Loading...
Searching...
No Matches
tpcc_tables.h
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the Apache 2.0 License.
3#pragma once
4
5#include "ccf/ds/json.h"
6#include "ccf/ds/nonstd.h"
7#include "ccf/kv/map.h"
9#include "ds/serialized.h"
10#include "tpcc_common.h"
11
12#include <cstring>
13#include <nlohmann/json.hpp>
14#include <stdint.h>
15#include <unordered_map>
16#include <unordered_set>
17#include <vector>
18
19namespace tpcc
20{
21 template <typename T>
23
24 template <typename T>
26
27 template <typename T>
28 constexpr size_t serialised_size()
29 {
31 {
32 return std::tuple_size_v<T> * serialised_size<typename T::value_type>();
33 }
34 else
35 {
36 return sizeof(T);
37 }
38 }
39
40 template <typename T>
41 void write_value(const T& v, uint8_t*& data, size_t& size)
42 {
44 {
45 if constexpr (std::is_integral_v<typename T::value_type>)
46 {
48 data, size, (const uint8_t*)v.data(), serialised_size<T>());
49 }
50 else
51 {
52 for (const auto& e : v)
53 {
54 write_value(e, data, size);
55 }
56 }
57 }
58 else
59 {
60 serialized::write(data, size, v);
61 }
62 }
63
64 template <typename T>
65 void read_value(T& v, const uint8_t*& data, size_t& size)
66 {
68 {
69 if constexpr (std::is_integral_v<typename T::value_type>)
70 {
71 constexpr auto n = serialised_size<T>();
72 memcpy(v.data(), data, n);
73 serialized::skip(data, size, n);
74 }
75 else
76 {
77 for (auto& e : v)
78 {
79 read_value(e, data, size);
80 }
81 }
82 }
83 else
84 {
85 v = serialized::read<T>(data, size);
86 }
87 }
88
89#pragma clang diagnostic push
90#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
91#define ADD_SERIALIZED_SIZE_FOR_JSON_NEXT(TYPE, FIELD) \
92 +serialised_size<decltype(TYPE::FIELD)>()
93#define ADD_SERIALIZED_SIZE_FOR_JSON_FINAL(TYPE, FIELD) \
94 ADD_SERIALIZED_SIZE_FOR_JSON_NEXT(TYPE, FIELD)
95
96#define WRITE_VALUE_FOR_JSON_NEXT(TYPE, FIELD) write_value(t.FIELD, data, size);
97#define WRITE_VALUE_FOR_JSON_FINAL(TYPE, FIELD) \
98 WRITE_VALUE_FOR_JSON_NEXT(TYPE, FIELD)
99
100#define READ_VALUE_FOR_JSON_NEXT(TYPE, FIELD) read_value(t.FIELD, data, size);
101#define READ_VALUE_FOR_JSON_FINAL(TYPE, FIELD) \
102 READ_VALUE_FOR_JSON_NEXT(TYPE, FIELD)
103
104#define DECLARE_TPCC_TYPE(TYPE)
105#define DECLARE_TPCC_REQUIRED_FIELDS(TYPE, ...) \
106 _Pragma("clang diagnostic push"); \
107 _Pragma("clang diagnostic ignored \"-Wgnu-zero-variadic-macro-arguments\""); \
108 template <> \
109 ccf::kv::serialisers::SerialisedEntry tpcc_serialise(const TYPE& t) \
110 { \
111 ccf::kv::serialisers::SerialisedEntry rep; \
112 constexpr size_t required_size = 0 _FOR_JSON_COUNT_NN(__VA_ARGS__)(POP1)( \
113 ADD_SERIALIZED_SIZE, TYPE, ##__VA_ARGS__); \
114 rep.resize(required_size); \
115 auto data = rep.data(); \
116 auto size = rep.size(); \
117 _FOR_JSON_COUNT_NN(__VA_ARGS__)(POP1)(WRITE_VALUE, TYPE, ##__VA_ARGS__); \
118 return rep; \
119 } \
120 template <> \
121 TYPE tpcc_deserialise(const ccf::kv::serialisers::SerialisedEntry& rep) \
122 { \
123 auto data = rep.data(); \
124 auto size = rep.size(); \
125 TYPE t; \
126 _FOR_JSON_COUNT_NN(__VA_ARGS__)(POP1)(READ_VALUE, TYPE, ##__VA_ARGS__); \
127 return t; \
128 } \
129 _Pragma("clang diagnostic pop");
130#pragma clang diagnostic pop
131
132 template <typename T>
134 {
136 {
137 return tpcc_serialise(t);
138 }
139
141 {
142 return tpcc_deserialise<T>(rep);
143 }
144 };
145
146 namespace Address
147 {
148 static const int MIN_STREET = 10;
149 static const int MAX_STREET = 20;
150 static const int MIN_CITY = 10;
151 static const int MAX_CITY = 20;
152 static const int STATE = 2;
153 static const int ZIP = 9;
154 };
155
156 struct Item
157 {
158 static const int MIN_IM = 1;
159 static const int MAX_IM = 10000;
160 static constexpr float MIN_PRICE = 1.00;
161 static constexpr float MAX_PRICE = 100.00;
162 static const int MIN_NAME = 14;
163 static const int MAX_NAME = 24;
164 static const int MIN_DATA = 26;
165 static const int MAX_DATA = 50;
166 static const int NUM_ITEMS = 100000;
167
168 struct Key
169 {
170 int32_t id;
171 };
172
174 {
175 return {id};
176 }
177
178 int32_t id;
179 int32_t im_id;
180 float price;
181 std::array<char, MAX_NAME + 1> name = {0};
182 std::array<char, MAX_DATA + 1> data = {0};
183 };
187 DECLARE_TPCC_REQUIRED_FIELDS(Item, id, im_id, price, name, data);
188
190 {
191 static constexpr float MIN_TAX = 0;
192 static constexpr float MAX_TAX = 0.2000f;
193 static constexpr float INITIAL_YTD = 300000.00f;
194 static const int MIN_NAME = 6;
195 static const int MAX_NAME = 10;
196 // TPC-C 1.3.1 (page 11) requires 2*W. This permits testing up to 50
197 // warehouses. This is an arbitrary limit created to pack ids into integers.
198 static const int MAX_WAREHOUSE_ID = 100;
199 struct Key
200 {
201 int32_t id;
202 };
203
205 {
206 return {id};
207 }
208
209 int32_t id;
210 float tax;
211 float ytd;
212 std::array<char, MAX_NAME + 1> name = {0};
213 std::array<char, Address::MAX_STREET + 1> street_1 = {0};
214 std::array<char, Address::MAX_STREET + 1> street_2 = {0};
215 std::array<char, Address::MAX_STREET + 1> city = {0};
216 std::array<char, Address::STATE + 1> state = {0};
217 std::array<char, Address::ZIP + 1> zip = {0};
218 };
223 Warehouse, id, tax, ytd, name, street_1, street_2, city, state, zip);
224
225 struct District
226 {
227 static constexpr float MIN_TAX = 0;
228 static constexpr float MAX_TAX = 0.2000f;
229 static constexpr float INITIAL_YTD = 30000.00;
230 static const int INITIAL_NEXT_O_ID = 3001;
231 static const int MIN_NAME = 6;
232 static const int MAX_NAME = 10;
233 static const int NUM_PER_WAREHOUSE = 10;
234
235 struct Key
236 {
237 int32_t id;
238 int32_t w_id;
239 };
240
241 int32_t id;
242 int32_t w_id;
243 float tax;
244 float ytd;
245 int32_t next_o_id;
246 std::array<char, MAX_NAME + 1> name = {0};
247 std::array<char, Address::MAX_STREET + 1> street_1 = {0};
248 std::array<char, Address::MAX_STREET + 1> street_2 = {0};
249 std::array<char, Address::MAX_CITY + 1> city = {0};
250 std::array<char, Address::STATE + 1> state = {0};
251 std::array<char, Address::ZIP + 1> zip = {0};
252
254 {
255 return {id, w_id};
256 }
257 };
258
263 District,
264 id,
265 w_id,
266 tax,
267 ytd,
268 next_o_id,
269 name,
270 street_1,
271 street_2,
272 city,
273 state,
274 zip);
275
276 struct Stock
277 {
278 static const int MIN_QUANTITY = 10;
279 static const int MAX_QUANTITY = 100;
280 static const int DIST = 24;
281 static const int MIN_DATA = 26;
282 static const int MAX_DATA = 50;
283 static const int NUM_STOCK_PER_WAREHOUSE = 100000;
284
285 int32_t i_id;
286 int32_t w_id;
287 int32_t quantity;
288 int32_t ytd;
289 int32_t order_cnt;
290 int32_t remote_cnt;
291 std::array<std::array<char, DIST + 1>, District::NUM_PER_WAREHOUSE> dist =
292 {};
293 std::array<char, MAX_DATA + 1> data = {0};
294
295 struct Key
296 {
297 int32_t i_id;
298 int32_t w_id;
299 };
300
302 {
303 return {i_id, w_id};
304 }
305 };
310 Stock, i_id, w_id, quantity, ytd, order_cnt, remote_cnt, dist, data);
311
312 struct Customer
313 {
314 static constexpr float INITIAL_CREDIT_LIM = 50000.00;
315 static constexpr float MIN_DISCOUNT = 0.0000;
316 static constexpr float MAX_DISCOUNT = 0.5000;
317 static constexpr float INITIAL_BALANCE = -10.00;
318 static constexpr float INITIAL_YTD_PAYMENT = 10.00;
319 static const int INITIAL_PAYMENT_CNT = 1;
320 static const int INITIAL_DELIVERY_CNT = 0;
321 static const int MIN_FIRST = 6;
322 static const int MAX_FIRST = 10;
323 static const int MIDDLE = 2;
324 static const int MAX_LAST = 16;
325 static const int PHONE = 16;
326 static const int CREDIT = 2;
327 static const int MIN_DATA = 300;
328 static const int MAX_DATA = 500;
329 static const int NUM_PER_DISTRICT = 3000;
330 static constexpr char GOOD_CREDIT[] = "GC";
331 static constexpr char BAD_CREDIT[] = "BC";
332
333 struct Key
334 {
335 int32_t id;
336 };
337
339 {
340 return {id};
341 }
342
343 int32_t id;
344 int32_t d_id;
345 int32_t w_id;
347 float discount;
348 float balance;
350 int32_t payment_cnt;
352 std::array<char, MAX_FIRST + 1> first = {0};
353 std::array<char, MIDDLE + 1> middle = {0};
354 std::array<char, MAX_LAST + 1> last = {0};
355 std::array<char, Address::MAX_STREET + 1> street_1 = {0};
356 std::array<char, Address::MAX_STREET + 1> street_2 = {0};
357 std::array<char, Address::MAX_CITY + 1> city = {0};
358 std::array<char, Address::STATE + 1> state = {0};
359 std::array<char, Address::ZIP + 1> zip = {0};
360 std::array<char, PHONE + 1> phone = {0};
361 std::array<char, DATETIME_SIZE + 1> since = {0};
362 std::array<char, CREDIT + 1> credit = {0};
363 std::array<char, MAX_DATA + 1> data = {0};
364 };
365
370 Customer,
371 id,
372 d_id,
373 w_id,
374 credit_lim,
375 discount,
376 balance,
377 ytd_payment,
378 payment_cnt,
379 delivery_cnt,
380 first,
381 middle,
382 last,
383 street_1,
384 street_2,
385 city,
386 state,
387 zip,
388 phone,
389 since,
390 credit,
391 data);
392
393 struct Order
394 {
395 static const int MIN_CARRIER_ID = 1;
396 static const int MAX_CARRIER_ID = 10;
397 static const int NULL_CARRIER_ID = 0;
398 static const int NULL_CARRIER_LOWER_BOUND = 2101;
399 static const int MIN_OL_CNT = 5;
400 static const int MAX_OL_CNT = 15;
401 static const int INITIAL_ALL_LOCAL = 1;
402 static const int INITIAL_ORDERS_PER_DISTRICT = 3000;
403 // See TPC-C 1.3.1 (page 15)
404 static const int MAX_ORDER_ID = 10000000;
405
406 struct Key
407 {
408 int32_t id;
409 };
410
412 {
413 return {id};
414 }
415
416 int32_t id;
417 int32_t c_id;
418 int32_t d_id;
419 int32_t w_id;
420 int32_t carrier_id;
421 int32_t ol_cnt;
422 int32_t all_local;
423 std::array<char, DATETIME_SIZE + 1> entry_d = {0};
424 };
429 Order, id, c_id, d_id, w_id, carrier_id, ol_cnt, all_local, entry_d);
430
432 {
433 static const int MIN_I_ID = 1;
434 static const int MAX_I_ID = 100;
435 static const int INITIAL_QUANTITY = 5;
436 static constexpr float MIN_AMOUNT = 0.01f;
437 static constexpr float MAX_AMOUNT = 9999.99f;
438 static const int REMOTE_PROBABILITY_MILLIS = 10;
439
440 struct Key
441 {
442 int32_t o_id;
443 int32_t d_id;
444 int32_t w_id;
445 int32_t number;
446 };
447
449 {
450 return {o_id, d_id, w_id, number};
451 }
452
453 int32_t o_id;
454 int32_t d_id;
455 int32_t w_id;
456 int32_t number;
457 int32_t i_id;
458 int32_t supply_w_id;
459 int32_t quantity;
460 float amount;
461 std::array<char, DATETIME_SIZE + 1> delivery_d = {0};
462 std::array<char, Stock::DIST + 1> dist_info = {0};
463 };
464
469 OrderLine,
470 o_id,
471 d_id,
472 w_id,
473 number,
474 i_id,
475 supply_w_id,
476 quantity,
477 amount,
478 delivery_d,
479 dist_info);
480
481 struct NewOrder
482 {
483 static const int INITIAL_NUM_PER_DISTRICT = 900;
484
485 struct Key
486 {
487 int32_t w_id;
488 int32_t d_id;
489 int32_t o_id;
490 };
491
493 {
494 return {w_id, d_id, o_id};
495 }
496
497 int32_t w_id;
498 int32_t d_id;
499 int32_t o_id;
500 };
505
506 struct History
507 {
508 static const int MIN_DATA = 12;
509 static const int MAX_DATA = 24;
510 static constexpr float INITIAL_AMOUNT = 10.00f;
511
512 struct Key
513 {
514 int32_t c_id;
515 int32_t c_d_id;
516 int32_t c_w_id;
517 int32_t d_id;
518 int32_t w_id;
519 };
520
522 {
523 return {c_id, c_d_id, c_w_id, d_id, w_id};
524 }
525
526 int32_t c_id;
527 int32_t c_d_id;
528 int32_t c_w_id;
529 int32_t d_id;
530 int32_t w_id;
531 float amount;
532 std::array<char, DATETIME_SIZE + 1> date = {0};
533 std::array<char, MAX_DATA + 1> data = {0};
534 };
536 DECLARE_TPCC_REQUIRED_FIELDS(History::Key, c_id, c_d_id, c_w_id, d_id, w_id);
539 History, c_id, c_d_id, c_w_id, d_id, w_id, amount, date, data);
540
541 template <typename K, typename V>
543
545 {
547 {
548 struct
549 {
550 int32_t w_id;
551 int32_t d_id;
552 } v;
553 uint64_t k;
554 };
555 static_assert(
556 sizeof(DistributeKey) == sizeof(uint64_t),
557 "Distribute key is the wrong size");
558
563 static std::unordered_map<uint64_t, TpccMap<Customer::Key, Customer>>
565 static std::unordered_map<uint64_t, TpccMap<Order::Key, Order>> orders;
567 static std::unordered_map<uint64_t, TpccMap<NewOrder::Key, NewOrder>>
570 };
571}
Definition map.h:30
ccf::ByteVector SerialisedEntry
Definition serialised_entry.h:8
void write(uint8_t *&data, size_t &size, const T &v)
Definition serialized.h:106
void skip(const uint8_t *&data, size_t &size, size_t skip)
Definition serialized.h:166
Definition tpcc_common.h:8
void write_value(const T &v, uint8_t *&data, size_t &size)
Definition tpcc_tables.h:41
T tpcc_deserialise(const ccf::kv::serialisers::SerialisedEntry &rep)
void read_value(T &v, const uint8_t *&data, size_t &size)
Definition tpcc_tables.h:65
ccf::kv::serialisers::SerialisedEntry tpcc_serialise(const T &t)
constexpr size_t serialised_size()
Definition tpcc_tables.h:28
Definition nonstd.h:39
Definition tpcc_tables.h:334
int32_t id
Definition tpcc_tables.h:335
Definition tpcc_tables.h:313
float balance
Definition tpcc_tables.h:348
std::array< char, CREDIT+1 > credit
Definition tpcc_tables.h:362
int32_t id
Definition tpcc_tables.h:343
static const int INITIAL_PAYMENT_CNT
Definition tpcc_tables.h:319
Key get_key()
Definition tpcc_tables.h:338
std::array< char, MIDDLE+1 > middle
Definition tpcc_tables.h:353
std::array< char, MAX_DATA+1 > data
Definition tpcc_tables.h:363
static const int MAX_FIRST
Definition tpcc_tables.h:322
float ytd_payment
Definition tpcc_tables.h:349
static constexpr float INITIAL_BALANCE
Definition tpcc_tables.h:317
static const int MAX_LAST
Definition tpcc_tables.h:324
static constexpr float INITIAL_CREDIT_LIM
Definition tpcc_tables.h:314
int32_t w_id
Definition tpcc_tables.h:345
static const int NUM_PER_DISTRICT
Definition tpcc_tables.h:329
static constexpr float MIN_DISCOUNT
Definition tpcc_tables.h:315
int32_t payment_cnt
Definition tpcc_tables.h:350
static const int MIN_FIRST
Definition tpcc_tables.h:321
std::array< char, Address::ZIP+1 > zip
Definition tpcc_tables.h:359
static constexpr char BAD_CREDIT[]
Definition tpcc_tables.h:331
static constexpr float MAX_DISCOUNT
Definition tpcc_tables.h:316
static const int CREDIT
Definition tpcc_tables.h:326
std::array< char, Address::MAX_STREET+1 > street_1
Definition tpcc_tables.h:355
int32_t delivery_cnt
Definition tpcc_tables.h:351
std::array< char, Address::STATE+1 > state
Definition tpcc_tables.h:358
static const int MIN_DATA
Definition tpcc_tables.h:327
float credit_lim
Definition tpcc_tables.h:346
static constexpr float INITIAL_YTD_PAYMENT
Definition tpcc_tables.h:318
std::array< char, PHONE+1 > phone
Definition tpcc_tables.h:360
std::array< char, Address::MAX_CITY+1 > city
Definition tpcc_tables.h:357
float discount
Definition tpcc_tables.h:347
std::array< char, Address::MAX_STREET+1 > street_2
Definition tpcc_tables.h:356
std::array< char, DATETIME_SIZE+1 > since
Definition tpcc_tables.h:361
static constexpr char GOOD_CREDIT[]
Definition tpcc_tables.h:330
static const int MIDDLE
Definition tpcc_tables.h:323
static const int MAX_DATA
Definition tpcc_tables.h:328
static const int INITIAL_DELIVERY_CNT
Definition tpcc_tables.h:320
std::array< char, MAX_FIRST+1 > first
Definition tpcc_tables.h:352
std::array< char, MAX_LAST+1 > last
Definition tpcc_tables.h:354
int32_t d_id
Definition tpcc_tables.h:344
static const int PHONE
Definition tpcc_tables.h:325
Definition tpcc_tables.h:236
int32_t id
Definition tpcc_tables.h:237
int32_t w_id
Definition tpcc_tables.h:238
Definition tpcc_tables.h:226
std::array< char, Address::MAX_STREET+1 > street_1
Definition tpcc_tables.h:247
static const int NUM_PER_WAREHOUSE
Definition tpcc_tables.h:233
Key get_key()
Definition tpcc_tables.h:253
std::array< char, Address::ZIP+1 > zip
Definition tpcc_tables.h:251
float tax
Definition tpcc_tables.h:243
int32_t next_o_id
Definition tpcc_tables.h:245
float ytd
Definition tpcc_tables.h:244
std::array< char, Address::STATE+1 > state
Definition tpcc_tables.h:250
static const int MAX_NAME
Definition tpcc_tables.h:232
int32_t w_id
Definition tpcc_tables.h:242
static constexpr float MIN_TAX
Definition tpcc_tables.h:227
static const int MIN_NAME
Definition tpcc_tables.h:231
static constexpr float INITIAL_YTD
Definition tpcc_tables.h:229
static const int INITIAL_NEXT_O_ID
Definition tpcc_tables.h:230
static constexpr float MAX_TAX
Definition tpcc_tables.h:228
std::array< char, Address::MAX_STREET+1 > street_2
Definition tpcc_tables.h:248
std::array< char, MAX_NAME+1 > name
Definition tpcc_tables.h:246
std::array< char, Address::MAX_CITY+1 > city
Definition tpcc_tables.h:249
int32_t id
Definition tpcc_tables.h:241
Definition tpcc_tables.h:513
int32_t w_id
Definition tpcc_tables.h:518
int32_t c_id
Definition tpcc_tables.h:514
int32_t d_id
Definition tpcc_tables.h:517
int32_t c_w_id
Definition tpcc_tables.h:516
int32_t c_d_id
Definition tpcc_tables.h:515
Definition tpcc_tables.h:507
static constexpr float INITIAL_AMOUNT
Definition tpcc_tables.h:510
int32_t w_id
Definition tpcc_tables.h:530
Key get_key()
Definition tpcc_tables.h:521
int32_t c_id
Definition tpcc_tables.h:526
static const int MAX_DATA
Definition tpcc_tables.h:509
int32_t c_w_id
Definition tpcc_tables.h:528
int32_t d_id
Definition tpcc_tables.h:529
int32_t c_d_id
Definition tpcc_tables.h:527
static const int MIN_DATA
Definition tpcc_tables.h:508
std::array< char, MAX_DATA+1 > data
Definition tpcc_tables.h:533
std::array< char, DATETIME_SIZE+1 > date
Definition tpcc_tables.h:532
float amount
Definition tpcc_tables.h:531
Definition tpcc_tables.h:169
int32_t id
Definition tpcc_tables.h:170
Definition tpcc_tables.h:157
float price
Definition tpcc_tables.h:180
int32_t im_id
Definition tpcc_tables.h:179
std::array< char, MAX_DATA+1 > data
Definition tpcc_tables.h:182
static const int MIN_DATA
Definition tpcc_tables.h:164
static constexpr float MAX_PRICE
Definition tpcc_tables.h:161
int32_t id
Definition tpcc_tables.h:178
Key get_key()
Definition tpcc_tables.h:173
static const int MAX_NAME
Definition tpcc_tables.h:163
static const int MIN_NAME
Definition tpcc_tables.h:162
static constexpr float MIN_PRICE
Definition tpcc_tables.h:160
static const int MAX_DATA
Definition tpcc_tables.h:165
static const int MIN_IM
Definition tpcc_tables.h:158
static const int NUM_ITEMS
Definition tpcc_tables.h:166
static const int MAX_IM
Definition tpcc_tables.h:159
std::array< char, MAX_NAME+1 > name
Definition tpcc_tables.h:181
Definition tpcc_tables.h:486
int32_t w_id
Definition tpcc_tables.h:487
int32_t d_id
Definition tpcc_tables.h:488
int32_t o_id
Definition tpcc_tables.h:489
Definition tpcc_tables.h:482
int32_t w_id
Definition tpcc_tables.h:497
Key get_key()
Definition tpcc_tables.h:492
static const int INITIAL_NUM_PER_DISTRICT
Definition tpcc_tables.h:483
int32_t o_id
Definition tpcc_tables.h:499
int32_t d_id
Definition tpcc_tables.h:498
Definition tpcc_tables.h:441
int32_t w_id
Definition tpcc_tables.h:444
int32_t number
Definition tpcc_tables.h:445
int32_t d_id
Definition tpcc_tables.h:443
int32_t o_id
Definition tpcc_tables.h:442
Definition tpcc_tables.h:432
int32_t supply_w_id
Definition tpcc_tables.h:458
Key get_key()
Definition tpcc_tables.h:448
static const int MAX_I_ID
Definition tpcc_tables.h:434
std::array< char, Stock::DIST+1 > dist_info
Definition tpcc_tables.h:462
static constexpr float MIN_AMOUNT
Definition tpcc_tables.h:436
int32_t o_id
Definition tpcc_tables.h:453
int32_t number
Definition tpcc_tables.h:456
std::array< char, DATETIME_SIZE+1 > delivery_d
Definition tpcc_tables.h:461
int32_t quantity
Definition tpcc_tables.h:459
int32_t d_id
Definition tpcc_tables.h:454
float amount
Definition tpcc_tables.h:460
int32_t i_id
Definition tpcc_tables.h:457
static const int MIN_I_ID
Definition tpcc_tables.h:433
static constexpr float MAX_AMOUNT
Definition tpcc_tables.h:437
int32_t w_id
Definition tpcc_tables.h:455
static const int INITIAL_QUANTITY
Definition tpcc_tables.h:435
static const int REMOTE_PROBABILITY_MILLIS
Definition tpcc_tables.h:438
Definition tpcc_tables.h:407
int32_t id
Definition tpcc_tables.h:408
Definition tpcc_tables.h:394
Key get_key()
Definition tpcc_tables.h:411
static const int MAX_ORDER_ID
Definition tpcc_tables.h:404
int32_t w_id
Definition tpcc_tables.h:419
int32_t carrier_id
Definition tpcc_tables.h:420
int32_t c_id
Definition tpcc_tables.h:417
static const int MAX_OL_CNT
Definition tpcc_tables.h:400
int32_t id
Definition tpcc_tables.h:416
std::array< char, DATETIME_SIZE+1 > entry_d
Definition tpcc_tables.h:423
static const int MAX_CARRIER_ID
Definition tpcc_tables.h:396
int32_t d_id
Definition tpcc_tables.h:418
static const int INITIAL_ORDERS_PER_DISTRICT
Definition tpcc_tables.h:402
int32_t all_local
Definition tpcc_tables.h:422
static const int MIN_CARRIER_ID
Definition tpcc_tables.h:395
static const int MIN_OL_CNT
Definition tpcc_tables.h:399
static const int NULL_CARRIER_ID
Definition tpcc_tables.h:397
static const int NULL_CARRIER_LOWER_BOUND
Definition tpcc_tables.h:398
int32_t ol_cnt
Definition tpcc_tables.h:421
static const int INITIAL_ALL_LOCAL
Definition tpcc_tables.h:401
Definition tpcc_tables.h:296
int32_t w_id
Definition tpcc_tables.h:298
int32_t i_id
Definition tpcc_tables.h:297
Definition tpcc_tables.h:277
int32_t ytd
Definition tpcc_tables.h:288
int32_t order_cnt
Definition tpcc_tables.h:289
int32_t quantity
Definition tpcc_tables.h:287
static const int MAX_DATA
Definition tpcc_tables.h:282
std::array< std::array< char, DIST+1 >, District::NUM_PER_WAREHOUSE > dist
Definition tpcc_tables.h:291
int32_t i_id
Definition tpcc_tables.h:285
static const int NUM_STOCK_PER_WAREHOUSE
Definition tpcc_tables.h:283
Key get_key()
Definition tpcc_tables.h:301
static const int MAX_QUANTITY
Definition tpcc_tables.h:279
static const int MIN_QUANTITY
Definition tpcc_tables.h:278
int32_t remote_cnt
Definition tpcc_tables.h:290
std::array< char, MAX_DATA+1 > data
Definition tpcc_tables.h:293
static const int DIST
Definition tpcc_tables.h:280
static const int MIN_DATA
Definition tpcc_tables.h:281
int32_t w_id
Definition tpcc_tables.h:286
Definition tpcc_tables.h:134
static ccf::kv::serialisers::SerialisedEntry to_serialised(const T &t)
Definition tpcc_tables.h:135
static T from_serialised(const ccf::kv::serialisers::SerialisedEntry &rep)
Definition tpcc_tables.h:140
Definition tpcc_tables.h:545
static std::unordered_map< uint64_t, TpccMap< Order::Key, Order > > orders
Definition tpcc_tables.h:565
static TpccMap< Stock::Key, Stock > stocks
Definition tpcc_tables.h:559
static std::unordered_map< uint64_t, TpccMap< NewOrder::Key, NewOrder > > new_orders
Definition tpcc_tables.h:568
static TpccMap< District::Key, District > districts
Definition tpcc_tables.h:561
static TpccMap< OrderLine::Key, OrderLine > order_lines
Definition tpcc_tables.h:566
static TpccMap< History::Key, History > histories
Definition tpcc_tables.h:562
static TpccMap< Warehouse::Key, Warehouse > warehouses
Definition tpcc_tables.h:560
static std::unordered_map< uint64_t, TpccMap< Customer::Key, Customer > > customers
Definition tpcc_tables.h:564
static TpccMap< Item::Key, Item > items
Definition tpcc_tables.h:569
Definition tpcc_tables.h:200
int32_t id
Definition tpcc_tables.h:201
Definition tpcc_tables.h:190
std::array< char, Address::ZIP+1 > zip
Definition tpcc_tables.h:217
std::array< char, MAX_NAME+1 > name
Definition tpcc_tables.h:212
Key get_key()
Definition tpcc_tables.h:204
static constexpr float MAX_TAX
Definition tpcc_tables.h:192
static const int MAX_NAME
Definition tpcc_tables.h:195
static const int MAX_WAREHOUSE_ID
Definition tpcc_tables.h:198
float ytd
Definition tpcc_tables.h:211
std::array< char, Address::MAX_STREET+1 > city
Definition tpcc_tables.h:215
std::array< char, Address::MAX_STREET+1 > street_2
Definition tpcc_tables.h:214
static constexpr float MIN_TAX
Definition tpcc_tables.h:191
std::array< char, Address::STATE+1 > state
Definition tpcc_tables.h:216
int32_t id
Definition tpcc_tables.h:209
static const int MIN_NAME
Definition tpcc_tables.h:194
float tax
Definition tpcc_tables.h:210
static constexpr float INITIAL_YTD
Definition tpcc_tables.h:193
std::array< char, Address::MAX_STREET+1 > street_1
Definition tpcc_tables.h:213
#define DECLARE_TPCC_REQUIRED_FIELDS(TYPE,...)
Definition tpcc_tables.h:105
#define DECLARE_TPCC_TYPE(TYPE)
Definition tpcc_tables.h:104
Definition tpcc_tables.h:547
int32_t d_id
Definition tpcc_tables.h:551
int32_t w_id
Definition tpcc_tables.h:550
struct tpcc::TpccTables::DistributeKey::@2 v
uint64_t k
Definition tpcc_tables.h:553