Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add jobs info to meta dump tool #4878

Merged
merged 2 commits into from
Nov 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/tools/meta-dump/MetaDumpTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "common/time/TimeUtils.h"
#include "common/utils/MetaKeyUtils.h"
#include "meta/ActiveHostsMan.h"
#include "meta/processors/job/JobDescription.h"

DEFINE_string(path, "", "rocksdb instance path");

Expand Down Expand Up @@ -273,6 +274,26 @@ class MetaDumper {
iter->Next();
}
}
{
LOG(INFO) << "------------------------------------------\n\n";
LOG(INFO) << "Job info:";
prefix = MetaKeyUtils::jobPrefix();
iter->Seek(rocksdb::Slice(prefix));
while (iter->Valid() && iter->key().starts_with(prefix)) {
auto key = folly::StringPiece(iter->key().data(), iter->key().size());
auto val = folly::StringPiece(iter->value().data(), iter->value().size());
if (MetaKeyUtils::isJobKey(key)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only job ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, just for locating the job info.

auto jobRet = JobDescription::makeJobDescription(key, val);
auto job = nebula::value(jobRet);
LOG(INFO) << folly::sformat("space id: {}, job id: {}, status: {}",
job.getSpace(),
job.getJobId(),
JobStatus::toString(job.getStatus()));
}

iter->Next();
}
}
if (iter) {
delete iter;
}
Expand Down