]> git.proxmox.com Git - ceph.git/blob - ceph/src/rgw/services/svc_sys_obj_core.h
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / rgw / services / svc_sys_obj_core.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab ft=cpp
3
4 #pragma once
5
6 #include "rgw_service.h"
7
8 #include "svc_rados.h"
9 #include "svc_sys_obj.h"
10 #include "svc_sys_obj_core_types.h"
11
12
13 class RGWSI_Zone;
14
15 struct rgw_cache_entry_info;
16
17 class RGWSI_SysObj_Core : public RGWServiceInstance
18 {
19 friend class RGWServices_Def;
20 friend class RGWSI_SysObj;
21
22 protected:
23 RGWSI_RADOS *rados_svc{nullptr};
24 RGWSI_Zone *zone_svc{nullptr};
25
26 using GetObjState = RGWSI_SysObj_Core_GetObjState;
27 using PoolListImplInfo = RGWSI_SysObj_Core_PoolListImplInfo;
28
29 void core_init(RGWSI_RADOS *_rados_svc,
30 RGWSI_Zone *_zone_svc) {
31 rados_svc = _rados_svc;
32 zone_svc = _zone_svc;
33 }
34 int get_rados_obj(const DoutPrefixProvider *dpp, RGWSI_Zone *zone_svc, const rgw_raw_obj& obj, RGWSI_RADOS::Obj *pobj);
35
36 virtual int raw_stat(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj,
37 uint64_t *psize, real_time *pmtime,
38 std::map<std::string, bufferlist> *attrs,
39 RGWObjVersionTracker *objv_tracker,
40 optional_yield y);
41
42 virtual int read(const DoutPrefixProvider *dpp,
43 RGWSI_SysObj_Obj_GetObjState& read_state,
44 RGWObjVersionTracker *objv_tracker,
45 const rgw_raw_obj& obj,
46 bufferlist *bl, off_t ofs, off_t end,
47 ceph::real_time* pmtime, uint64_t* psize,
48 std::map<std::string, bufferlist> *attrs,
49 bool raw_attrs,
50 rgw_cache_entry_info *cache_info,
51 boost::optional<obj_version>,
52 optional_yield y);
53
54 virtual int remove(const DoutPrefixProvider *dpp,
55 RGWObjVersionTracker *objv_tracker,
56 const rgw_raw_obj& obj,
57 optional_yield y);
58
59 virtual int write(const DoutPrefixProvider *dpp,
60 const rgw_raw_obj& obj,
61 real_time *pmtime,
62 std::map<std::string, bufferlist>& attrs,
63 bool exclusive,
64 const bufferlist& data,
65 RGWObjVersionTracker *objv_tracker,
66 real_time set_mtime,
67 optional_yield y);
68
69 virtual int write_data(const DoutPrefixProvider *dpp,
70 const rgw_raw_obj& obj,
71 const bufferlist& bl,
72 bool exclusive,
73 RGWObjVersionTracker *objv_tracker,
74 optional_yield y);
75
76 virtual int get_attr(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj,
77 const char *name, bufferlist *dest,
78 optional_yield y);
79
80 virtual int set_attrs(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj,
81 std::map<std::string, bufferlist>& attrs,
82 std::map<std::string, bufferlist> *rmattrs,
83 RGWObjVersionTracker *objv_tracker,
84 bool exclusive, optional_yield y);
85
86 virtual int omap_get_all(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, std::map<std::string, bufferlist> *m,
87 optional_yield y);
88 virtual int omap_get_vals(const DoutPrefixProvider *dpp,
89 const rgw_raw_obj& obj,
90 const std::string& marker,
91 uint64_t count,
92 std::map<std::string, bufferlist> *m,
93 bool *pmore,
94 optional_yield y);
95 virtual int omap_set(const DoutPrefixProvider *dpp,
96 const rgw_raw_obj& obj, const std::string& key,
97 bufferlist& bl, bool must_exist,
98 optional_yield y);
99 virtual int omap_set(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj,
100 const std::map<std::string, bufferlist>& m, bool must_exist,
101 optional_yield y);
102 virtual int omap_del(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, const std::string& key,
103 optional_yield y);
104
105 virtual int notify(const DoutPrefixProvider *dpp,
106 const rgw_raw_obj& obj, bufferlist& bl,
107 uint64_t timeout_ms, bufferlist *pbl,
108 optional_yield y);
109
110 virtual int pool_list_prefixed_objs(const DoutPrefixProvider *dpp,
111 const rgw_pool& pool,
112 const std::string& prefix,
113 std::function<void(const std::string&)> cb);
114
115 virtual int pool_list_objects_init(const DoutPrefixProvider *dpp,
116 const rgw_pool& pool,
117 const std::string& marker,
118 const std::string& prefix,
119 RGWSI_SysObj::Pool::ListCtx *ctx);
120 virtual int pool_list_objects_next(const DoutPrefixProvider *dpp,
121 RGWSI_SysObj::Pool::ListCtx& ctx,
122 int max,
123 std::vector<std::string> *oids,
124 bool *is_truncated);
125
126 virtual int pool_list_objects_get_marker(RGWSI_SysObj::Pool::ListCtx& _ctx,
127 std::string *marker);
128
129 int stat(RGWSI_SysObj_Obj_GetObjState& state,
130 const rgw_raw_obj& obj,
131 std::map<std::string, bufferlist> *attrs,
132 bool raw_attrs,
133 real_time *lastmod,
134 uint64_t *obj_size,
135 RGWObjVersionTracker *objv_tracker,
136 optional_yield y,
137 const DoutPrefixProvider *dpp);
138
139 public:
140 RGWSI_SysObj_Core(CephContext *cct): RGWServiceInstance(cct) {}
141
142 RGWSI_Zone *get_zone_svc() {
143 return zone_svc;
144 }
145 };