MCPcopy Create free account
hub / github.com/ElementsProject/elements / VersionEditPrinter

Function VersionEditPrinter

src/leveldb/db/dumpfile.cc:128–141  ·  view source on GitHub ↗

Called on every log record (each one of which is a WriteBatch) found in a kDescriptorFile.

Source from the content-addressed store, hash-verified

126// Called on every log record (each one of which is a WriteBatch)
127// found in a kDescriptorFile.
128static void VersionEditPrinter(uint64_t pos, Slice record, WritableFile* dst) {
129 std::string r = "--- offset ";
130 AppendNumberTo(&r, pos);
131 r += "; ";
132 VersionEdit edit;
133 Status s = edit.DecodeFrom(record);
134 if (!s.ok()) {
135 r += s.ToString();
136 r.push_back('\n');
137 } else {
138 r += edit.DebugString();
139 }
140 dst->Append(r);
141}
142
143Status DumpDescriptor(Env* env, const std::string& fname, WritableFile* dst) {
144 return PrintLogContents(env, fname, VersionEditPrinter, dst);

Callers

nothing calls this directly

Calls 6

AppendNumberToFunction · 0.85
DecodeFromMethod · 0.45
ToStringMethod · 0.45
push_backMethod · 0.45
DebugStringMethod · 0.45
AppendMethod · 0.45

Tested by

no test coverage detected