*c = coll_t(coll);
int64_t pool = -1;
pg_t pg;
- snapid_t pg_snap;
- if (c->is_pg(pg, pg_snap))
+ if (c->is_pg_prefix(pg))
pool = (int64_t)pg.pool();
(*hoid) = hobject_t(name, key, snap, hash, pool);
return true;
bool r = parse_object(long_name.c_str(), *out);
int64_t pool = -1;
pg_t pg;
- snapid_t snap;
- if (coll().is_pg(pg, snap))
+ if (coll().is_pg_prefix(pg))
pool = (int64_t)pg.pool();
out->pool = pool;
if (!r) return r;
int64_t pool = -1;
pg_t pg;
- snapid_t pg_snap;
- if (coll().is_pg(pg, pg_snap))
+ if (coll().is_pg_prefix(pg))
pool = (int64_t)pg.pool();
(*out) = hobject_t(name, key, snap, hash, pool);
return true;
return true;
}
+bool coll_t::is_pg_prefix(pg_t& pgid) const
+{
+ const char *cstr(str.c_str());
+
+ if (!pgid.parse(cstr))
+ return false;
+ const char *snap_start = strchr(cstr, '_');
+ if (!snap_start)
+ return false;
+ return true;
+}
+
bool coll_t::is_removal(uint64_t *seq, pg_t *pgid) const
{
if (str.substr(0, 11) != string("FORREMOVAL_"))
return str < rhs.str;
}
+ bool is_pg_prefix(pg_t& pgid) const;
bool is_pg(pg_t& pgid, snapid_t& snap) const;
bool is_temp(pg_t& pgid) const;
bool is_removal(uint64_t *seq, pg_t *pgid) const;