summaryrefslogtreecommitdiffstats
path: root/src/cls/rgw/cls_rgw_client.cc
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@redhat.com>2014-12-06 00:52:26 +0100
committerYehuda Sadeh <yehuda@redhat.com>2015-01-14 04:21:26 +0100
commit0d1f97ff318bcf6ec60c5257b8b501d792d0b16e (patch)
tree6e10cf40fc404dc014f2eb8265a30183961cfe66 /src/cls/rgw/cls_rgw_client.cc
parentcls_rgw: clean up CLSRGWConcurrentIO (diff)
downloadceph-0d1f97ff318bcf6ec60c5257b8b501d792d0b16e.tar.xz
ceph-0d1f97ff318bcf6ec60c5257b8b501d792d0b16e.zip
rgw, cls_rgw: keep shard ids with oids
Instead of just having the list of oids, keep the shard ids together, so that we can know on which shard the operation happened. Bucket markers are just using the shard numeric id, instead of the bucket instance shard id. This makes it easier to parse the markers appropriately. Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Diffstat (limited to 'src/cls/rgw/cls_rgw_client.cc')
-rw-r--r--src/cls/rgw/cls_rgw_client.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cls/rgw/cls_rgw_client.cc b/src/cls/rgw/cls_rgw_client.cc
index 51f1d0fbae2..1f7ff4fc05e 100644
--- a/src/cls/rgw/cls_rgw_client.cc
+++ b/src/cls/rgw/cls_rgw_client.cc
@@ -52,7 +52,7 @@ void BucketIndexAioManager::do_completion(int id) {
// for further processing
map<int, string>::iterator miter = pending_objs.find(id);
if (miter != pending_objs.end()) {
- completion_objs.push_back(miter->second);
+ completion_objs[id] = miter->second;
pending_objs.erase(miter);
}
@@ -60,7 +60,7 @@ void BucketIndexAioManager::do_completion(int id) {
}
bool BucketIndexAioManager::wait_for_completions(int valid_ret_code,
- int *num_completions, int *ret_code, vector<string> *objs) {
+ int *num_completions, int *ret_code, map<int, string> *objs) {
lock.Lock();
if (pendings.empty() && completions.empty()) {
lock.Unlock();
@@ -71,11 +71,11 @@ bool BucketIndexAioManager::wait_for_completions(int valid_ret_code,
// Clear the completed AIOs
list<librados::AioCompletion*>::iterator iter = completions.begin();
- list<string>::iterator liter = completion_objs.begin();
+ map<int, string>::iterator liter = completion_objs.begin();
for (; iter != completions.end() && liter != completion_objs.end(); ++iter, ++liter) {
int r = (*iter)->get_return_value();
if (objs && r == 0) {
- objs->push_back(*liter);
+ (*objs)[liter->first] = liter->second;
}
if (ret_code && (r < 0 && r != valid_ret_code))
(*ret_code) = r;