]>
Commit | Line | Data |
---|---|---|
9f95a23c TL |
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
2 | // vim: ts=8 sw=2 smarttab | |
3 | ||
4 | #pragma once | |
5 | ||
6 | #include "osd/osd_op_util.h" | |
7 | #include "crimson/net/Connection.h" | |
8 | #include "crimson/osd/osd_operation.h" | |
9 | #include "crimson/common/type_helpers.h" | |
10 | ||
11 | class MOSDOp; | |
12 | ||
13 | namespace crimson::osd { | |
14 | class PG; | |
15 | class OSD; | |
16 | ||
17 | class ClientRequest final : public OperationT<ClientRequest> { | |
18 | OSD &osd; | |
19 | crimson::net::ConnectionRef conn; | |
20 | Ref<MOSDOp> m; | |
21 | OpInfo op_info; | |
22 | OrderedPipelinePhase::Handle handle; | |
23 | ||
24 | public: | |
25 | class ConnectionPipeline { | |
26 | OrderedPipelinePhase await_map = { | |
27 | "ClientRequest::ConnectionPipeline::await_map" | |
28 | }; | |
29 | OrderedPipelinePhase get_pg = { | |
30 | "ClientRequest::ConnectionPipeline::get_pg" | |
31 | }; | |
32 | friend class ClientRequest; | |
33 | }; | |
34 | class PGPipeline { | |
35 | OrderedPipelinePhase await_map = { | |
36 | "ClientRequest::PGPipeline::await_map" | |
37 | }; | |
38 | OrderedPipelinePhase wait_for_active = { | |
39 | "ClientRequest::PGPipeline::wait_for_active" | |
40 | }; | |
41 | OrderedPipelinePhase get_obc = { | |
42 | "ClientRequest::PGPipeline::get_obc" | |
43 | }; | |
44 | OrderedPipelinePhase process = { | |
45 | "ClientRequest::PGPipeline::process" | |
46 | }; | |
47 | friend class ClientRequest; | |
48 | }; | |
49 | ||
50 | static constexpr OperationTypeCode type = OperationTypeCode::client_request; | |
51 | ||
52 | ClientRequest(OSD &osd, crimson::net::ConnectionRef, Ref<MOSDOp> &&m); | |
53 | ||
54 | void print(std::ostream &) const final; | |
55 | void dump_detail(Formatter *f) const final; | |
56 | ||
57 | public: | |
58 | seastar::future<> start(); | |
59 | ||
60 | private: | |
61 | seastar::future<> process_pg_op( | |
62 | PG &pg); | |
63 | seastar::future<> process_op( | |
64 | PG &pg); | |
65 | bool is_pg_op() const; | |
66 | ||
67 | ConnectionPipeline &cp(); | |
68 | PGPipeline &pp(PG &pg); | |
69 | }; | |
70 | ||
71 | } |