MCPcopy Create free account
hub / github.com/apache/impala / InitializeTestCtx

Function InitializeTestCtx

be/src/benchmarks/scheduler-benchmark.cc:103–119  ·  view source on GitHub ↗

Initialize a test context for a single benchmark run.

Source from the content-addressed store, hash-verified

101
102/// Initialize a test context for a single benchmark run.
103void 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.

Callers 2

RunClusterSizeBenchmarkFunction · 0.85
RunNumBlocksBenchmarkFunction · 0.85

Calls 6

AddHostsMethod · 0.80
AddMultiBlockTableMethod · 0.80
SetReplicaPreferenceMethod · 0.80
SetRandomReplicaMethod · 0.80
AddTableScanMethod · 0.80
resetMethod · 0.65

Tested by

no test coverage detected