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

fix: add back the override Execute() of WatchCmd, InfoCmd, ConfigCmd #2693

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions include/pika_admin.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ class InfoCmd : public Cmd {
void Split(const HintKeys& hint_keys) override {};
void Merge() override {};
Cmd* Clone() override { return new InfoCmd(*this); }
void Execute() override;

private:
InfoSection info_section_;
Expand Down Expand Up @@ -324,6 +325,7 @@ class ConfigCmd : public Cmd {
void Split(const HintKeys& hint_keys) override {};
void Merge() override {};
Cmd* Clone() override { return new ConfigCmd(*this); }
void Execute() override;

private:
std::vector<std::string> config_args_v_;
Expand Down
1 change: 1 addition & 0 deletions include/pika_transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class WatchCmd : public Cmd {
Cmd* Clone() override { return new WatchCmd(*this); }
void Merge() override {}
std::vector<std::string> current_key() const override { return keys_; }
void Execute() override;

private:
void DoInitial() override;
Expand Down
8 changes: 8 additions & 0 deletions src/pika_admin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,11 @@ const std::string InfoCmd::kDebugSection = "debug";
const std::string InfoCmd::kCommandStatsSection = "commandstats";
const std::string InfoCmd::kCacheSection = "cache";

void InfoCmd::Execute() {
std::shared_ptr<DB> db = g_pika_server->GetDB(db_name_);
Do();
}

void InfoCmd::DoInitial() {
size_t argc = argv_.size();
if (argc > 4) {
Expand Down Expand Up @@ -1386,6 +1391,9 @@ std::string InfoCmd::CacheStatusToString(int status) {
return std::string("Unknown");
}
}
void ConfigCmd::Execute() {
Do();
}

void ConfigCmd::DoInitial() {
if (!CheckArg(argv_.size())) {
Expand Down
4 changes: 4 additions & 0 deletions src/pika_transaction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ void ExecCmd::ServeToBLrPopWithKeys() {
}
}

void WatchCmd::Execute() {
Do();
}

void WatchCmd::Do() {
auto mp = std::map<storage::DataType, storage::Status>{};
for (const auto& key : keys_) {
Expand Down
Loading