]> git.proxmox.com Git - ceph.git/blob - ceph/src/rgw/services/svc_bucket.h
import quincy beta 17.1.0
[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 std::string get_entrypoint_meta_key(const rgw_bucket& bucket);
31 static std::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 std::string& key,
38 RGWBucketEntryPoint *entry_point,
39 RGWObjVersionTracker *objv_tracker,
40 real_time *pmtime,
41 std::map<std::string, bufferlist> *pattrs,
42 optional_yield y,
43 const DoutPrefixProvider *dpp,
44 rgw_cache_entry_info *cache_info = nullptr,
45 boost::optional<obj_version> refresh_version = boost::none) = 0;
46
47 virtual int store_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx,
48 const std::string& key,
49 RGWBucketEntryPoint& info,
50 bool exclusive,
51 real_time mtime,
52 std::map<std::string, bufferlist> *pattrs,
53 RGWObjVersionTracker *objv_tracker,
54 optional_yield y,
55 const DoutPrefixProvider *dpp) = 0;
56
57 virtual int remove_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx,
58 const std::string& key,
59 RGWObjVersionTracker *objv_tracker,
60 optional_yield y,
61 const DoutPrefixProvider *dpp) = 0;
62
63 virtual int read_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
64 const std::string& key,
65 RGWBucketInfo *info,
66 real_time *pmtime,
67 std::map<std::string, bufferlist> *pattrs,
68 optional_yield y,
69 const DoutPrefixProvider *dpp,
70 rgw_cache_entry_info *cache_info = nullptr,
71 boost::optional<obj_version> refresh_version = boost::none) = 0;
72
73 virtual int read_bucket_info(RGWSI_Bucket_X_Ctx& ep_ctx,
74 const rgw_bucket& bucket,
75 RGWBucketInfo *info,
76 real_time *pmtime,
77 std::map<std::string, bufferlist> *pattrs,
78 boost::optional<obj_version> refresh_version,
79 optional_yield y,
80 const DoutPrefixProvider *dpp) = 0;
81
82 virtual int store_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
83 const std::string& key,
84 RGWBucketInfo& info,
85 std::optional<RGWBucketInfo *> orig_info, /* nullopt: orig_info was not fetched,
86 nullptr: orig_info was not found (new bucket instance */
87 bool exclusive,
88 real_time mtime,
89 std::map<std::string, bufferlist> *pattrs,
90 optional_yield y,
91 const DoutPrefixProvider *dpp) = 0;
92
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,
97 optional_yield y,
98 const DoutPrefixProvider *dpp) = 0;
99
100 virtual int read_bucket_stats(RGWSI_Bucket_X_Ctx& ctx,
101 const rgw_bucket& bucket,
102 RGWBucketEnt *ent,
103 optional_yield y,
104 const DoutPrefixProvider *dpp) = 0;
105
106 virtual int read_buckets_stats(RGWSI_Bucket_X_Ctx& ctx,
107 std::map<std::string, RGWBucketEnt>& m,
108 optional_yield y,
109 const DoutPrefixProvider *dpp) = 0;
110 };
111