]> git.proxmox.com Git - ceph.git/blame - ceph/src/rgw/services/svc_sync_modules.cc
import 15.2.0 Octopus source
[ceph.git] / ceph / src / rgw / services / svc_sync_modules.cc
CommitLineData
9f95a23c
TL
1// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2// vim: ts=8 sw=2 smarttab ft=cpp
3
11fdf7f2 4#include "svc_sync_modules.h"
9f95a23c 5#include "svc_zone.h"
11fdf7f2
TL
6
7#include "rgw/rgw_sync_module.h"
9f95a23c
TL
8#include "rgw/rgw_zone.h"
9
10#define dout_subsys ceph_subsys_rgw
11fdf7f2 11
9f95a23c 12void RGWSI_SyncModules::init(RGWSI_Zone *zone_svc)
11fdf7f2 13{
9f95a23c 14 svc.zone = zone_svc;
11fdf7f2
TL
15 sync_modules_manager = new RGWSyncModulesManager();
16 rgw_register_sync_modules(sync_modules_manager);
17}
18
9f95a23c
TL
19int RGWSI_SyncModules::do_start()
20{
21 auto& zone_public_config = svc.zone->get_zone();
22
23 int ret = sync_modules_manager->create_instance(cct, zone_public_config.tier_type, svc.zone->get_zone_params().tier_config, &sync_module);
24 if (ret < 0) {
25 lderr(cct) << "ERROR: failed to start sync module instance, ret=" << ret << dendl;
26 if (ret == -ENOENT) {
27 lderr(cct) << "ERROR: " << zone_public_config.tier_type
28 << " sync module does not exist. valid sync modules: "
29 << sync_modules_manager->get_registered_module_names()
30 << dendl;
31 }
32 return ret;
33 }
34
35 ldout(cct, 20) << "started sync module instance, tier type = " << zone_public_config.tier_type << dendl;
36
37 return 0;
38}
39
11fdf7f2
TL
40RGWSI_SyncModules::~RGWSI_SyncModules()
41{
42 delete sync_modules_manager;
43}
44