]>
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" | |
f67539c2 | 10 | #include "messages/MOSDOp.h" |
9f95a23c TL |
11 | |
12 | namespace crimson::osd { | |
13 | class PG; | |
14 | class OSD; | |
15 | ||
16 | class ClientRequest final : public OperationT<ClientRequest> { | |
17 | OSD &osd; | |
18 | crimson::net::ConnectionRef conn; | |
19 | Ref<MOSDOp> m; | |
20 | OpInfo op_info; | |
21 | OrderedPipelinePhase::Handle handle; | |
22 | ||
23 | public: | |
24 | class ConnectionPipeline { | |
25 | OrderedPipelinePhase await_map = { | |
26 | "ClientRequest::ConnectionPipeline::await_map" | |
27 | }; | |
28 | OrderedPipelinePhase get_pg = { | |
29 | "ClientRequest::ConnectionPipeline::get_pg" | |
30 | }; | |
31 | friend class ClientRequest; | |
32 | }; | |
33 | class PGPipeline { | |
34 | OrderedPipelinePhase await_map = { | |
35 | "ClientRequest::PGPipeline::await_map" | |
36 | }; | |
37 | OrderedPipelinePhase wait_for_active = { | |
38 | "ClientRequest::PGPipeline::wait_for_active" | |
39 | }; | |
f67539c2 TL |
40 | OrderedPipelinePhase recover_missing = { |
41 | "ClientRequest::PGPipeline::recover_missing" | |
42 | }; | |
9f95a23c TL |
43 | OrderedPipelinePhase get_obc = { |
44 | "ClientRequest::PGPipeline::get_obc" | |
45 | }; | |
46 | OrderedPipelinePhase process = { | |
47 | "ClientRequest::PGPipeline::process" | |
48 | }; | |
49 | friend class ClientRequest; | |
50 | }; | |
51 | ||
52 | static constexpr OperationTypeCode type = OperationTypeCode::client_request; | |
53 | ||
54 | ClientRequest(OSD &osd, crimson::net::ConnectionRef, Ref<MOSDOp> &&m); | |
55 | ||
56 | void print(std::ostream &) const final; | |
57 | void dump_detail(Formatter *f) const final; | |
58 | ||
59 | public: | |
60 | seastar::future<> start(); | |
61 | ||
62 | private: | |
63 | seastar::future<> process_pg_op( | |
f67539c2 | 64 | Ref<PG> &pg); |
9f95a23c | 65 | seastar::future<> process_op( |
f67539c2 | 66 | Ref<PG> &pg); |
9f95a23c TL |
67 | bool is_pg_op() const; |
68 | ||
69 | ConnectionPipeline &cp(); | |
70 | PGPipeline &pp(PG &pg); | |
f67539c2 TL |
71 | |
72 | private: | |
73 | bool is_misdirected(const PG& pg) const; | |
9f95a23c TL |
74 | }; |
75 | ||
76 | } |