mirror of https://github.com/facebook/rocksdb.git
Fix version edit dump in json (#12703)
Summary: **Context/Summary:** the flag --json of manifest_dump in ldb tool has no effect The bug may be introduced by pr https://github.com/facebook/rocksdb/pull/8378 Pull Request resolved: https://github.com/facebook/rocksdb/pull/12703 Reviewed By: cbi42 Differential Revision: D57848094 Pulled By: ajkr fbshipit-source-id: 3d1ce65528bf4ce9c53593a7208406ab90e8994b
This commit is contained in:
parent
259f21e695
commit
8765a0f546
|
@ -364,14 +364,15 @@ class DumpManifestHandler : public VersionEditHandler {
|
||||||
|
|
||||||
Status ApplyVersionEdit(VersionEdit& edit, ColumnFamilyData** cfd) override {
|
Status ApplyVersionEdit(VersionEdit& edit, ColumnFamilyData** cfd) override {
|
||||||
// Write out each individual edit
|
// Write out each individual edit
|
||||||
if (verbose_ && !json_) {
|
if (json_) {
|
||||||
// Print out DebugStrings. Can include non-terminating null characters.
|
// Print out DebugStrings. Can include non-terminating null characters.
|
||||||
fwrite(edit.DebugString(hex_).data(), sizeof(char),
|
std::string edit_dump_str = edit.DebugJSON(count_, hex_);
|
||||||
edit.DebugString(hex_).size(), stdout);
|
fwrite(edit_dump_str.data(), sizeof(char), edit_dump_str.size(), stdout);
|
||||||
} else if (json_) {
|
fwrite("\n", sizeof(char), 1, stdout);
|
||||||
|
} else if (verbose_) {
|
||||||
// Print out DebugStrings. Can include non-terminating null characters.
|
// Print out DebugStrings. Can include non-terminating null characters.
|
||||||
fwrite(edit.DebugString(hex_).data(), sizeof(char),
|
std::string edit_dump_str = edit.DebugString(hex_);
|
||||||
edit.DebugString(hex_).size(), stdout);
|
fwrite(edit_dump_str.data(), sizeof(char), edit_dump_str.size(), stdout);
|
||||||
}
|
}
|
||||||
++count_;
|
++count_;
|
||||||
return VersionEditHandler::ApplyVersionEdit(edit, cfd);
|
return VersionEditHandler::ApplyVersionEdit(edit, cfd);
|
||||||
|
|
Loading…
Reference in New Issue