Init a new tmp file manager with additional options.
| 130 | |
| 131 | /// Init a new tmp file manager with additional options. |
| 132 | vector<string> InitTmpFileMgr( |
| 133 | int num_dirs, const string& compression, bool punch_holes) { |
| 134 | vector<string> tmp_dirs; |
| 135 | for (int i = 0; i < num_dirs; ++i) { |
| 136 | const string& dir = Substitute("/tmp/buffer-pool-test.$0", i); |
| 137 | // Fix permissions in case old directories were left from previous runs of test. |
| 138 | chmod((dir + SCRATCH_SUFFIX).c_str(), S_IRWXU); |
| 139 | EXPECT_OK(FileSystemUtil::RemoveAndCreateDirectory(dir)); |
| 140 | tmp_dirs.push_back(dir); |
| 141 | created_tmp_dirs_.push_back(dir); |
| 142 | } |
| 143 | test_env_.reset(new TestEnv); |
| 144 | test_env_->DisableBufferPool(); |
| 145 | test_env_->SetTmpFileMgrArgs(tmp_dirs, false, compression, punch_holes); |
| 146 | EXPECT_OK(test_env_->Init()); |
| 147 | EXPECT_EQ(num_dirs, test_env_->tmp_file_mgr()->NumActiveTmpDevices()); |
| 148 | return tmp_dirs; |
| 149 | } |
| 150 | |
| 151 | /// Init a new tmp file manager with spill to remote options. |
| 152 | vector<string> InitTmpFileMgrSpillToRemote( |
nothing calls this directly
no test coverage detected