1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab ft=cpp
4 #ifndef CEPH_RGW_LC_TIER_H
5 #define CEPH_RGW_LC_TIER_H
8 #include "rgw_rest_conn.h"
11 #include "rgw_sal_rados.h"
12 #include "rgw_cr_rest.h"
14 #define DEFAULT_MULTIPART_SYNC_PART_SIZE (32 * 1024 * 1024)
15 #define MULTIPART_MIN_POSSIBLE_PART_SIZE (5 * 1024 * 1024)
17 struct RGWLCCloudTierCtx
{
19 const DoutPrefixProvider
*dpp
;
22 rgw_bucket_dir_entry
& o
;
23 rgw::sal::Store
*store
;
24 RGWBucketInfo
& bucket_info
;
25 std::string storage_class
;
27 rgw::sal::Object
*obj
;
32 std::string target_bucket_name
;
33 std::string target_storage_class
;
35 std::map
<std::string
, RGWTierACLMapping
> acl_mappings
;
36 uint64_t multipart_min_part_size
;
37 uint64_t multipart_sync_threshold
;
39 bool is_multipart_upload
{false};
40 bool target_bucket_created
{true};
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
) {}
52 /* Transition object to cloud endpoint */
53 int rgw_cloud_tier_transfer_object(RGWLCCloudTierCtx
& tier_ctx
);