Set up all of the test state: the buffer pool, a query state, a client with no reservation and any other descriptors, etc. The buffer pool's capacity is limited to 'buffer_pool_limit'.
| 138 | /// reservation and any other descriptors, etc. |
| 139 | /// The buffer pool's capacity is limited to 'buffer_pool_limit'. |
| 140 | void Init(int64_t buffer_pool_limit) { |
| 141 | test_env_.reset(new TestEnv()); |
| 142 | test_env_->SetBufferPoolArgs(MIN_PAGE_LEN, buffer_pool_limit); |
| 143 | ASSERT_OK(test_env_->Init()); |
| 144 | |
| 145 | CreateDescriptors(); |
| 146 | mem_pool_.reset(new MemPool(&tracker_)); |
| 147 | |
| 148 | ASSERT_OK(test_env_->CreateQueryState(0, nullptr, &runtime_state_)); |
| 149 | query_state_ = runtime_state_->query_state(); |
| 150 | |
| 151 | RuntimeProfile* client_profile = RuntimeProfile::Create(&pool_, "client"); |
| 152 | MemTracker* client_tracker = |
| 153 | pool_.Add(new MemTracker(-1, "client", runtime_state_->instance_mem_tracker())); |
| 154 | ASSERT_OK(test_env_->exec_env()->buffer_pool()->RegisterClient("", |
| 155 | query_state_->file_group(), runtime_state_->instance_buffer_reservation(), |
| 156 | client_tracker, numeric_limits<int>::max(), client_profile, &client_)); |
| 157 | } |
| 158 | |
| 159 | /// Generate the ith element of a sequence of int values. |
| 160 | int GenIntValue(int i) { |
no test coverage detected