void set_prefix(const string& p) {
prefix = p;
+ list_op.params.prefix = prefix;
}
int init() {
bool check(lc_op_ctx& oc, ceph::real_time *exp_time) override {
auto& o = oc.o;
if (!o.is_current()) {
+ ldout(oc.cct, 20) << __func__ << "(): key=" << o.key << ": not current, skipping" << dendl;
return false;
}
auto& op = oc.op;
if (op.expiration <= 0) {
if (op.expiration_date == boost::none) {
+ ldout(oc.cct, 20) << __func__ << "(): key=" << o.key << ": no expiration set in rule, skipping" << dendl;
return false;
}
is_expired = ceph_clock_now() >= ceph::real_clock::to_time_t(*op.expiration_date);
is_expired = obj_has_expired(oc.cct, mtime, op.expiration, exp_time);
}
+ ldout(oc.cct, 20) << __func__ << "(): key=" << o.key << ": is_expired=" << (int)is_expired << dendl;
return is_expired;
}
public:
bool check(lc_op_ctx& oc, ceph::real_time *exp_time) override {
auto& o = oc.o;
- if (!o.is_current()) {
+ if (o.is_current()) {
+ ldout(oc.cct, 20) << __func__ << "(): key=" << o.key << ": current version, skipping" << dendl;
return false;
}
bool expiration = oc.op.noncur_expiration;
bool is_expired = obj_has_expired(oc.cct, mtime, expiration, exp_time);
+ ldout(oc.cct, 20) << __func__ << "(): key=" << o.key << ": is_expired=" << is_expired << dendl;
return is_expired;
}
bool check(lc_op_ctx& oc, ceph::real_time *exp_time) override {
auto& o = oc.o;
if (!o.is_delete_marker()) {
+ ldout(oc.cct, 20) << __func__ << "(): key=" << o.key << ": not a delete marker, skipping" << dendl;
return false;
}
if (oc.ol.next_has_same_name()) {
+ ldout(oc.cct, 20) << __func__ << "(): key=" << o.key << ": next is same object, skipping" << dendl;
return false;
}
}
if (!cont) {
- ldout(env.store->ctx(), 20) << __func__ << "(): skipping entry: " << o.key << dendl;
+ ldout(env.store->ctx(), 20) << __func__ << "(): key=" << o.key << ": no rule match, skipping" << dendl;
return 0;
}
if (!is_valid_op(op)) {
continue;
}
+ ldpp_dout(this, 20) << __func__ << "(): prefix=" << prefix_iter->first << dendl;
if (prefix_iter != prefix_map.begin() &&
(prefix_iter->first.compare(0, prev(prefix_iter)->first.length(), prev(prefix_iter)->first) == 0)) {
next_marker = pre_marker;
ceph::real_time mtime;
rgw_bucket_dir_entry o;
for (; ol.get_obj(&o); ol.next()) {
+ ldpp_dout(this, 20) << __func__ << "(): key=" << o.key << dendl;
int ret = orule.process(o);
if (ret < 0) {
ldpp_dout(this, 20) << "ERROR: orule.process() returned ret=" << ret << dendl;