| 244 | } |
| 245 | |
| 246 | static RowSetVector LoadFile(const string& name) { |
| 247 | RowSetVector rowsets; |
| 248 | const string path = JoinPathSegments(GetTestExecutableDirectory(), name); |
| 249 | faststring data; |
| 250 | CHECK_OK_PREPEND(ReadFileToString(Env::Default(), path, &data), |
| 251 | strings::Substitute("unable to load test data file $0", path)); |
| 252 | const vector<string> lines = strings::Split(data.ToString(), "\n"); |
| 253 | for (const auto& line : lines) { |
| 254 | if (line.empty() || line[0] == '#') continue; |
| 255 | const vector<string> fields = strings::Split(line, "\t"); |
| 256 | CHECK_EQ(3, fields.size()) << "Expected 3 fields on line: " << line; |
| 257 | const int size_mb = ParseLeadingInt32Value(fields[0], -1); |
| 258 | CHECK_GE(size_mb, 1) << "Expected size at least 1MB on line: " << line; |
| 259 | rowsets.emplace_back(new MockDiskRowSet(fields[1] /* min key */, |
| 260 | fields[2] /* max key */, |
| 261 | size_mb * 1024 * 1024)); |
| 262 | } |
| 263 | |
| 264 | return rowsets; |
| 265 | } |
| 266 | |
| 267 | // Realistic test using data scraped from a tablet containing 200GB+ of YCSB |
| 268 | // data. This test can be used as a benchmark for optimizing the compaction |
no test coverage detected