Initialize a test context for a single benchmark run.
| 101 | |
| 102 | /// Initialize a test context for a single benchmark run. |
| 103 | void InitializeTestCtx(int num_hosts, int num_blocks, |
| 104 | TReplicaPreference::type replica_preference, TestCtx* test_ctx) { |
| 105 | test_ctx->cluster.reset(new Cluster()); |
| 106 | test_ctx->cluster->AddHosts(num_hosts, true, true); |
| 107 | |
| 108 | test_ctx->schema.reset(new Schema(*test_ctx->cluster)); |
| 109 | test_ctx->schema->AddMultiBlockTable("T0", num_blocks, ReplicaPlacement::LOCAL_ONLY, 3); |
| 110 | |
| 111 | test_ctx->plan.reset(new Plan(*test_ctx->schema)); |
| 112 | test_ctx->plan->SetReplicaPreference(replica_preference); |
| 113 | test_ctx->plan->SetRandomReplica(true); |
| 114 | test_ctx->plan->AddTableScan("T0"); |
| 115 | |
| 116 | test_ctx->result.reset(new Result(*test_ctx->plan)); |
| 117 | |
| 118 | test_ctx->scheduler_wrapper.reset(new SchedulerWrapper(*test_ctx->plan)); |
| 119 | } |
| 120 | |
| 121 | /// This function is passed to the test framework and executes the scheduling method |
| 122 | /// repeatedly. |
no test coverage detected