2 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
3 // vim: ts=8 sw=2 smarttab ft=cpp
6 * Ceph - scalable distributed file system
8 * Copyright (C) 2019 Red Hat, Inc.
10 * This is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License version 2.1, as published by the Free Software
13 * Foundation. See file COPYING.
20 #include "rgw/rgw_service.h"
22 #include "svc_bucket_types.h"
24 class RGWSI_Bucket
: public RGWServiceInstance
27 RGWSI_Bucket(CephContext
*cct
) : RGWServiceInstance(cct
) {}
28 virtual ~RGWSI_Bucket() {}
30 static std::string
get_entrypoint_meta_key(const rgw_bucket
& bucket
);
31 static std::string
get_bi_meta_key(const rgw_bucket
& bucket
);
33 virtual RGWSI_Bucket_BE_Handler
& get_ep_be_handler() = 0;
34 virtual RGWSI_BucketInstance_BE_Handler
& get_bi_be_handler() = 0;
36 virtual int read_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx
& ctx
,
37 const std::string
& key
,
38 RGWBucketEntryPoint
*entry_point
,
39 RGWObjVersionTracker
*objv_tracker
,
41 std::map
<std::string
, bufferlist
> *pattrs
,
43 const DoutPrefixProvider
*dpp
,
44 rgw_cache_entry_info
*cache_info
= nullptr,
45 boost::optional
<obj_version
> refresh_version
= boost::none
) = 0;
47 virtual int store_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx
& ctx
,
48 const std::string
& key
,
49 RGWBucketEntryPoint
& info
,
52 std::map
<std::string
, bufferlist
> *pattrs
,
53 RGWObjVersionTracker
*objv_tracker
,
55 const DoutPrefixProvider
*dpp
) = 0;
57 virtual int remove_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx
& ctx
,
58 const std::string
& key
,
59 RGWObjVersionTracker
*objv_tracker
,
61 const DoutPrefixProvider
*dpp
) = 0;
63 virtual int read_bucket_instance_info(RGWSI_Bucket_BI_Ctx
& ctx
,
64 const std::string
& key
,
67 std::map
<std::string
, bufferlist
> *pattrs
,
69 const DoutPrefixProvider
*dpp
,
70 rgw_cache_entry_info
*cache_info
= nullptr,
71 boost::optional
<obj_version
> refresh_version
= boost::none
) = 0;
73 virtual int read_bucket_info(RGWSI_Bucket_X_Ctx
& ep_ctx
,
74 const rgw_bucket
& bucket
,
77 std::map
<std::string
, bufferlist
> *pattrs
,
78 boost::optional
<obj_version
> refresh_version
,
80 const DoutPrefixProvider
*dpp
) = 0;
82 virtual int store_bucket_instance_info(RGWSI_Bucket_BI_Ctx
& ctx
,
83 const std::string
& key
,
85 std::optional
<RGWBucketInfo
*> orig_info
, /* nullopt: orig_info was not fetched,
86 nullptr: orig_info was not found (new bucket instance */
89 std::map
<std::string
, bufferlist
> *pattrs
,
91 const DoutPrefixProvider
*dpp
) = 0;
93 virtual int remove_bucket_instance_info(RGWSI_Bucket_BI_Ctx
& ctx
,
94 const std::string
& key
,
95 const RGWBucketInfo
& bucket_info
,
96 RGWObjVersionTracker
*objv_tracker
,
98 const DoutPrefixProvider
*dpp
) = 0;
100 virtual int read_bucket_stats(RGWSI_Bucket_X_Ctx
& ctx
,
101 const rgw_bucket
& bucket
,
104 const DoutPrefixProvider
*dpp
) = 0;
106 virtual int read_buckets_stats(RGWSI_Bucket_X_Ctx
& ctx
,
107 std::map
<std::string
, RGWBucketEnt
>& m
,
109 const DoutPrefixProvider
*dpp
) = 0;