diff options
author | Alex Li <alex.li@mongodb.com> | 2022-07-28 16:13:13 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-07-28 17:21:38 +0000 |
commit | 11967978f80d227ff72975807209180658912c6d (patch) | |
tree | 6d06c98f1a32ca294435cabf19439e03d562967c /src/mongo/transport/service_entry_point_impl.cpp | |
parent | e4e786a4300a6bd2c0719d5a7b9f4a90a178aeb2 (diff) | |
download | mongo-11967978f80d227ff72975807209180658912c6d.tar.gz |
SERVER-67830 Rename ServiceStateMachine -> SessionWorkflow
Diffstat (limited to 'src/mongo/transport/service_entry_point_impl.cpp')
-rw-r--r-- | src/mongo/transport/service_entry_point_impl.cpp | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/mongo/transport/service_entry_point_impl.cpp b/src/mongo/transport/service_entry_point_impl.cpp index 386f0e9f851..b9a52a8abe4 100644 --- a/src/mongo/transport/service_entry_point_impl.cpp +++ b/src/mongo/transport/service_entry_point_impl.cpp @@ -56,8 +56,8 @@ #include "mongo/transport/service_executor_gen.h" #include "mongo/transport/service_executor_reserved.h" #include "mongo/transport/service_executor_synchronous.h" -#include "mongo/transport/service_state_machine.h" #include "mongo/transport/session.h" +#include "mongo/transport/session_workflow.h" #include "mongo/util/duration.h" #include "mongo/util/hierarchical_acquisition.h" #include "mongo/util/net/cidr.h" @@ -169,9 +169,10 @@ size_t getSupportedMax() { class ServiceEntryPointImpl::Sessions { public: struct Entry { - explicit Entry(std::shared_ptr<transport::ServiceStateMachine> ssm) : ssm{std::move(ssm)} {} - std::shared_ptr<transport::ServiceStateMachine> ssm; - ClientSummary summary{ssm->client()}; + explicit Entry(std::shared_ptr<transport::SessionWorkflow> workflow) + : workflow{std::move(workflow)} {} + std::shared_ptr<transport::SessionWorkflow> workflow; + ClientSummary summary{workflow->client()}; }; using ByClientMap = stdx::unordered_map<Client*, Entry>; using iterator = ByClientMap::iterator; @@ -181,11 +182,11 @@ public: public: explicit SyncToken(Sessions* src) : _src{src}, _lk{_src->_mutex} {} - /** Run `f(ssm)` for each `ServiceStateMachine& ssm`, in an unspecified order. */ + /** Run `f(workflow)` for each `SessionWorkflow& workflow`, in an unspecified order. */ template <typename F> void forEach(F&& f) { for (auto& e : _src->_byClient) - f(*e.second.ssm); + f(*e.second.workflow); } /** @@ -198,9 +199,9 @@ public: _lk, deadline.toSystemTimePoint(), [&] { return _src->_byClient.empty(); }); } - iterator insert(std::shared_ptr<transport::ServiceStateMachine> ssm) { - Client* cli = ssm->client(); - auto [it, ok] = _src->_byClient.insert({cli, Entry(std::move(ssm))}); + iterator insert(std::shared_ptr<transport::SessionWorkflow> workflow) { + Client* cli = workflow->client(); + auto [it, ok] = _src->_byClient.insert({cli, Entry(std::move(workflow))}); invariant(ok); _src->_created.fetchAndAdd(1); _onSizeChange(); @@ -312,8 +313,8 @@ void ServiceEntryPointImpl::startSession(transport::SessionHandle session) { transport::ServiceExecutorContext::set(&*client, std::move(seCtx)); } - auto ssm = transport::ServiceStateMachine::make(std::move(client)); - iter = sync.insert(std::move(ssm)); + auto workflow = transport::SessionWorkflow::make(std::move(client)); + iter = sync.insert(std::move(workflow)); if (!quiet()) { LOGV2(22943, "Connection accepted", @@ -323,7 +324,7 @@ void ServiceEntryPointImpl::startSession(transport::SessionHandle session) { } onClientConnect(clientPtr); - iter->second.ssm->start(); + iter->second.workflow->start(); } void ServiceEntryPointImpl::onClientDisconnect(Client* client) { @@ -342,7 +343,7 @@ void ServiceEntryPointImpl::onClientDisconnect(Client* client) { } void ServiceEntryPointImpl::endAllSessions(transport::Session::TagMask tags) { - _sessions->sync().forEach([&](auto&& ssm) { ssm.terminateIfTagsDontMatch(tags); }); + _sessions->sync().forEach([&](auto&& workflow) { workflow.terminateIfTagsDontMatch(tags); }); } bool ServiceEntryPointImpl::shutdown(Milliseconds timeout) { @@ -385,7 +386,7 @@ bool ServiceEntryPointImpl::shutdownAndWait(Milliseconds timeout) { bool drainedAll; { auto sync = _sessions->sync(); - sync.forEach([&](auto&& ssm) { ssm.terminate(); }); + sync.forEach([&](auto&& workflow) { workflow.terminate(); }); drainedAll = sync.waitForEmpty(deadline); if (!drainedAll) { LOGV2(22947, @@ -402,7 +403,7 @@ bool ServiceEntryPointImpl::shutdownAndWait(Milliseconds timeout) { } void ServiceEntryPointImpl::endAllSessionsNoTagMask() { - _sessions->sync().forEach([&](auto&& ssm) { ssm.terminate(); }); + _sessions->sync().forEach([&](auto&& workflow) { workflow.terminate(); }); } bool ServiceEntryPointImpl::waitForNoSessions(Milliseconds timeout) { |