]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
s/collection_list_impl/collection_list/
authorSage Weil <sage@redhat.com>
Wed, 29 Apr 2015 23:33:42 +0000 (16:33 -0700)
committerSage Weil <sage@redhat.com>
Fri, 7 Aug 2015 12:45:34 +0000 (08:45 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
13 files changed:
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/FileStoreDiff.cc
src/test/objectstore/store_test.cc
src/test/objectstore/workload_generator.cc
src/tools/ceph_objectstore_tool.cc

index 0e0abe0e724a24b626f9109cc76f56fcb4ab2d64..6a85cd90cc35ce7891d10471c817c90f9199af67 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_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();
@@ -4640,8 +4640,8 @@ bool FileStore::collection_empty(coll_t c)
   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;
@@ -4680,7 +4680,7 @@ int FileStore::collection_list_impl(coll_t c, ghobject_t start, ghobject_t end,
     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())
@@ -5299,7 +5299,7 @@ int FileStore::_split_collection(coll_t cid,
     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,
@@ -5318,7 +5318,7 @@ int FileStore::_split_collection(coll_t cid,
     }
     next = ghobject_t();
     while (1) {
-      collection_list_impl(
+      collection_list(
        dest,
        next, ghobject_t::get_max(),
        get_ideal_list_max(), 0,
index 5f5e8ab69b8382ea92cf0083265d9fe64be73752..7f0bbdb09ce26e932d99366fb12b23ccc56ee92e 100644 (file)
@@ -617,7 +617,7 @@ public:
                                   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);
index b69833aaf8e0cc496dcf82cb85feae33eeb1961b..e943c192a028e781df0fb2b835f35587cb684ba7 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_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;
 
@@ -2495,9 +2495,9 @@ bool KeyValueStore::collection_empty(coll_t c)
   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;
@@ -2789,8 +2789,8 @@ 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_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;
@@ -2820,8 +2820,8 @@ int KeyValueStore::_split_collection(coll_t cid, uint32_t bits, uint32_t rem,
     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;
 
@@ -2836,8 +2836,8 @@ int KeyValueStore::_split_collection(coll_t cid, uint32_t bits, uint32_t rem,
 
     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;
 
index 51078b63e0ba0b0049cbd6b3b5fe1a010a33ba6d..de72c55083a82fa8d7fdfe4090276ace5b89c997 100644 (file)
@@ -618,9 +618,9 @@ class KeyValueStore : public ObjectStore,
   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)
index 8b4b01d117db3b402bff3aac71ab37d2d4708771..8bfd0e80219f9b89719d0df2dbc2b26335e40c71 100644 (file)
@@ -421,9 +421,9 @@ bool MemStore::collection_empty(coll_t cid)
   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)
index 63e30b2f90c5c57c23daeab840c97c820d03e155..27839696683115a2aeecdd12b5a14d89239e8a5b 100644 (file)
@@ -306,9 +306,9 @@ public:
   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
index 441ba537feae18e014a2f17986ef2e3b870775e6..6da0e3a4ea7d68861b2a8121e62d18f145c6d46f 100644 (file)
@@ -2040,8 +2040,8 @@ public:
    * @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
index 3334593a552c4cbc922201ec6db1dc2a05cea465..787eb4d082133413e05fdebc113c807e3c0d6a5f 100644 (file)
@@ -2506,9 +2506,9 @@ void OSD::clear_temp_objects()
     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;
@@ -2546,7 +2546,7 @@ void OSD::recursive_remove_collection(ObjectStore *store, spg_t pgid, coll_t tmp
   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;
@@ -4226,7 +4226,7 @@ bool remove_dir(
   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(),
index 4807a732debadccdede288c06726cce6d6e9023f..2937a988acfee85dfa2564d6a0df7e5dac4bceb3 100644 (file)
@@ -113,7 +113,7 @@ 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_impl(
+    int r = store->collection_list(
       coll,
       _next,
       ghobject_t::get_max(),
@@ -148,7 +148,7 @@ int PGBackend::objects_list_range(
 {
   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),
index a40437a522e82248dd2552335cbc4db361a49264..af56806b7e9d4cef0c8d605e843586bd388e3282 100644 (file)
@@ -132,13 +132,13 @@ bool FileStoreDiff::diff_objects(FileStore *a_store, FileStore *b_store, coll_t
 
   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;
index fdf64b8164eda1cd6af3a65b8d7f345fc30ba135..8d3696da346a0cc237d727f70a96165a0cb24f26 100644 (file)
@@ -282,8 +282,8 @@ TEST_P(StoreTest, SimpleListTest) {
     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();
@@ -366,8 +366,8 @@ TEST_P(StoreTest, MultipoolListTest) {
     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();
@@ -585,7 +585,7 @@ TEST_P(StoreTest, ManyObjectTest) {
 
   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;
@@ -599,7 +599,7 @@ TEST_P(StoreTest, ManyObjectTest) {
 
   ghobject_t start, next;
   objects.clear();
-  r = store->collection_list_impl(
+  r = store->collection_list(
     cid,
     ghobject_t::get_max(),
     ghobject_t::get_max(),
@@ -614,12 +614,12 @@ TEST_P(StoreTest, ManyObjectTest) {
   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());
@@ -1101,8 +1101,8 @@ public:
     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());
@@ -1117,7 +1117,7 @@ public:
       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());
@@ -1313,7 +1313,7 @@ TEST_P(StoreTest, HashCollisionTest) {
   }
   }
   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;
@@ -1322,7 +1322,7 @@ TEST_P(StoreTest, HashCollisionTest) {
   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));
@@ -1408,7 +1408,7 @@ TEST_P(StoreTest, ScrubTest) {
   }
 
   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;
@@ -1417,8 +1417,8 @@ TEST_P(StoreTest, ScrubTest) {
   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();
@@ -1706,7 +1706,7 @@ void colsplittest(
 
   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();
@@ -1717,7 +1717,7 @@ void colsplittest(
   }
 
   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();
@@ -1925,7 +1925,7 @@ TEST_P(StoreTest, BigRGWObjectName) {
 
   {
     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);
index 04bb906ce416d68805723fd93180cbdc213104b8..ae0a83423d9134dc45081f31a8e4dd8e7ecb329d 100644 (file)
@@ -353,7 +353,7 @@ void WorkloadGenerator::do_destroy_collection(ObjectStore::Transaction *t,
   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;
 
index 734c04d86abeafcf0ec6f7f3c17e712b9ab9cf17..f76e795846e3150db6ea9043d578750a696b9a4b 100644 (file)
@@ -79,14 +79,14 @@ 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_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;
@@ -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_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;
@@ -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_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;