vector<ghobject_t> objects;
ghobject_t max;
while (!max.is_max()) {
- r = collection_list_impl(cid, max, ghobject_t::get_max(), 300, 0, &objects, &max);
+ r = collection_list(cid, max, ghobject_t::get_max(), 300, 0, &objects, &max);
if (r < 0)
return r;
for (vector<ghobject_t>::iterator i = objects.begin();
tracepoint(objectstore, collection_empty_exit, ret);
return ret;
}
-int FileStore::collection_list_impl(coll_t c, ghobject_t start, ghobject_t end, int max,
- snapid_t seq, vector<ghobject_t> *ls, ghobject_t *next)
+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)
{
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_impl(temp, start, end, max, seq, ls, next);
+ int r = collection_list(temp, start, end, max, seq, ls, next);
if (r < 0)
return r;
if (*next != ghobject_t::get_max())
vector<ghobject_t> objects;
ghobject_t next;
while (1) {
- collection_list_impl(
+ collection_list(
cid,
next, ghobject_t::get_max(),
get_ideal_list_max(), 0,
}
next = ghobject_t();
while (1) {
- collection_list_impl(
+ collection_list(
dest,
next, ghobject_t::get_max(),
get_ideal_list_max(), 0,
const SequencerPosition &spos);
// collections
- int collection_list_impl(coll_t c, ghobject_t start, ghobject_t end, int max,
+ int collection_list(coll_t c, ghobject_t start, ghobject_t end, int max,
snapid_t seq, vector<ghobject_t> *ls, ghobject_t *next);
int list_collections(vector<coll_t>& ls);
int list_collections(vector<coll_t>& ls, bool include_temp);
vector<ghobject_t> objects;
ghobject_t max;
while (!max.is_max()) {
- r = collection_list_impl(cid, max, ghobject_t::get_max(), 300, 0, &objects, &max);
+ r = collection_list(cid, max, ghobject_t::get_max(), 300, 0, &objects, &max);
if (r < 0)
goto out;
return oids.empty();
}
-int KeyValueStore::collection_list_impl(coll_t c, ghobject_t start,
- ghobject_t end, int max, snapid_t seq,
- vector<ghobject_t> *ls, ghobject_t *next)
+int KeyValueStore::collection_list(coll_t c, ghobject_t start,
+ ghobject_t end, int max, snapid_t seq,
+ vector<ghobject_t> *ls, ghobject_t *next)
{
if ( max < 0)
return -EINVAL;
ghobject_t next, current;
int move_size = 0;
while (1) {
- collection_list_impl(cid, current, ghobject_t::get_max(),
- get_ideal_list_max(), 0, &objects, &next);
+ collection_list(cid, current, ghobject_t::get_max(),
+ get_ideal_list_max(), 0, &objects, &next);
dout(20) << __func__ << cid << "objects size: " << objects.size()
<< dendl;
vector<ghobject_t> objects;
ghobject_t next;
while (1) {
- collection_list_impl(cid, next, ghobject_t::get_max(),
- get_ideal_list_max(), 0, &objects, &next);
+ collection_list(cid, next, ghobject_t::get_max(),
+ get_ideal_list_max(), 0, &objects, &next);
if (objects.empty())
break;
next = ghobject_t();
while (1) {
- collection_list_impl(dest, next, ghobject_t::get_max(),
- get_ideal_list_max(), 0, &objects, &next);
+ collection_list(dest, next, ghobject_t::get_max(),
+ get_ideal_list_max(), 0, &objects, &next);
if (objects.empty())
break;
int list_collections(vector<coll_t>& ls);
bool collection_exists(coll_t c);
bool collection_empty(coll_t c);
- int collection_list_impl(coll_t c, ghobject_t start, ghobject_t end,
- int max, snapid_t snap,
- vector<ghobject_t> *ls, ghobject_t *next);
+ int collection_list(coll_t c, ghobject_t start, ghobject_t end,
+ int max, snapid_t snap,
+ vector<ghobject_t> *ls, ghobject_t *next);
int collection_version_current(coll_t c, uint32_t *version);
// omap (see ObjectStore.h for documentation)
return c->object_map.empty();
}
-int MemStore::collection_list_impl(coll_t cid, ghobject_t start, ghobject_t end,
- int max, snapid_t snap,
- vector<ghobject_t> *ls, ghobject_t *next)
+int MemStore::collection_list(coll_t cid, ghobject_t start, ghobject_t end,
+ int max, snapid_t snap,
+ vector<ghobject_t> *ls, ghobject_t *next)
{
CollectionRef c = get_collection(cid);
if (!c)
int list_collections(vector<coll_t>& ls);
bool collection_exists(coll_t c);
bool collection_empty(coll_t c);
- int collection_list_impl(coll_t cid, ghobject_t start, ghobject_t end,
- int max, snapid_t snap,
- vector<ghobject_t> *ls, ghobject_t *next);
+ int collection_list(coll_t cid, ghobject_t start, ghobject_t end,
+ int max, snapid_t snap,
+ vector<ghobject_t> *ls, ghobject_t *next);
int omap_get(
coll_t cid, ///< [in] Collection containing oid
* @param next [out] next item sorts >= this value
* @return zero on success, or negative error
*/
- virtual int collection_list_impl(coll_t c, ghobject_t start, ghobject_t end, int max,
- snapid_t seq, vector<ghobject_t> *ls, ghobject_t *next) = 0;
+ 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;
/// OMAP
/// Get omap contents
ghobject_t next;
while (1) {
vector<ghobject_t> objects;
- store->collection_list_impl(*p, next, ghobject_t::get_max(),
- store->get_ideal_list_max(),
- 0, &objects, &next);
+ store->collection_list(*p, next, ghobject_t::get_max(),
+ store->get_ideal_list_max(),
+ 0, &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_impl(tmp, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &objects, 0);
+ store->collection_list(tmp, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &objects, 0);
// delete them.
unsigned removed = 0;
ObjectStore::Transaction *t = new ObjectStore::Transaction;
ghobject_t next;
handle.reset_tp_timeout();
- store->collection_list_impl(
+ store->collection_list(
coll,
next,
ghobject_t::get_max(),
int r = 0;
while (!_next.is_max() && ls->size() < (unsigned)min) {
vector<ghobject_t> objects;
- int r = store->collection_list_impl(
+ int r = store->collection_list(
coll,
_next,
ghobject_t::get_max(),
{
assert(ls);
vector<ghobject_t> objects;
- int r = store->collection_list_impl(
+ int r = store->collection_list(
coll,
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 err;
std::vector<ghobject_t> b_objects, a_objects;
- err = b_store->collection_list_impl(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, 0, &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_impl(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, 0, &a_objects, NULL);
if (err < 0) {
dout(0) << "diff_objects list on store coll " << coll.to_str()
<< " returns " << err << dendl;
vector<ghobject_t> objects;
ghobject_t next, current;
while (!next.is_max()) {
- int r = store->collection_list_impl(cid, current, ghobject_t::get_max(), 50,
- 0, &objects, &next);
+ int r = store->collection_list(cid, current, ghobject_t::get_max(), 50,
+ 0, &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();
vector<ghobject_t> objects;
ghobject_t next, current;
while (!next.is_max()) {
- int r = store->collection_list_impl(cid, current, ghobject_t::get_max(), 50,
- 0, &objects, &next);
+ int r = store->collection_list(cid, current, ghobject_t::get_max(), 50,
+ 0, &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_impl(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, 0, &objects, 0);
ASSERT_EQ(r, 0);
cerr << "objects.size() is " << objects.size() << std::endl;
ghobject_t start, next;
objects.clear();
- r = store->collection_list_impl(
+ r = store->collection_list(
cid,
ghobject_t::get_max(),
ghobject_t::get_max(),
objects.clear();
listed.clear();
while (1) {
- r = store->collection_list_impl(cid, start,
- 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));
ASSERT_EQ(r, 0);
listed.insert(objects.begin(), objects.end());
ghobject_t next, current;
while (1) {
cerr << "scanning..." << std::endl;
- int r = store->collection_list_impl(cid, current, ghobject_t::get_max(), 100,
- 0, &objects, &next);
+ int r = store->collection_list(cid, current, ghobject_t::get_max(), 100,
+ 0, &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_impl(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, 0, &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_impl(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, 0, &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;
listed.clear();
ghobject_t current, next;
while (1) {
- r = store->collection_list_impl(cid, current, ghobject_t::get_max(), 60,
+ r = store->collection_list(cid, current, ghobject_t::get_max(), 60,
0, &objects, &next);
ASSERT_EQ(r, 0);
ASSERT_TRUE(sorted(objects));
}
vector<ghobject_t> objects;
- r = store->collection_list_impl(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, 0, &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;
listed.clear();
ghobject_t current, next;
while (1) {
- r = store->collection_list_impl(cid, current, ghobject_t::get_max(), 60,
- 0, &objects, &next);
+ r = store->collection_list(cid, current, ghobject_t::get_max(), 60,
+ 0, &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_impl(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, 0, &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_impl(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, 0, &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_impl(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, 0, &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_impl(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, 0, &ls, NULL);
dout(2) << __func__ << " coll " << entry->m_coll
<< " (" << ls.size() << " objects)" << dendl;
ghobject_t next;
while (!next.is_max()) {
vector<ghobject_t> list;
- int r = store->collection_list_impl(
- coll,
- next,
- ghobject_t::get_max(),
- LIST_AT_A_TIME,
- 0,
- &list,
- &next);
+ int r = store->collection_list(
+ coll,
+ next,
+ ghobject_t::get_max(),
+ LIST_AT_A_TIME,
+ 0,
+ &list,
+ &next);
if (r < 0) {
cerr << "Error listing collection: " << coll << ", "
<< cpp_strerror(r) << std::endl;
cout << "remove_coll " << coll << std::endl;
while (!next.is_max()) {
vector<ghobject_t> objects;
- r = store->collection_list_impl(coll, next, ghobject_t::get_max(), 300, 0,
+ r = store->collection_list(coll, next, ghobject_t::get_max(), 300, 0,
&objects, &next);
if (r < 0)
goto out;
while (!next.is_max()) {
vector<ghobject_t> objects;
- int r = store->collection_list_impl(coll, next, ghobject_t::get_max(), 300, 0,
+ int r = store->collection_list(coll, next, ghobject_t::get_max(), 300, 0,
&objects, &next);
if (r < 0)
return r;