BaseQuery * TPCCQueryGenerator::create_query(Workload * h_wl,uint64_t home_partition_id) { double x = (double)(rand() % 100) / 100.0; if (x < g_perc_payment) return gen_payment(home_partition_id); else return gen_new_order(home_partition_id); }
void tpcc_query::init(uint64_t thd_id, workload * h_wl) { double x = (double)(rand() % 100) / 100.0; part_to_access = (uint64_t *) mem_allocator.alloc(sizeof(uint64_t) * g_part_cnt, thd_id); if (x < g_perc_payment) gen_payment(thd_id); else gen_new_order(thd_id); }