]> git.proxmox.com Git - ceph.git/blob - ceph/src/rgw/rgw_lc_tier.h
86df479e8280847c23414253ce19cddd12892312
[ceph.git] / ceph / src / rgw / rgw_lc_tier.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 CEPH_RGW_LC_TIER_H
5 #define CEPH_RGW_LC_TIER_H
6
7 #include "rgw_lc.h"
8 #include "rgw_rest_conn.h"
9 #include "rgw_rados.h"
10 #include "rgw_zone.h"
11 #include "rgw_sal_rados.h"
12 #include "rgw_cr_rest.h"
13
14 #define DEFAULT_MULTIPART_SYNC_PART_SIZE (32 * 1024 * 1024)
15 #define MULTIPART_MIN_POSSIBLE_PART_SIZE (5 * 1024 * 1024)
16
17 struct RGWLCCloudTierCtx {
18 CephContext *cct;
19 const DoutPrefixProvider *dpp;
20
21 /* Source */
22 rgw_bucket_dir_entry& o;
23 rgw::sal::Store *store;
24 RGWBucketInfo& bucket_info;
25 std::string storage_class;
26
27 rgw::sal::Object *obj;
28 RGWObjectCtx& rctx;
29
30 /* Remote */
31 RGWRESTConn& conn;
32 std::string target_bucket_name;
33 std::string target_storage_class;
34
35 std::map<std::string, RGWTierACLMapping> acl_mappings;
36 uint64_t multipart_min_part_size;
37 uint64_t multipart_sync_threshold;
38
39 bool is_multipart_upload{false};
40 bool target_bucket_created{true};
41
42 RGWLCCloudTierCtx(CephContext* _cct, const DoutPrefixProvider *_dpp,
43 rgw_bucket_dir_entry& _o, rgw::sal::Store *_store,
44 RGWBucketInfo &_binfo, rgw::sal::Object *_obj,
45 RGWObjectCtx& _rctx, RGWRESTConn& _conn, std::string& _bucket,
46 std::string& _storage_class) :
47 cct(_cct), dpp(_dpp), o(_o), store(_store), bucket_info(_binfo),
48 obj(_obj), rctx(_rctx), conn(_conn), target_bucket_name(_bucket),
49 target_storage_class(_storage_class) {}
50 };
51
52 /* Transition object to cloud endpoint */
53 int rgw_cloud_tier_transfer_object(RGWLCCloudTierCtx& tier_ctx);
54
55 #endif