// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
-#ifndef CEPH_CLS_RGW_OPS_H
-#define CEPH_CLS_RGW_OPS_H
+#pragma once
#include "cls/rgw/cls_rgw_types.h"
rgw_bucket_dir dir;
bool is_truncated;
+ // if is_truncated is true, starting marker for next iteration; this
+ // is necessary as it's possible after maximum number of tries we
+ // still might have zero entries to return, in which case we have to
+ // at least move the ball foward
+ cls_rgw_obj_key marker;
+
// cls_filtered is not transmitted; it is assumed true for versions
// on/after 3 and false for prior versions; this allows the rgw
// layer to know when an older osd (cls) does not do the filtering
{}
void encode(ceph::buffer::list &bl) const {
- ENCODE_START(3, 2, bl);
+ ENCODE_START(4, 2, bl);
encode(dir, bl);
encode(is_truncated, bl);
+ encode(marker, bl);
ENCODE_FINISH(bl);
}
void decode(ceph::buffer::list::const_iterator &bl) {
- DECODE_START_LEGACY_COMPAT_LEN(3, 2, 2, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(4, 2, 2, bl);
decode(dir, bl);
decode(is_truncated, bl);
cls_filtered = struct_v >= 3;
+ if (struct_v >= 4) {
+ decode(marker, bl);
+ }
DECODE_FINISH(bl);
}
void dump(ceph::Formatter *f) const;
struct rgw_cls_bi_list_op {
uint32_t max;
- std::string name;
+ std::string name_filter; // limit resultto one object and its instances
std::string marker;
rgw_cls_bi_list_op() : max(0) {}
void encode(ceph::buffer::list& bl) const {
ENCODE_START(1, 1, bl);
encode(max, bl);
- encode(name, bl);
+ encode(name_filter, bl);
encode(marker, bl);
ENCODE_FINISH(bl);
}
void decode(ceph::buffer::list::const_iterator& bl) {
DECODE_START(1, bl);
decode(max, bl);
- decode(name, bl);
+ decode(name_filter, bl);
decode(marker, bl);
DECODE_FINISH(bl);
}
WRITE_CLASS_ENCODER(cls_rgw_lc_list_entries_op)
struct cls_rgw_lc_list_entries_ret {
- vector<cls_rgw_lc_entry> entries;
+ std::vector<cls_rgw_lc_entry> entries;
bool is_truncated{false};
uint8_t compat_v;
void encode(ceph::buffer::list& bl) const {
ENCODE_START(compat_v, 1, bl);
if (compat_v <= 2) {
- map<string, int> oes;
+ std::map<std::string, int> oes;
std::for_each(entries.begin(), entries.end(),
[&oes](const cls_rgw_lc_entry& elt)
{oes.insert({elt.bucket, elt.status});});
DECODE_START(3, bl);
compat_v = struct_v;
if (struct_v <= 2) {
- map<string, int> oes;
+ std::map<std::string, int> oes;
decode(oes, bl);
std::for_each(oes.begin(), oes.end(),
- [this](const std::pair<string, int>& oe)
+ [this](const std::pair<std::string, int>& oe)
{entries.push_back({oe.first, 0 /* start */,
uint32_t(oe.second)});});
} else {
void dump(ceph::Formatter *f) const;
};
WRITE_CLASS_ENCODER(cls_rgw_get_bucket_resharding_ret)
-
-#endif /* CEPH_CLS_RGW_OPS_H */