From c0e15b9047cf2a7bb4fd2bc11ea55b288870d6a9 Mon Sep 17 00:00:00 2001 From: mwish Date: Fri, 8 Nov 2024 12:42:04 +0800 Subject: [PATCH] fix stall condition string --- src/storage/event_listener.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/storage/event_listener.cc b/src/storage/event_listener.cc index ab1c42338ed..e5861d20a37 100644 --- a/src/storage/event_listener.cc +++ b/src/storage/event_listener.cc @@ -43,9 +43,13 @@ std::string FileCreatedReason2String(const rocksdb::TableFileCreationReason reas } std::string StallConditionType2String(const rocksdb::WriteStallCondition type) { - std::vector stall_condition_strings = {"normal", "delay", "stop"}; - if (static_cast(type) < stall_condition_strings.size()) { - return stall_condition_strings[static_cast(type)]; + switch (type) { + case rocksdb::WriteStallCondition::kDelayed: + return "delay"; + case rocksdb::WriteStallCondition::kStopped: + return "stop"; + case rocksdb::WriteStallCondition::kNormal: + return "normal"; } return "unknown"; }