diff options
author | Tor Brede Vekterli <vekterli@yahooinc.com> | 2023-10-12 13:21:37 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@yahooinc.com> | 2023-10-12 13:21:37 +0000 |
commit | 68da2c282074c9f7cd2f43ded50d977f7ba5f1ce (patch) | |
tree | 9398980debbf314252a91f1ae71302cd26677b0f /storage | |
parent | 957aed121d057ea0e3e417bd55deec3050a81e4e (diff) |
Improve enum naming by reducing redundant information
Diffstat (limited to 'storage')
4 files changed, 15 insertions, 15 deletions
diff --git a/storage/src/vespa/storage/common/storagelink.cpp b/storage/src/vespa/storage/common/storagelink.cpp index 8dedde99dc8..ec55bc89e90 100644 --- a/storage/src/vespa/storage/common/storagelink.cpp +++ b/storage/src/vespa/storage/common/storagelink.cpp @@ -15,19 +15,19 @@ using namespace storage::api; namespace storage { StorageLink::StorageLink(const std::string& name, - AllowMsgDownOnFlush allow_msg_down_during_flushing, - AllowMsgUpOnClosed allow_msg_up_during_closed) + MsgDownOnFlush allow_msg_down_during_flushing, + MsgUpOnClosed allow_msg_up_during_closed) : _name(name), _up(nullptr), _down(), _state(CREATED), - _allow_msg_down_during_flushing(allow_msg_down_during_flushing), - _allow_msg_up_during_closed(allow_msg_up_during_closed) + _msg_down_during_flushing(allow_msg_down_during_flushing), + _msg_up_during_closed(allow_msg_up_during_closed) { } StorageLink::StorageLink(const std::string& name) - : StorageLink(name, AllowMsgDownOnFlush::Disallowed, AllowMsgUpOnClosed::Disallowed) + : StorageLink(name, MsgDownOnFlush::Disallowed, MsgUpOnClosed::Disallowed) { } @@ -147,7 +147,7 @@ void StorageLink::sendDown(const StorageMessage::SP& msg) case FLUSHINGDOWN: break; case FLUSHINGUP: - if (_allow_msg_down_during_flushing == AllowMsgDownOnFlush::Allowed) { + if (_msg_down_during_flushing == MsgDownOnFlush::Allowed) { break; } [[fallthrough]]; @@ -195,7 +195,7 @@ void StorageLink::sendUp(const std::shared_ptr<StorageMessage> & msg) case FLUSHINGUP: break; case CLOSED: - if (_allow_msg_up_during_closed == AllowMsgUpOnClosed::Allowed) { + if (_msg_up_during_closed == MsgUpOnClosed::Allowed) { break; } [[fallthrough]]; diff --git a/storage/src/vespa/storage/common/storagelink.h b/storage/src/vespa/storage/common/storagelink.h index 877169ecc2d..3ff75df9448 100644 --- a/storage/src/vespa/storage/common/storagelink.h +++ b/storage/src/vespa/storage/common/storagelink.h @@ -41,21 +41,21 @@ public: enum State { CREATED, OPENED, CLOSING, FLUSHINGDOWN, FLUSHINGUP, CLOSED }; - enum class AllowMsgDownOnFlush { Allowed, Disallowed }; - enum class AllowMsgUpOnClosed { Allowed, Disallowed }; + enum class MsgDownOnFlush { Allowed, Disallowed }; + enum class MsgUpOnClosed { Allowed, Disallowed }; private: const std::string _name; StorageLink* _up; std::unique_ptr<StorageLink> _down; std::atomic<State> _state; - const AllowMsgDownOnFlush _allow_msg_down_during_flushing; - const AllowMsgUpOnClosed _allow_msg_up_during_closed; + const MsgDownOnFlush _msg_down_during_flushing; + const MsgUpOnClosed _msg_up_during_closed; public: StorageLink(const std::string& name, - AllowMsgDownOnFlush allow_msg_down_during_flushing, - AllowMsgUpOnClosed allow_msg_up_during_closed); + MsgDownOnFlush allow_msg_down_during_flushing, + MsgUpOnClosed allow_msg_up_during_closed); explicit StorageLink(const std::string& name); StorageLink(const StorageLink &) = delete; diff --git a/storage/src/vespa/storage/storageserver/bouncer.cpp b/storage/src/vespa/storage/storageserver/bouncer.cpp index 405a19c5a7e..78f248e2b90 100644 --- a/storage/src/vespa/storage/storageserver/bouncer.cpp +++ b/storage/src/vespa/storage/storageserver/bouncer.cpp @@ -22,7 +22,7 @@ LOG_SETUP(".bouncer"); namespace storage { Bouncer::Bouncer(StorageComponentRegister& compReg, const config::ConfigUri & configUri) - : StorageLink("Bouncer", AllowMsgDownOnFlush::Disallowed, AllowMsgUpOnClosed::Allowed), + : StorageLink("Bouncer", MsgDownOnFlush::Disallowed, MsgUpOnClosed::Allowed), _config(new vespa::config::content::core::StorBouncerConfig()), _component(compReg, "bouncer"), _lock(), diff --git a/storage/src/vespa/storage/storageserver/communicationmanager.cpp b/storage/src/vespa/storage/storageserver/communicationmanager.cpp index cf25b944226..5bbc5b2a26d 100644 --- a/storage/src/vespa/storage/storageserver/communicationmanager.cpp +++ b/storage/src/vespa/storage/storageserver/communicationmanager.cpp @@ -217,7 +217,7 @@ convert_to_rpc_compression_config(const vespa::config::content::core::StorCommun } CommunicationManager::CommunicationManager(StorageComponentRegister& compReg, const config::ConfigUri & configUri) - : StorageLink("Communication manager", AllowMsgDownOnFlush::Allowed, AllowMsgUpOnClosed::Disallowed), + : StorageLink("Communication manager", MsgDownOnFlush::Allowed, MsgUpOnClosed::Disallowed), _component(compReg, "communicationmanager"), _metrics(), _shared_rpc_resources(), // Created upon initial configuration |