const ghobject_t &start, ///< [in] object at which to start
const ghobject_t &end, ///< [in] list only objects < end
int max_count, ///< [in] return at most max_count objects
- snapid_t seq, ///< [in] list only objects with snap >= seq
vector<ghobject_t> *ls, ///< [out] Listed objects
ghobject_t *next ///< [out] Next object to list
) = 0;
vector<ghobject_t> objects;
ghobject_t max;
while (!max.is_max()) {
- r = collection_list(cid, max, ghobject_t::get_max(), 300, 0, &objects, &max);
+ r = collection_list(cid, max, ghobject_t::get_max(), 300, &objects, &max);
if (r < 0)
return r;
for (vector<ghobject_t>::iterator i = objects.begin();
vector<ghobject_t> ls;
collection_list_handle_t handle;
- r = index->collection_list_partial(ghobject_t(), ghobject_t::get_max(), 1, 0, &ls, NULL);
+ r = index->collection_list_partial(ghobject_t(), ghobject_t::get_max(), 1, &ls, NULL);
if (r < 0) {
assert(!m_filestore_fail_eio || r != -EIO);
return false;
return ret;
}
int FileStore::collection_list(coll_t c, ghobject_t start, ghobject_t end, int max,
- snapid_t seq, vector<ghobject_t> *ls, ghobject_t *next)
+ vector<ghobject_t> *ls, ghobject_t *next)
{
if (start.is_max())
return 0;
if (start < sep) {
dout(10) << __func__ << " first checking temp pool" << dendl;
coll_t temp = c.get_temp();
- int r = collection_list(temp, start, end, max, seq, ls, next);
+ int r = collection_list(temp, start, end, max, ls, next);
if (r < 0)
return r;
if (*next != ghobject_t::get_max())
assert(NULL != index.index);
RWLock::RLocker l((index.index)->access_lock);
- r = index->collection_list_partial(start, end, max, seq, ls, next);
+ r = index->collection_list_partial(start, end, max, ls, next);
if (r < 0) {
assert(!m_filestore_fail_eio || r != -EIO);
collection_list(
cid,
next, ghobject_t::get_max(),
- get_ideal_list_max(), 0,
+ get_ideal_list_max(),
&objects,
&next);
if (objects.empty())
collection_list(
dest,
next, ghobject_t::get_max(),
- get_ideal_list_max(), 0,
+ get_ideal_list_max(),
&objects,
&next);
if (objects.empty())
// collections
int collection_list(coll_t c, ghobject_t start, ghobject_t end, int max,
- snapid_t seq, vector<ghobject_t> *ls, ghobject_t *next);
+ vector<ghobject_t> *ls, ghobject_t *next);
int list_collections(vector<coll_t>& ls);
int list_collections(vector<coll_t>& ls, bool include_temp);
int collection_version_current(coll_t c, uint32_t *version);
int HashIndex::_collection_list_partial(const ghobject_t &start,
const ghobject_t &end,
int max_count,
- snapid_t seq,
vector<ghobject_t> *ls,
ghobject_t *next) {
vector<string> path;
if (!next)
next = &_next;
*next = start;
- dout(20) << "_collection_list_partial start:" << start << " end:" << end << "-" << max_count << " ls.size " << ls->size() << dendl;
- return list_by_hash(path, end, max_count, seq, next, ls);
+ dout(20) << __func__ << " start:" << start << " end:" << end << "-" << max_count << " ls.size " << ls->size() << dendl;
+ return list_by_hash(path, end, max_count, next, ls);
}
int HashIndex::prep_delete() {
int HashIndex::get_path_contents_by_hash(const vector<string> &path,
const string *lower_bound,
const ghobject_t *next_object,
- const snapid_t *seq,
set<string> *hash_prefixes,
set<pair<string, ghobject_t> > *objects) {
set<string> subdirs;
continue;
if (next_object && i->second < *next_object)
continue;
- if (seq && i->second.hobj.snap < *seq)
- continue;
hash_prefixes->insert(hash_prefix);
objects->insert(pair<string, ghobject_t>(hash_prefix, i->second));
}
int HashIndex::list_by_hash(const vector<string> &path,
ghobject_t end,
int max_count,
- snapid_t seq,
ghobject_t *next,
vector<ghobject_t> *out) {
assert(out);
int r = get_path_contents_by_hash(path,
NULL,
next,
- &seq,
&hash_prefixes,
&objects);
if (r < 0)
r = list_by_hash(next_path,
end,
max_count,
- seq,
&next_recurse,
out);
const ghobject_t &start,
const ghobject_t &end,
int max_count,
- snapid_t seq,
vector<ghobject_t> *ls,
ghobject_t *next
);
const vector<string> &path, /// [in] Path to list
const string *lower_bound, /// [in] list > *lower_bound
const ghobject_t *next_object, /// [in] list > *next_object
- const snapid_t *seq, /// [in] list >= *seq
set<string> *hash_prefixes, /// [out] prefixes in dir
set<pair<string, ghobject_t> > *objects /// [out] objects
);
const vector<string> &path, /// [in] Path to list
ghobject_t end, /// [in] List only objects < end
int max_count, /// [in] List at most max_count
- snapid_t seq, /// [in] list only objects where snap >= seq
ghobject_t *next, /// [in,out] List objects >= *next
vector<ghobject_t> *out /// [out] Listed objects
); ///< @return Error Code, 0 on success
vector<ghobject_t> objects;
ghobject_t max;
while (!max.is_max()) {
- r = collection_list(cid, max, ghobject_t::get_max(), 300, 0, &objects, &max);
+ r = collection_list(cid, max, ghobject_t::get_max(), 300, &objects, &max);
if (r < 0)
goto out;
}
int KeyValueStore::collection_list(coll_t c, ghobject_t start,
- ghobject_t end, int max, snapid_t seq,
+ ghobject_t end, int max,
vector<ghobject_t> *ls, ghobject_t *next)
{
if ( max < 0)
int move_size = 0;
while (1) {
collection_list(cid, current, ghobject_t::get_max(),
- get_ideal_list_max(), 0, &objects, &next);
+ get_ideal_list_max(), &objects, &next);
dout(20) << __func__ << cid << "objects size: " << objects.size()
<< dendl;
ghobject_t next;
while (1) {
collection_list(cid, next, ghobject_t::get_max(),
- get_ideal_list_max(), 0, &objects, &next);
+ get_ideal_list_max(), &objects, &next);
if (objects.empty())
break;
next = ghobject_t();
while (1) {
collection_list(dest, next, ghobject_t::get_max(),
- get_ideal_list_max(), 0, &objects, &next);
+ get_ideal_list_max(), &objects, &next);
if (objects.empty())
break;
bool collection_exists(coll_t c);
bool collection_empty(coll_t c);
int collection_list(coll_t c, ghobject_t start, ghobject_t end,
- int max, snapid_t snap,
+ int max,
vector<ghobject_t> *ls, ghobject_t *next);
int collection_version_current(coll_t c, uint32_t *version);
int LFNIndex::collection_list_partial(const ghobject_t &start,
const ghobject_t &end,
int max_count,
- snapid_t seq,
vector<ghobject_t> *ls,
ghobject_t *next)
{
- return _collection_list_partial(start, end, max_count, seq, ls, next);
+ return _collection_list_partial(start, end, max_count, ls, next);
}
/* Derived class utility methods */
const ghobject_t &start,
const ghobject_t &end,
int max_count,
- snapid_t seq,
vector<ghobject_t> *ls,
ghobject_t *next
);
const ghobject_t &start,
const ghobject_t &end,
int max_count,
- snapid_t seq,
vector<ghobject_t> *ls,
ghobject_t *next
) = 0;
}
int MemStore::collection_list(coll_t cid, ghobject_t start, ghobject_t end,
- int max, snapid_t snap,
+ int max,
vector<ghobject_t> *ls, ghobject_t *next)
{
CollectionRef c = get_collection(cid);
bool collection_exists(coll_t c);
bool collection_empty(coll_t c);
int collection_list(coll_t cid, ghobject_t start, ghobject_t end,
- int max, snapid_t snap,
+ int max,
vector<ghobject_t> *ls, ghobject_t *next);
int omap_get(
* @return zero on success, or negative error
*/
virtual int collection_list(coll_t c, ghobject_t start, ghobject_t end, int max,
- snapid_t seq, vector<ghobject_t> *ls, ghobject_t *next) = 0;
+ vector<ghobject_t> *ls, ghobject_t *next) = 0;
/// OMAP
/// Get omap contents
vector<ghobject_t> objects;
store->collection_list(*p, next, ghobject_t::get_max(),
store->get_ideal_list_max(),
- 0, &objects, &next);
+ &objects, &next);
if (objects.empty())
break;
vector<ghobject_t>::iterator q;
SnapMapper mapper(&driver, 0, 0, 0, pgid.shard);
vector<ghobject_t> objects;
- store->collection_list(tmp, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &objects, 0);
+ store->collection_list(tmp, ghobject_t(), ghobject_t::get_max(), INT_MAX, &objects, 0);
// delete them.
unsigned removed = 0;
next,
ghobject_t::get_max(),
store->get_ideal_list_max(),
- 0,
&olist,
&next);
for (vector<ghobject_t>::iterator i = olist.begin();
start,
cct->_conf->osd_scrub_chunk_min,
cct->_conf->osd_scrub_chunk_max,
- 0,
&objects,
&candidate_end);
assert(ret >= 0);
const hobject_t &begin,
int min,
int max,
- snapid_t seq,
vector<hobject_t> *ls,
hobject_t *next)
{
_next,
ghobject_t::get_max(),
max - ls->size(),
- seq,
&objects,
&_next);
if (r != 0)
ghobject_t(start, ghobject_t::NO_GEN, get_parent()->whoami_shard().shard),
ghobject_t(end, ghobject_t::NO_GEN, get_parent()->whoami_shard().shard),
INT_MAX,
- seq,
&objects,
NULL);
ls->reserve(objects.size());
const hobject_t &begin,
int min,
int max,
- snapid_t seq,
vector<hobject_t> *ls,
hobject_t *next);
current,
list_size,
list_size,
- snapid,
&sentries,
&next);
if (r != 0) {
current,
list_size,
list_size,
- snapid,
&sentries,
&next);
if (r != 0) {
vector<hobject_t> ls;
ls.reserve(max);
- int r = pgbackend->objects_list_partial(bi->begin, min, max, 0, &ls, &bi->end);
+ int r = pgbackend->objects_list_partial(bi->begin, min, max, &ls, &bi->end);
assert(r >= 0);
dout(10) << " got " << ls.size() << " items, next " << bi->end << dendl;
dout(20) << ls << dendl;
vector<hobject_t> ls;
hobject_t next;
int r = pgbackend->objects_list_partial(agent_state->position, ls_min, ls_max,
- 0 /* no filtering by snapid */,
&ls, &next);
assert(r >= 0);
dout(20) << __func__ << " got " << ls.size() << " objects" << dendl;
int err;
std::vector<ghobject_t> b_objects, a_objects;
- err = b_store->collection_list(coll, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &b_objects, NULL);
+ err = b_store->collection_list(coll, ghobject_t(), ghobject_t::get_max(), INT_MAX, &b_objects, NULL);
if (err < 0) {
dout(0) << "diff_objects list on verify coll " << coll.to_str()
<< " returns " << err << dendl;
return true;
}
- err = a_store->collection_list(coll, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &a_objects, NULL);
+ err = a_store->collection_list(coll, ghobject_t(), ghobject_t::get_max(), INT_MAX, &a_objects, NULL);
if (err < 0) {
dout(0) << "diff_objects list on store coll " << coll.to_str()
<< " returns " << err << dendl;
ghobject_t next, current;
while (!next.is_max()) {
int r = store->collection_list(cid, current, ghobject_t::get_max(), 50,
- 0, &objects, &next);
+ &objects, &next);
ASSERT_EQ(r, 0);
cout << " got " << objects.size() << " next " << next << std::endl;
for (vector<ghobject_t>::iterator p = objects.begin(); p != objects.end();
ghobject_t next, current;
while (!next.is_max()) {
int r = store->collection_list(cid, current, ghobject_t::get_max(), 50,
- 0, &objects, &next);
+ &objects, &next);
ASSERT_EQ(r, 0);
cout << " got " << objects.size() << " next " << next << std::endl;
for (vector<ghobject_t>::iterator p = objects.begin(); p != objects.end();
set<ghobject_t> listed;
vector<ghobject_t> objects;
- r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &objects, 0);
+ r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(), INT_MAX, &objects, 0);
ASSERT_EQ(r, 0);
cerr << "objects.size() is " << objects.size() << std::endl;
ghobject_t::get_max(),
ghobject_t::get_max(),
60,
- 0,
&objects,
&next
);
r = store->collection_list(cid, start,
ghobject_t::get_max(),
60,
- 0,
&objects,
&next);
ASSERT_TRUE(sorted(objects));
while (1) {
cerr << "scanning..." << std::endl;
int r = store->collection_list(cid, current, ghobject_t::get_max(), 100,
- 0, &objects, &next);
+ &objects, &next);
ASSERT_EQ(r, 0);
ASSERT_TRUE(sorted(objects));
objects_set.insert(objects.begin(), objects.end());
ASSERT_GT(available_objects.count(*i), (unsigned)0);
}
- int r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &objects, 0);
+ int r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(), INT_MAX, &objects, 0);
ASSERT_EQ(r, 0);
objects_set2.insert(objects.begin(), objects.end());
ASSERT_EQ(objects_set2.size(), available_objects.size());
}
}
vector<ghobject_t> objects;
- r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &objects, 0);
+ r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(), INT_MAX, &objects, 0);
ASSERT_EQ(r, 0);
set<ghobject_t> listed(objects.begin(), objects.end());
cerr << "listed.size() is " << listed.size() << " and created.size() is " << created.size() << std::endl;
ghobject_t current, next;
while (1) {
r = store->collection_list(cid, current, ghobject_t::get_max(), 60,
- 0, &objects, &next);
+ &objects, &next);
ASSERT_EQ(r, 0);
ASSERT_TRUE(sorted(objects));
for (vector<ghobject_t>::iterator i = objects.begin();
}
vector<ghobject_t> objects;
- r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &objects, 0);
+ r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(), INT_MAX,
+ &objects, 0);
ASSERT_EQ(r, 0);
set<ghobject_t> listed(objects.begin(), objects.end());
cerr << "listed.size() is " << listed.size() << " and created.size() is " << created.size() << std::endl;
ghobject_t current, next;
while (1) {
r = store->collection_list(cid, current, ghobject_t::get_max(), 60,
- 0, &objects, &next);
+ &objects, &next);
ASSERT_EQ(r, 0);
ASSERT_TRUE(sorted(objects));
for (vector<ghobject_t>::iterator i = objects.begin();
ObjectStore::Transaction t;
vector<ghobject_t> objects;
- r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &objects, 0);
+ r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(), INT_MAX,
+ &objects, 0);
ASSERT_EQ(r, 0);
ASSERT_EQ(objects.size(), num_objects);
for (vector<ghobject_t>::iterator i = objects.begin();
}
objects.clear();
- r = store->collection_list(tid, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &objects, 0);
+ r = store->collection_list(tid, ghobject_t(), ghobject_t::get_max(), INT_MAX,
+ &objects, 0);
ASSERT_EQ(r, 0);
ASSERT_EQ(objects.size(), num_objects);
for (vector<ghobject_t>::iterator i = objects.begin();
{
vector<ghobject_t> objects;
- r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &objects, 0);
+ r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(), INT_MAX,
+ &objects, 0);
ASSERT_EQ(r, 0);
ASSERT_EQ(objects.size(), 1u);
ASSERT_EQ(objects[0], oid2);
m_nr_runs.set(0);
entry->m_osr.flush();
vector<ghobject_t> ls;
- m_store->collection_list(entry->m_coll, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &ls, NULL);
+ m_store->collection_list(entry->m_coll, ghobject_t(), ghobject_t::get_max(), INT_MAX, &ls, NULL);
dout(2) << __func__ << " coll " << entry->m_coll
<< " (" << ls.size() << " objects)" << dendl;
next,
ghobject_t::get_max(),
LIST_AT_A_TIME,
- 0,
&list,
&next);
if (r < 0) {
cout << "remove_coll " << coll << std::endl;
while (!next.is_max()) {
vector<ghobject_t> objects;
- r = store->collection_list(coll, next, ghobject_t::get_max(), 300, 0,
+ r = store->collection_list(coll, next, ghobject_t::get_max(), 300,
&objects, &next);
if (r < 0)
goto out;
while (!next.is_max()) {
vector<ghobject_t> objects;
- int r = store->collection_list(coll, next, ghobject_t::get_max(), 300, 0,
+ int r = store->collection_list(coll, next, ghobject_t::get_max(), 300,
&objects, &next);
if (r < 0)
return r;