MCPcopy Create free account
hub / github.com/apache/kudu / LoadFile

Function LoadFile

src/kudu/tablet/compaction_policy-test.cc:246–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244}
245
246static 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

Callers 2

TEST_FFunction · 0.85
InitMethod · 0.85

Calls 9

JoinPathSegmentsFunction · 0.85
ReadFileToStringFunction · 0.85
SubstituteFunction · 0.85
SplitFunction · 0.85
ParseLeadingInt32ValueFunction · 0.50
ToStringMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected