]> git.proxmox.com Git - ceph.git/blob - ceph/src/rgw/services/svc_bucket.h
import 15.2.0 Octopus source
[ceph.git] / ceph / src / rgw / services / svc_bucket.h
1
2 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
3 // vim: ts=8 sw=2 smarttab ft=cpp
4
5 /*
6 * Ceph - scalable distributed file system
7 *
8 * Copyright (C) 2019 Red Hat, Inc.
9 *
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.
14 *
15 */
16
17
18 #pragma once
19
20 #include "rgw/rgw_service.h"
21
22 #include "svc_bucket_types.h"
23
24 class RGWSI_Bucket : public RGWServiceInstance
25 {
26 public:
27 RGWSI_Bucket(CephContext *cct) : RGWServiceInstance(cct) {}
28 virtual ~RGWSI_Bucket() {}
29
30 static string get_entrypoint_meta_key(const rgw_bucket& bucket);
31 static string get_bi_meta_key(const rgw_bucket& bucket);
32
33 virtual RGWSI_Bucket_BE_Handler& get_ep_be_handler() = 0;
34 virtual RGWSI_BucketInstance_BE_Handler& get_bi_be_handler() = 0;
35
36 virtual int read_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx,
37 const string& key,
38 RGWBucketEntryPoint *entry_point,
39 RGWObjVersionTracker *objv_tracker,
40 real_time *pmtime,
41 map<string, bufferlist> *pattrs,
42 optional_yield y,
43 rgw_cache_entry_info *cache_info = nullptr,
44 boost::optional<obj_version> refresh_version = boost::none) = 0;
45
46 virtual int store_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx,
47 const string& key,
48 RGWBucketEntryPoint& info,
49 bool exclusive,
50 real_time mtime,
51 map<string, bufferlist> *pattrs,
52 RGWObjVersionTracker *objv_tracker,
53 optional_yield y) = 0;
54
55 virtual int remove_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx,
56 const string& key,
57 RGWObjVersionTracker *objv_tracker,
58 optional_yield y) = 0;
59
60 virtual int read_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
61 const string& key,
62 RGWBucketInfo *info,
63 real_time *pmtime,
64 map<string, bufferlist> *pattrs,
65 optional_yield y,
66 rgw_cache_entry_info *cache_info = nullptr,
67 boost::optional<obj_version> refresh_version = boost::none) = 0;
68
69 virtual int read_bucket_info(RGWSI_Bucket_X_Ctx& ep_ctx,
70 const rgw_bucket& bucket,
71 RGWBucketInfo *info,
72 real_time *pmtime,
73 map<string, bufferlist> *pattrs,
74 boost::optional<obj_version> refresh_version,
75 optional_yield y) = 0;
76
77 virtual int store_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
78 const string& key,
79 RGWBucketInfo& info,
80 std::optional<RGWBucketInfo *> orig_info, /* nullopt: orig_info was not fetched,
81 nullptr: orig_info was not found (new bucket instance */
82 bool exclusive,
83 real_time mtime,
84 map<string, bufferlist> *pattrs,
85 optional_yield y) = 0;
86
87 virtual int remove_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
88 const string& key,
89 const RGWBucketInfo& bucket_info,
90 RGWObjVersionTracker *objv_tracker,
91 optional_yield y) = 0;
92
93 virtual int read_bucket_stats(RGWSI_Bucket_X_Ctx& ctx,
94 const rgw_bucket& bucket,
95 RGWBucketEnt *ent,
96 optional_yield y) = 0;
97
98 virtual int read_buckets_stats(RGWSI_Bucket_X_Ctx& ctx,
99 map<string, RGWBucketEnt>& m,
100 optional_yield y) = 0;
101 };
102