]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Kill collection_list_partial
authorXiaoxi Chen <xiaoxi.chen@intel.com>
Sat, 25 Apr 2015 01:48:38 +0000 (09:48 +0800)
committerSage Weil <sage@redhat.com>
Fri, 7 Aug 2015 12:45:14 +0000 (08:45 -0400)
Use collection_list_impl directly.

Signed-off-by: Xiaoxi Chen <xiaoxi.chen@intel.com>
src/os/FileStore.cc
src/os/FileStore.h
src/os/KeyValueStore.cc
src/os/KeyValueStore.h
src/os/MemStore.cc
src/os/MemStore.h
src/os/ObjectStore.h
src/osd/OSD.cc
src/osd/PGBackend.cc
src/test/objectstore/store_test.cc
src/tools/ceph_objectstore_tool.cc

index 55e11826eb71095530f3c60efccd0cbf9291d92d..1f3ecabfa296908d785f98807c5e268ee9b6dff1 100644 (file)
@@ -4484,7 +4484,7 @@ int FileStore::_collection_remove_recursive(const coll_t &cid,
   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();
@@ -4716,19 +4716,6 @@ int FileStore::collection_list_impl(coll_t c, ghobject_t start, ghobject_t end,
   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());
@@ -5334,10 +5321,10 @@ int FileStore::_split_collection(coll_t cid,
     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())
@@ -5353,10 +5340,10 @@ int FileStore::_split_collection(coll_t cid,
     }
     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())
index 7add5741594d4ef1ca9a2ed0cf97512508042e2d..bb08ecaef720e58af7deadf718f35e57d4a732f1 100644 (file)
@@ -626,9 +626,6 @@ public:
   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,
index 9246b9e3bbc14d7ea92a2e4ac6ab2c11e16bf934..8868920f2c420b44a0b4934d74df6b08a65635ce 100644 (file)
@@ -2444,7 +2444,7 @@ int KeyValueStore::_collection_remove_recursive(const coll_t &cid,
   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;
 
@@ -2510,21 +2510,9 @@ int KeyValueStore::collection_list_impl(coll_t c, ghobject_t start,
   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)
@@ -2806,7 +2794,7 @@ int KeyValueStore::_split_collection(coll_t cid, uint32_t bits, uint32_t rem,
     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()
@@ -2837,7 +2825,7 @@ int KeyValueStore::_split_collection(coll_t cid, uint32_t bits, uint32_t rem,
     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;
@@ -2853,7 +2841,7 @@ int KeyValueStore::_split_collection(coll_t cid, uint32_t bits, uint32_t rem,
 
     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;
index 46fba5225ba51c1c51d3fddd7c4bb506f04a7c3f..3cb6bc014b8709dd94746229c06c99bacef53580 100644 (file)
@@ -622,9 +622,6 @@ class KeyValueStore : public ObjectStore,
   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)
index 4394ec1d84eb1f85949f7985fa537633a530638e..bfebdbd0e060bdda9c0ac571b973e3faac8589f5 100644 (file)
@@ -461,17 +461,6 @@ int MemStore::collection_list_impl(coll_t cid, ghobject_t start, ghobject_t end,
   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
index 470016cad0608d3ffaac6e4d52285c9e503ebc0f..97f41429da2acd7cf7dfa5063e412558e75d83e8 100644 (file)
@@ -310,9 +310,6 @@ public:
   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
index dc83be13ac21c49a37e793089f39427788ac8804..e0a517787f1980bf4c54871345acaacc199aebfe 100644 (file)
@@ -2037,22 +2037,6 @@ public:
    */
   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
    *
index ebc2d6d8ee252f3a2de73e699c778db5f7b4a399..b5b6d630ed44af642f83ff074253819cc6aac28a 100644 (file)
@@ -4227,10 +4227,10 @@ bool remove_dir(
   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,
index feab829cbc50bd231f622be6a045f1365e057442..4807a732debadccdede288c06726cce6d6e9023f 100644 (file)
@@ -113,10 +113,10 @@ int PGBackend::objects_list_partial(
   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,
index 6d1654cd9c919b4953d72b90b0f797e5a1a5dfc7..e13518855075c340e8df3588c95c56666b1d02bf 100644 (file)
@@ -282,7 +282,7 @@ TEST_P(StoreTest, SimpleListTest) {
     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;
@@ -366,7 +366,7 @@ TEST_P(StoreTest, MultipoolListTest) {
     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;
@@ -599,10 +599,10 @@ TEST_P(StoreTest, ManyObjectTest) {
 
   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,
@@ -614,8 +614,8 @@ TEST_P(StoreTest, ManyObjectTest) {
   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,
@@ -1101,7 +1101,7 @@ public:
     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));
@@ -1322,7 +1322,7 @@ TEST_P(StoreTest, HashCollisionTest) {
   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));
@@ -1417,7 +1417,7 @@ TEST_P(StoreTest, ScrubTest) {
   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));
index 63ecffee54a963bd0e25fcdc0b4b01de0f0d6fc0..734c04d86abeafcf0ec6f7f3c17e712b9ab9cf17 100644 (file)
@@ -79,10 +79,10 @@ int _action_on_all_objects_in_pg(ObjectStore *store, coll_t coll, action_on_obje
   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,
@@ -412,7 +412,7 @@ void remove_coll(ObjectStore *store, const coll_t &coll)
   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;
@@ -700,7 +700,7 @@ int ObjectStoreTool::export_files(ObjectStore *store, coll_t coll)
 
   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;