]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rgw/rgw_object_expirer_core.h
813eca3f939a17724dacca94acd93172f76c6f7b
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
13 #include "auth/Crypto.h"
15 #include "common/armor.h"
16 #include "common/ceph_json.h"
17 #include "common/config.h"
18 #include "common/ceph_argparse.h"
19 #include "common/Formatter.h"
20 #include "common/errno.h"
22 #include "common/Mutex.h"
23 #include "common/Cond.h"
24 #include "common/Thread.h"
26 #include "global/global_init.h"
28 #include "include/utime.h"
29 #include "include/str_list.h"
32 #include "rgw_bucket.h"
33 #include "rgw_rados.h"
35 #include "rgw_acl_s3.h"
37 #include "rgw_formats.h"
38 #include "rgw_usage.h"
39 #include "rgw_replica_log.h"
41 class RGWObjectExpirer
{
45 int init_bucket_info(const std::string
& tenant_name
,
46 const std::string
& bucket_name
,
47 const std::string
& bucket_id
,
48 RGWBucketInfo
& bucket_info
);
50 class OEWorker
: public Thread
{
57 OEWorker(CephContext
* const cct
,
58 RGWObjectExpirer
* const oe
)
64 void *entry() override
;
69 std::atomic
<bool> down_flag
= { false };
72 explicit RGWObjectExpirer(RGWRados
*_store
)
76 int garbage_single_object(objexp_hint_entry
& hint
);
78 void garbage_chunk(std::list
<cls_timeindex_entry
>& entries
, /* in */
79 bool& need_trim
); /* out */
81 void trim_chunk(const std::string
& shard
,
84 const string
& from_marker
,
85 const string
& to_marker
);
87 bool process_single_shard(const std::string
& shard
,
88 const utime_t
& last_run
,
89 const utime_t
& round_start
);
91 bool inspect_all_shards(const utime_t
& last_run
,
92 const utime_t
& round_start
);
95 void start_processor();
96 void stop_processor();
98 #endif /* CEPH_OBJEXP_H */