Skip to content

Commit

Permalink
add back the override Execute() of WatchCmd, InfoCmd, ConfigCmd (Open…
Browse files Browse the repository at this point in the history
…AtomFoundation#2693)

Co-authored-by: cjh <1271435567@qq.com>
  • Loading branch information
cheniujh and cjh committed Jun 4, 2024
1 parent 44112d4 commit 4b390c0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
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

0 comments on commit 4b390c0

Please sign in to comment.