Skip to content

Commit

Permalink
rgw: introduce RGW Role Rados service
Browse files Browse the repository at this point in the history
This handles the metadata for RGW Roles with the RADOS backend

Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
  • Loading branch information
theanalyst authored and pritha-srivastava committed Jun 6, 2022
1 parent 1584fe5 commit 3fe4307
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/rgw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ set(librgw_common_srcs
services/svc_quota.cc
services/svc_sync_modules.cc
services/svc_rados.cc
services/svc_role_rados.cc
services/svc_sys_obj.cc
services/svc_sys_obj_cache.cc
services/svc_sys_obj_core.cc
Expand Down
6 changes: 6 additions & 0 deletions src/rgw/services/svc_role_rados.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "svc_role_rados.h"

RGWSI_MetaBackend_Handler* RGWSI_Role_RADOS::get_be_handler()
{
return be_handler;
}
79 changes: 79 additions & 0 deletions src/rgw/services/svc_role_rados.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab ft=cpp

/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2020 SUSE LLC
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software
* Foundation. See file COPYING.
*
*/

#pragma once

#include "svc_role.h"
#include "svc_meta_be.h"

class RGWSI_Role_RADOS: public RGWSI_Role
{
public:
RGWSI_Role_RADOS(CephContext *cct) : RGWSI_Role(cct) {}
~RGWSI_Role_RADOS() {}

RGWSI_MetaBackend_Handler * get_be_handler() override;

int store_info(RGWSI_MetaBackend::Context *ctx,
const RGWRole& role,
RGWObjVersionTracker * const objv_tracker,
real_time * const pmtime,
bool exclusive,
std::map<std::string, bufferlist> * pattrs,
optional_yield y) override;

int store_name(RGWSI_MetaBackend::Context *ctx,
const std::string& name,
RGWObjVersionTracker * const objv_tracker,
real_time * const pmtime,
bool exclusive,
optional_yield y) override;

int store_path(RGWSI_MetaBackend::Context *ctx,
const std::string& path,
RGWObjVersionTracker * const objv_tracker,
real_time * const pmtime,
bool exclusive,
optional_yield y) override;

int read_info(RGWSI_MetaBackend::Context *ctx,
RGWRole *role,
RGWObjVersionTracker * const objv_tracker,
real_time * const pmtime,
std::map<std::string, bufferlist> * pattrs,
optional_yield y) override;

int read_name(RGWSI_MetaBackend::Context *ctx,
std::string& name,
RGWObjVersionTracker * const objv_tracker,
real_time * const pmtime,
optional_yield y) override;

int read_path(RGWSI_MetaBackend::Context *ctx,
std::string& path,
RGWObjVersionTracker * const objv_tracker,
real_time * const pmtime,
optional_yield y) override;

int delete_info(RGWSI_MetaBackend::Context *ctx,
const std::string& name,
RGWObjVersionTracker * const objv_tracker,
optional_yield y) override;


private:
RGWSI_MetaBackend_Handler *be_handler;
std::unique_ptr<RGWSI_MetaBackend::Module> be_module;
};

0 comments on commit 3fe4307

Please sign in to comment.