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

Method SetupWithParameters

be/src/runtime/io/data-cache-test.cc:213–239  ·  view source on GitHub ↗

Create a bunch of test directories in which the data cache will reside.

Source from the content-addressed store, hash-verified

211
212 // Create a bunch of test directories in which the data cache will reside.
213 void SetupWithParameters(DataCacheTestParam param) {
214 test_env_.reset(new TestEnv());
215 flag_saver_.reset(new google::FlagSaver());
216 ASSERT_OK(test_env_->Init());
217 for (int i = 0; i < NUM_TEST_DIRS; ++i) {
218 const string& path = Substitute("$0/data-cache-test.$1", BASE_CACHE_DIR, i);
219 ASSERT_OK(FileSystemUtil::RemoveAndCreateDirectory(path));
220 data_cache_dirs_.push_back(path);
221 }
222 data_cache_trace_dir_ = ("/tmp" / boost::filesystem::unique_path()).string();
223 ASSERT_OK(FileSystemUtil::RemoveAndCreateDirectory(data_cache_trace_dir_));
224
225 // Force a single shard to avoid imbalance between shards in the Kudu LRU cache which
226 // may lead to unintended eviction. This allows the capacity of the cache is utilized
227 // to the limit for the purpose of this test.
228 FLAGS_cache_force_single_shard = true;
229
230 // Allows full write concurrency for the multi-threaded tests.
231 FLAGS_data_cache_write_concurrency = NUM_THREADS;
232
233 // This is parameterized to allow testing LRU and LIRS
234 FLAGS_data_cache_eviction_policy = param.eviction_policy;
235
236 // This is parameterized to allow testing asynchronous write.
237 FLAGS_data_cache_num_async_write_threads = param.num_write_threads;
238 FLAGS_data_cache_async_write_buffer_limit = "1G";
239 }
240
241 // Delete all the test directories created.
242 virtual void TearDown() {

Callers

nothing calls this directly

Calls 4

SubstituteFunction · 0.85
push_backMethod · 0.80
resetMethod · 0.65
InitMethod · 0.45

Tested by

no test coverage detected