static void get_index_by_client(const string& client_id, const string& op_id, string& index)
{
- string s = statelog_index_by_client_prefix + "_";
- s.append(client_id + "_" + op_id);
+ index = statelog_index_by_client_prefix;
+ index.append(client_id + "_" + op_id);
}
static void get_index_by_client(cls_statelog_entry& entry, string& index)
char buf[16];
snprintf(buf, sizeof(buf), "%d_", (int)object.size());
- index = statelog_index_by_object_prefix + "_" + buf + "_"; /* append object length to ensure uniqueness */
+ index = statelog_index_by_object_prefix + buf; /* append object length to ensure uniqueness */
index.append(object + "_" + op_id);
}
string from_index;
string match_prefix;
- if (op.object.empty()) {
+ if (!op.client_id.empty()) {
get_index_by_client(op.client_id, op.op_id, match_prefix);
- } else {
+ } else if (!op.object.empty()) {
get_index_by_object(op.object, op.op_id, match_prefix);
+ } else {
+ match_prefix = statelog_index_by_object_prefix;
}
if (op.marker.empty()) {
if (rc < 0)
return rc;
+CLS_LOG(0, "%s: %d from_index=%s match_prefix=%s", __FILE__, __LINE__, from_index.c_str(), match_prefix.c_str());
cls_statelog_list_ret ret;
list<cls_statelog_entry>& entries = ret.entries;
for (i = 0; i < max_entries && iter != keys.end(); ++i, ++iter) {
const string& index = iter->first;
marker = index;
+CLS_LOG(0, "%s: %d index=%s", __FILE__, __LINE__, index.c_str());
bufferlist& bl = iter->second;
bufferlist::iterator biter = bl.begin();