From: Casey Bodley Date: Wed, 26 Apr 2023 18:41:24 +0000 (-0400) Subject: immutable-object-cache: use granular asio headers X-Git-Tag: v19.0.0~216^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cf85121fd684b228f3139253d9570ba59f4c70d2;p=ceph.git immutable-object-cache: use granular asio headers Signed-off-by: Casey Bodley --- diff --git a/src/tools/immutable_object_cache/CacheClient.cc b/src/tools/immutable_object_cache/CacheClient.cc index 2b837be512c3..44686529547d 100644 --- a/src/tools/immutable_object_cache/CacheClient.cc +++ b/src/tools/immutable_object_cache/CacheClient.cc @@ -1,6 +1,10 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#include +#include +#include +#include #include #include "CacheClient.h" #include "common/Cond.h" @@ -25,8 +29,8 @@ namespace immutable_obj_cache { "immutable_object_cache_client_dedicated_thread_num"); if (m_worker_thread_num != 0) { - m_worker = new boost::asio::io_service(); - m_worker_io_service_work = new boost::asio::io_service::work(*m_worker); + m_worker = new boost::asio::io_context(); + m_worker_io_service_work = new boost::asio::io_context::work(*m_worker); for (uint64_t i = 0; i < m_worker_thread_num; i++) { std::thread* thd = new std::thread([this](){m_worker->run();}); m_worker_threads.push_back(thd); diff --git a/src/tools/immutable_object_cache/CacheClient.h b/src/tools/immutable_object_cache/CacheClient.h index b2f749631258..7dc4aa76c132 100644 --- a/src/tools/immutable_object_cache/CacheClient.h +++ b/src/tools/immutable_object_cache/CacheClient.h @@ -5,8 +5,8 @@ #define CEPH_CACHE_CACHE_CLIENT_H #include -#include -#include +#include +#include #include #include "include/ceph_assert.h" @@ -16,11 +16,11 @@ #include "SocketCommon.h" -using boost::asio::local::stream_protocol; - namespace ceph { namespace immutable_obj_cache { +using boost::asio::local::stream_protocol; + class CacheClient { public: CacheClient(const std::string& file, CephContext* ceph_ctx); @@ -57,17 +57,17 @@ class CacheClient { private: CephContext* m_cct; - boost::asio::io_service m_io_service; - boost::asio::io_service::work m_io_service_work; + boost::asio::io_context m_io_service; + boost::asio::io_context::work m_io_service_work; stream_protocol::socket m_dm_socket; stream_protocol::endpoint m_ep; std::shared_ptr m_io_thread; std::atomic m_session_work; uint64_t m_worker_thread_num; - boost::asio::io_service* m_worker; + boost::asio::io_context* m_worker; std::vector m_worker_threads; - boost::asio::io_service::work* m_worker_io_service_work; + boost::asio::io_context::work* m_worker_io_service_work; std::atomic m_writing; std::atomic m_reading; diff --git a/src/tools/immutable_object_cache/CacheServer.cc b/src/tools/immutable_object_cache/CacheServer.cc index e94a47c7a5cb..14deddce561b 100644 --- a/src/tools/immutable_object_cache/CacheServer.cc +++ b/src/tools/immutable_object_cache/CacheServer.cc @@ -1,6 +1,8 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#include +#include #include #include "common/debug.h" #include "common/ceph_context.h" diff --git a/src/tools/immutable_object_cache/CacheServer.h b/src/tools/immutable_object_cache/CacheServer.h index 31d8599340d5..8affc92ddd5c 100644 --- a/src/tools/immutable_object_cache/CacheServer.h +++ b/src/tools/immutable_object_cache/CacheServer.h @@ -4,19 +4,19 @@ #ifndef CEPH_CACHE_CACHE_SERVER_H #define CEPH_CACHE_CACHE_SERVER_H -#include -#include +#include +#include #include "Types.h" #include "SocketCommon.h" #include "CacheSession.h" -using boost::asio::local::stream_protocol; - namespace ceph { namespace immutable_obj_cache { +using boost::asio::local::stream_protocol; + class CacheServer { public: CacheServer(CephContext* cct, const std::string& file, ProcessMsg processmsg); @@ -33,7 +33,7 @@ class CacheServer { private: CephContext* cct; - boost::asio::io_service m_io_service; + boost::asio::io_context m_io_service; ProcessMsg m_server_process_msg; stream_protocol::endpoint m_local_path; stream_protocol::acceptor m_acceptor; diff --git a/src/tools/immutable_object_cache/CacheSession.cc b/src/tools/immutable_object_cache/CacheSession.cc index 38c38c97d44e..aace2023e675 100644 --- a/src/tools/immutable_object_cache/CacheSession.cc +++ b/src/tools/immutable_object_cache/CacheSession.cc @@ -1,6 +1,10 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#include +#include +#include +#include #include #include "common/debug.h" #include "common/ceph_context.h" @@ -16,7 +20,7 @@ namespace ceph { namespace immutable_obj_cache { -CacheSession::CacheSession(io_service& io_service, +CacheSession::CacheSession(io_context& io_service, ProcessMsg processmsg, CephContext* cct) : m_dm_socket(io_service), diff --git a/src/tools/immutable_object_cache/CacheSession.h b/src/tools/immutable_object_cache/CacheSession.h index 0826e8a2b9a1..23d83d8a0355 100644 --- a/src/tools/immutable_object_cache/CacheSession.h +++ b/src/tools/immutable_object_cache/CacheSession.h @@ -4,21 +4,21 @@ #ifndef CEPH_CACHE_SESSION_H #define CEPH_CACHE_SESSION_H -#include -#include +#include +#include #include "Types.h" #include "SocketCommon.h" -using boost::asio::local::stream_protocol; -using boost::asio::io_service; - namespace ceph { namespace immutable_obj_cache { +using boost::asio::local::stream_protocol; +using boost::asio::io_context; + class CacheSession : public std::enable_shared_from_this { public: - CacheSession(io_service& io_service, ProcessMsg process_msg, + CacheSession(io_context& io_service, ProcessMsg process_msg, CephContext* ctx); ~CacheSession(); stream_protocol::socket& socket();