]> git.proxmox.com Git - ceph.git/blob - ceph/src/rgw/rgw_sync_module_aws.h
import ceph 15.2.10
[ceph.git] / ceph / src / rgw / rgw_sync_module_aws.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 #ifndef RGW_SYNC_MODULE_AWS_H
5 #define RGW_SYNC_MODULE_AWS_H
6
7 #include "rgw_sync_module.h"
8
9 struct rgw_sync_aws_multipart_part_info {
10 int part_num{0};
11 uint64_t ofs{0};
12 uint64_t size{0};
13 string etag;
14
15 void encode(bufferlist& bl) const {
16 ENCODE_START(1, 1, bl);
17 encode(part_num, bl);
18 encode(ofs, bl);
19 encode(size, bl);
20 encode(etag, bl);
21 ENCODE_FINISH(bl);
22 }
23
24 void decode(bufferlist::const_iterator& bl) {
25 DECODE_START(1, bl);
26 decode(part_num, bl);
27 decode(ofs, bl);
28 decode(size, bl);
29 decode(etag, bl);
30 DECODE_FINISH(bl);
31 }
32 };
33 WRITE_CLASS_ENCODER(rgw_sync_aws_multipart_part_info)
34
35 struct rgw_sync_aws_src_obj_properties {
36 ceph::real_time mtime;
37 string etag;
38 uint32_t zone_short_id{0};
39 uint64_t pg_ver{0};
40 uint64_t versioned_epoch{0};
41
42 void encode(bufferlist& bl) const {
43 ENCODE_START(1, 1, bl);
44 encode(mtime, bl);
45 encode(etag, bl);
46 encode(zone_short_id, bl);
47 encode(pg_ver, bl);
48 encode(versioned_epoch, bl);
49 ENCODE_FINISH(bl);
50 }
51
52 void decode(bufferlist::const_iterator& bl) {
53 DECODE_START(1, bl);
54 decode(mtime, bl);
55 decode(etag, bl);
56 decode(zone_short_id, bl);
57 decode(pg_ver, bl);
58 decode(versioned_epoch, bl);
59 DECODE_FINISH(bl);
60 }
61 };
62 WRITE_CLASS_ENCODER(rgw_sync_aws_src_obj_properties)
63
64 struct rgw_sync_aws_multipart_upload_info {
65 string upload_id;
66 uint64_t obj_size;
67 rgw_sync_aws_src_obj_properties src_properties;
68 uint32_t part_size{0};
69 uint32_t num_parts{0};
70
71 int cur_part{0};
72 uint64_t cur_ofs{0};
73
74 std::map<int, rgw_sync_aws_multipart_part_info> parts;
75
76 void encode(bufferlist& bl) const {
77 ENCODE_START(1, 1, bl);
78 encode(upload_id, bl);
79 encode(obj_size, bl);
80 encode(src_properties, bl);
81 encode(part_size, bl);
82 encode(num_parts, bl);
83 encode(cur_part, bl);
84 encode(cur_ofs, bl);
85 encode(parts, bl);
86 ENCODE_FINISH(bl);
87 }
88
89 void decode(bufferlist::const_iterator& bl) {
90 DECODE_START(1, bl);
91 decode(upload_id, bl);
92 decode(obj_size, bl);
93 decode(src_properties, bl);
94 decode(part_size, bl);
95 decode(num_parts, bl);
96 decode(cur_part, bl);
97 decode(cur_ofs, bl);
98 decode(parts, bl);
99 DECODE_FINISH(bl);
100 }
101 };
102 WRITE_CLASS_ENCODER(rgw_sync_aws_multipart_upload_info)
103
104 class RGWAWSSyncModule : public RGWSyncModule {
105 public:
106 RGWAWSSyncModule() {}
107 bool supports_data_export() override { return false;}
108 int create_instance(CephContext *cct, const JSONFormattable& config, RGWSyncModuleInstanceRef *instance) override;
109 };
110
111 #endif /* RGW_SYNC_MODULE_AWS_H */