Use collection_list_impl directly.
Signed-off-by: Xiaoxi Chen <xiaoxi.chen@intel.com>
vector<ghobject_t> objects;
ghobject_t max;
while (!max.is_max()) {
- r = collection_list_partial(cid, max, 200, 300, 0, &objects, &max);
+ r = collection_list_impl(cid, max, ghobject_t::get_max(), 300, 0, &objects, &max);
if (r < 0)
return r;
for (vector<ghobject_t>::iterator i = objects.begin();
return 0;
}
-int FileStore::collection_list_partial(coll_t c, ghobject_t start,
- int min, int max, snapid_t seq,
- vector<ghobject_t> *ls, ghobject_t *next)
-{
- tracepoint(objectstore, collection_list_partial_enter, c.c_str());
- dout(10) << "collection_list_partial: " << c << " start " << start << dendl;
-
- assert(next);
- int r = collection_list_impl(c, start, ghobject_t::get_max(), max, seq, ls, next);
- tracepoint(objectstore, collection_list_partial_exit, 0);
- return r;
-}
-
int FileStore::collection_list(coll_t c, vector<ghobject_t>& ls)
{
tracepoint(objectstore, collection_list_enter, c.c_str());
vector<ghobject_t> objects;
ghobject_t next;
while (1) {
- collection_list_partial(
+ collection_list_impl(
cid,
- next,
- get_ideal_list_min(), get_ideal_list_max(), 0,
+ next, ghobject_t::get_max(),
+ get_ideal_list_max(), 0,
&objects,
&next);
if (objects.empty())
}
next = ghobject_t();
while (1) {
- collection_list_partial(
+ collection_list_impl(
dest,
- next,
- get_ideal_list_min(), get_ideal_list_max(), 0,
+ next, ghobject_t::get_max(),
+ get_ideal_list_max(), 0,
&objects,
&next);
if (objects.empty())
bool collection_exists(coll_t c);
bool collection_empty(coll_t c);
int collection_list(coll_t c, vector<ghobject_t>& oid);
- int collection_list_partial(coll_t c, ghobject_t start,
- int min, int max, snapid_t snap,
- vector<ghobject_t> *ls, ghobject_t *next);
// omap (see ObjectStore.h for documentation)
int omap_get(coll_t c, const ghobject_t &oid, bufferlist *header,
vector<ghobject_t> objects;
ghobject_t max;
while (!max.is_max()) {
- r = collection_list_partial(cid, max, 200, 300, 0, &objects, &max);
+ r = collection_list_impl(cid, max, ghobject_t::get_max(), 300, 0, &objects, &max);
if (r < 0)
goto out;
return r;
}
-int KeyValueStore::collection_list_partial(coll_t c, ghobject_t start,
- int min, int max, snapid_t seq,
- vector<ghobject_t> *ls,
- ghobject_t *next)
-{
- dout(10) << __func__ << " " << c << " start:" << start << " is_max:"
- << start.is_max() << dendl;
-
- int r = collection_list_impl(c, start, ghobject_t::get_max(), max, seq, ls, next);
- return r;
-}
-
int KeyValueStore::collection_list(coll_t c, vector<ghobject_t>& ls)
{
- return collection_list_partial(c, ghobject_t(), 0, 0, 0, &ls, 0);
+ return collection_list_impl(c, ghobject_t(), ghobject_t::get_max(), 0, 0, &ls, 0);
}
int KeyValueStore::collection_version_current(coll_t c, uint32_t *version)
ghobject_t next, current;
int move_size = 0;
while (1) {
- collection_list_partial(cid, current, get_ideal_list_min(),
+ collection_list_impl(cid, current, ghobject_t::get_max(),
get_ideal_list_max(), 0, &objects, &next);
dout(20) << __func__ << cid << "objects size: " << objects.size()
vector<ghobject_t> objects;
ghobject_t next;
while (1) {
- collection_list_partial(cid, next, get_ideal_list_min(),
+ collection_list_impl(cid, next, ghobject_t::get_max(),
get_ideal_list_max(), 0, &objects, &next);
if (objects.empty())
break;
next = ghobject_t();
while (1) {
- collection_list_partial(dest, next, get_ideal_list_min(),
+ collection_list_impl(dest, next, ghobject_t::get_max(),
get_ideal_list_max(), 0, &objects, &next);
if (objects.empty())
break;
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_partial(coll_t c, ghobject_t start,
- int min, 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 0;
}
-int MemStore::collection_list_partial(coll_t cid, ghobject_t start,
- int min, int max, snapid_t snap,
- vector<ghobject_t> *ls, ghobject_t *next)
-{
- dout(10) << __func__ << " " << cid << " " << start << " " << min << "-"
- << max << " " << snap << dendl;
-
- collection_list_impl(cid, start, ghobject_t::get_max(), max, snap, ls, next);
- return 0;
-}
-
int MemStore::omap_get(
coll_t cid, ///< [in] Collection containing oid
const ghobject_t &oid, ///< [in] Object containing omap
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_partial(coll_t cid, ghobject_t start,
- int min, int max, snapid_t snap,
- vector<ghobject_t> *ls, ghobject_t *next);
int omap_get(
coll_t cid, ///< [in] Collection containing oid
*/
virtual int collection_list(coll_t c, vector<ghobject_t>& o) = 0;
- /**
- * list partial contents of collection relative to a hash offset/position
- *
- * @param c collection
- * @param start list objects that sort >= this value
- * @param min return at least this many results, unless we reach the end
- * @param max return no more than this many results
- * @param snap return no objects with snap < snapid
- * @param ls [out] result
- * @param next [out] next item sorts >= this value
- * @return zero on success, or negative error
- */
- virtual int collection_list_partial(coll_t c, ghobject_t start,
- int min, int max, snapid_t snap,
- vector<ghobject_t> *ls, ghobject_t *next) = 0;
-
/**
* list contents of a collection that fall in the range [start, end) and no more than a specified many result
*
ObjectStore::Transaction *t = new ObjectStore::Transaction;
ghobject_t next;
handle.reset_tp_timeout();
- store->collection_list_partial(
+ store->collection_list_impl(
coll,
next,
- store->get_ideal_list_min(),
+ ghobject_t::get_max(),
store->get_ideal_list_max(),
0,
&olist,
int r = 0;
while (!_next.is_max() && ls->size() < (unsigned)min) {
vector<ghobject_t> objects;
- int r = store->collection_list_partial(
+ int r = store->collection_list_impl(
coll,
_next,
- min - ls->size(),
+ ghobject_t::get_max(),
max - ls->size(),
seq,
&objects,
vector<ghobject_t> objects;
ghobject_t next, current;
while (!next.is_max()) {
- int r = store->collection_list_partial(cid, current, 25, 50,
+ int r = store->collection_list_impl(cid, current, ghobject_t::get_max(), 50,
0, &objects, &next);
ASSERT_EQ(r, 0);
cout << " got " << objects.size() << " next " << next << std::endl;
vector<ghobject_t> objects;
ghobject_t next, current;
while (!next.is_max()) {
- int r = store->collection_list_partial(cid, current, 25, 50,
+ int r = store->collection_list_impl(cid, current, ghobject_t::get_max(), 50,
0, &objects, &next);
ASSERT_EQ(r, 0);
cout << " got " << objects.size() << " next " << next << std::endl;
ghobject_t start, next;
objects.clear();
- r = store->collection_list_partial(
+ r = store->collection_list_impl(
cid,
ghobject_t::get_max(),
- 50,
+ ghobject_t::get_max(),
60,
0,
&objects,
objects.clear();
listed.clear();
while (1) {
- r = store->collection_list_partial(cid, start,
- 50,
+ r = store->collection_list_impl(cid, start,
+ ghobject_t::get_max(),
60,
0,
&objects,
ghobject_t next, current;
while (1) {
cerr << "scanning..." << std::endl;
- int r = store->collection_list_partial(cid, current, 50, 100,
+ int r = store->collection_list_impl(cid, current, ghobject_t::get_max(), 100,
0, &objects, &next);
ASSERT_EQ(r, 0);
ASSERT_TRUE(sorted(objects));
listed.clear();
ghobject_t current, next;
while (1) {
- r = store->collection_list_partial(cid, current, 50, 60,
+ r = store->collection_list_impl(cid, current, ghobject_t::get_max(), 60,
0, &objects, &next);
ASSERT_EQ(r, 0);
ASSERT_TRUE(sorted(objects));
listed.clear();
ghobject_t current, next;
while (1) {
- r = store->collection_list_partial(cid, current, 50, 60,
+ r = store->collection_list_impl(cid, current, ghobject_t::get_max(), 60,
0, &objects, &next);
ASSERT_EQ(r, 0);
ASSERT_TRUE(sorted(objects));
ghobject_t next;
while (!next.is_max()) {
vector<ghobject_t> list;
- int r = store->collection_list_partial(
+ int r = store->collection_list_impl(
coll,
next,
- LIST_AT_A_TIME,
+ ghobject_t::get_max(),
LIST_AT_A_TIME,
0,
&list,
cout << "remove_coll " << coll << std::endl;
while (!next.is_max()) {
vector<ghobject_t> objects;
- r = store->collection_list_partial(coll, next, 200, 300, 0,
+ r = store->collection_list_impl(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_partial(coll, next, 200, 300, 0,
+ int r = store->collection_list_impl(coll, next, ghobject_t::get_max(), 300, 0,
&objects, &next);
if (r < 0)
return r;