MCPcopy Create free account
hub / github.com/apple/foundationdb / toString

Method toString

fdbserver/VersionedBTree.actor.cpp:7406–7439  ·  view source on GitHub ↗

path entries at dumpHeight or below will have their entire pages printed

Source from the content-addressed store, hash-verified

7404
7405 // path entries at dumpHeight or below will have their entire pages printed
7406 std::string toString(int dumpHeight = 0) const {
7407 std::string r = format("{ptr=%p reason=%s %s ",
7408 this,
7409 PagerEventReasonsStrings[(int)reason],
7410 ::toString(pager->getVersion()).c_str());
7411 for (int i = 0; i < path.size(); ++i) {
7412 std::string id = "<debugOnly>";
7413#if REDWOOD_DEBUG
7414 id = ::toString(path[i].id);
7415#endif
7416 int height = path[i].btPage()->height;
7417 r += format("\n\t[Level=%d ID=%s ptr=%p Cursor=%s] ",
7418 height,
7419 id.c_str(),
7420 path[i].page->data(),
7421 path[i].cursor.valid() ? path[i].cursor.get().toString(path[i].btPage()->isLeaf()).c_str()
7422 : "<invalid>");
7423 if (height <= dumpHeight) {
7424 BTreePage::BinaryTree::Cursor c = path[i].cursor;
7425 c.moveFirst();
7426 int i = 0;
7427 while (c.valid()) {
7428 r += format("\n\t\%7d: %s", ++i, c.get().toString(height == 1).c_str());
7429 c.moveNext();
7430 }
7431 }
7432 }
7433 r += "\n";
7434 if (!valid) {
7435 r += " (invalid) ";
7436 }
7437 r += "}";
7438 return r;
7439 }
7440
7441 const RedwoodRecordRef get() { return path.back().cursor.get(); }
7442

Callers 1

seek_implMethod · 0.95

Calls 13

toStringFunction · 0.70
getMethod · 0.65
formatFunction · 0.50
c_strMethod · 0.45
getVersionMethod · 0.45
sizeMethod · 0.45
btPageMethod · 0.45
dataMethod · 0.45
validMethod · 0.45
toStringMethod · 0.45
isLeafMethod · 0.45
moveFirstMethod · 0.45

Tested by

no test coverage detected