summaryrefslogtreecommitdiffstats
path: root/src/rgw/services/svc_datalog_rados.cc
blob: 0be8bb6ac2cf3cf4c1938922d8429995b2974d45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#include "svc_datalog_rados.h"
#include "svc_zone.h"
#include "svc_cls.h"

#include "rgw/rgw_bucket.h"


#define dout_subsys ceph_subsys_rgw

RGWSI_DataLog_RADOS::RGWSI_DataLog_RADOS(CephContext *cct) : RGWServiceInstance(cct) {
}

RGWSI_DataLog_RADOS::~RGWSI_DataLog_RADOS() {
}

int RGWSI_DataLog_RADOS::init(RGWSI_Zone *_zone_svc, RGWSI_Cls *_cls_svc)
{
  svc.zone = _zone_svc;
  svc.cls = _cls_svc;

  return 0;
}

int RGWSI_DataLog_RADOS::do_start()
{
  log.reset(new RGWDataChangesLog(svc.zone, svc.cls));
  
  return 0;
}

void RGWSI_DataLog_RADOS::shutdown()
{
  log.reset();
}

void RGWSI_DataLog_RADOS::set_observer(rgw::BucketChangeObserver *observer)
{
  log->set_observer(observer);
}

int RGWSI_DataLog_RADOS::get_log_shard_id(rgw_bucket& bucket, int shard_id)
{
  return log->get_log_shard_id(bucket, shard_id);
}

const std::string& RGWSI_DataLog_RADOS::get_oid(int shard_id) const
{
  return log->get_oid(shard_id);
}

int RGWSI_DataLog_RADOS::get_info(int shard_id, RGWDataChangesLogInfo *info)
{
  return log->get_info(shard_id, info);
}

int RGWSI_DataLog_RADOS::add_entry(const rgw_bucket& bucket, int shard_id)
{
  return log->add_entry(bucket, shard_id);
}

int RGWSI_DataLog_RADOS::list_entries(int shard, const real_time& start_time, const real_time& end_time, int max_entries,
                 list<rgw_data_change_log_entry>& entries,
                 const string& marker,
                 string *out_marker,
                 bool *truncated)
{
  return log->list_entries(shard, start_time, end_time, max_entries,
                           entries, marker, out_marker, truncated);
}

int RGWSI_DataLog_RADOS::list_entries(const real_time& start_time, const real_time& end_time, int max_entries,
				      list<rgw_data_change_log_entry>& entries, RGWDataChangesLogMarker& marker, bool *ptruncated)
{
  return log->list_entries(start_time, end_time, max_entries,
			   entries, marker, ptruncated);
}

int RGWSI_DataLog_RADOS::trim_entries(int shard_id, const real_time& start_time, const real_time& end_time,
                                      const string& start_marker, const string& end_marker)
{
  return log->trim_entries(shard_id, start_time, end_time, start_marker, end_marker);
}