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 string
get_entrypoint_meta_key(const rgw_bucket
& bucket
);
31 static 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
,
38 RGWBucketEntryPoint
*entry_point
,
39 RGWObjVersionTracker
*objv_tracker
,
41 map
<string
, bufferlist
> *pattrs
,
43 rgw_cache_entry_info
*cache_info
= nullptr,
44 boost::optional
<obj_version
> refresh_version
= boost::none
) = 0;
46 virtual int store_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx
& ctx
,
48 RGWBucketEntryPoint
& info
,
51 map
<string
, bufferlist
> *pattrs
,
52 RGWObjVersionTracker
*objv_tracker
,
53 optional_yield y
) = 0;
55 virtual int remove_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx
& ctx
,
57 RGWObjVersionTracker
*objv_tracker
,
58 optional_yield y
) = 0;
60 virtual int read_bucket_instance_info(RGWSI_Bucket_BI_Ctx
& ctx
,
64 map
<string
, bufferlist
> *pattrs
,
66 rgw_cache_entry_info
*cache_info
= nullptr,
67 boost::optional
<obj_version
> refresh_version
= boost::none
) = 0;
69 virtual int read_bucket_info(RGWSI_Bucket_X_Ctx
& ep_ctx
,
70 const rgw_bucket
& bucket
,
73 map
<string
, bufferlist
> *pattrs
,
74 boost::optional
<obj_version
> refresh_version
,
75 optional_yield y
) = 0;
77 virtual int store_bucket_instance_info(RGWSI_Bucket_BI_Ctx
& ctx
,
80 std::optional
<RGWBucketInfo
*> orig_info
, /* nullopt: orig_info was not fetched,
81 nullptr: orig_info was not found (new bucket instance */
84 map
<string
, bufferlist
> *pattrs
,
85 optional_yield y
) = 0;
87 virtual int remove_bucket_instance_info(RGWSI_Bucket_BI_Ctx
& ctx
,
89 const RGWBucketInfo
& bucket_info
,
90 RGWObjVersionTracker
*objv_tracker
,
91 optional_yield y
) = 0;
93 virtual int read_bucket_stats(RGWSI_Bucket_X_Ctx
& ctx
,
94 const rgw_bucket
& bucket
,
96 optional_yield y
) = 0;
98 virtual int read_buckets_stats(RGWSI_Bucket_X_Ctx
& ctx
,
99 map
<string
, RGWBucketEnt
>& m
,
100 optional_yield y
) = 0;