]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os: remove nibblewise sort order support
authorSage Weil <sage@redhat.com>
Wed, 8 Feb 2017 20:10:18 +0000 (15:10 -0500)
committerSage Weil <sage@redhat.com>
Sat, 11 Feb 2017 15:45:16 +0000 (10:45 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
22 files changed:
src/os/FuseStore.cc
src/os/ObjectStore.h
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h
src/os/filestore/CollectionIndex.h
src/os/filestore/FileStore.cc
src/os/filestore/FileStore.h
src/os/filestore/HashIndex.cc
src/os/filestore/HashIndex.h
src/os/filestore/LFNIndex.cc
src/os/filestore/LFNIndex.h
src/os/kstore/KStore.cc
src/os/kstore/KStore.h
src/os/memstore/MemStore.cc
src/os/memstore/MemStore.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/test/os/TestLFNIndex.cc
src/tools/ceph_objectstore_tool.cc

index 06b869cb1589910232fb8b0482c168e7327f954a..fc47eb98a64941dc60f35168a44f162db2a17801 100644 (file)
@@ -475,7 +475,7 @@ static int os_readdir(const char *path,
       while (true) {
        vector<ghobject_t> ls;
        int r = fs->store->collection_list(
-         cid, next, last, true, 1000, &ls, &next);
+         cid, next, last, 1000, &ls, &next);
        if (r < 0)
          return r;
        for (auto p : ls) {
index 08f6075ebd4eee0f094df54b68dd4e2594bc1873..c1ebc40e7c9494e7be83e81dc7fddcb383405316 100644 (file)
@@ -1833,7 +1833,6 @@ public:
    * @param c collection
    * @param start list object that sort >= this value
    * @param end list objects that sort < this value
-   * @param sort_bitwise sort bitwise (instead of legacy nibblewise)
    * @param max return no more than this many results
    * @param seq return no objects with snap < seq
    * @param ls [out] result
@@ -1842,13 +1841,13 @@ public:
    */
   virtual int collection_list(const coll_t& c,
                              const ghobject_t& start, const ghobject_t& end,
-                             bool sort_bitwise, int max,
+                             int max,
                              vector<ghobject_t> *ls, ghobject_t *next) = 0;
   virtual int collection_list(CollectionHandle &c,
                              const ghobject_t& start, const ghobject_t& end,
-                             bool sort_bitwise, int max,
+                             int max,
                              vector<ghobject_t> *ls, ghobject_t *next) {
-    return collection_list(c->get_cid(), start, end, sort_bitwise, max, ls, next);
+    return collection_list(c->get_cid(), start, end, max, ls, next);
   }
 
 
index ffcddf747c2aa7073250cd51e8b2a9f91d1848e3..9f3a10a41b93f4015d37c3e8a8778f447f9127ee 100644 (file)
@@ -6029,7 +6029,7 @@ int BlueStore::collection_empty(const coll_t& cid, bool *empty)
   dout(15) << __func__ << " " << cid << dendl;
   vector<ghobject_t> ls;
   ghobject_t next;
-  int r = collection_list(cid, ghobject_t(), ghobject_t::get_max(), true, 1,
+  int r = collection_list(cid, ghobject_t(), ghobject_t::get_max(), 1,
                          &ls, &next);
   if (r < 0) {
     derr << __func__ << " collection_list returned: " << cpp_strerror(r)
@@ -6053,19 +6053,17 @@ int BlueStore::collection_bits(const coll_t& cid)
 }
 
 int BlueStore::collection_list(
-  const coll_t& cid, const ghobject_t& start, const ghobject_t& end,
-  bool sort_bitwise, int max,
+  const coll_t& cid, const ghobject_t& start, const ghobject_t& end, int max,
   vector<ghobject_t> *ls, ghobject_t *pnext)
 {
   CollectionHandle c = _get_collection(cid);
   if (!c)
     return -ENOENT;
-  return collection_list(c, start, end, sort_bitwise, max, ls, pnext);
+  return collection_list(c, start, end, max, ls, pnext);
 }
 
 int BlueStore::collection_list(
-  CollectionHandle &c_, const ghobject_t& start, const ghobject_t& end,
-  bool sort_bitwise, int max,
+  CollectionHandle &c_, const ghobject_t& start, const ghobject_t& end, int max,
   vector<ghobject_t> *ls, ghobject_t *pnext)
 {
   Collection *c = static_cast<Collection *>(c_.get());
@@ -6074,7 +6072,7 @@ int BlueStore::collection_list(
   int r;
   {
     RWLock::RLocker l(c->lock);
-    r = _collection_list(c, start, end, sort_bitwise, max, ls, pnext);
+    r = _collection_list(c, start, end, max, ls, pnext);
   }
 
   c->trim_cache();
@@ -6086,15 +6084,12 @@ int BlueStore::collection_list(
 }
 
 int BlueStore::_collection_list(
-  Collection *c, const ghobject_t& start, const ghobject_t& end,
-  bool sort_bitwise, int max,
+  Collection *c, const ghobject_t& start, const ghobject_t& end, int max,
   vector<ghobject_t> *ls, ghobject_t *pnext)
 {
 
   if (!c->exists)
     return -ENOENT;
-  if (!sort_bitwise)
-    return -EOPNOTSUPP;
 
   int r = 0;
   ghobject_t static_next;
@@ -9638,7 +9633,7 @@ int BlueStore::_remove_collection(TransContext *txc, const coll_t &cid,
     // Enumerate onodes in db, up to nonexistent_count + 1
     // then check if all of them are marked as non-existent.
     // Bypass the check if returned number is greater than nonexistent_count
-    r = _collection_list(c->get(), ghobject_t(), ghobject_t::get_max(), true,
+    r = _collection_list(c->get(), ghobject_t(), ghobject_t::get_max(),
                          nonexistent_count + 1, &ls, &next);
     if (r >= 0) {
       bool exists = false; //ls.size() > nonexistent_count;
index 9a34583b8eabfb14f23bc382d432674d8ff20fc8..2b401ef84fee983e9677a3ac9dca6259cd9e7ae3 100644 (file)
@@ -1810,7 +1810,7 @@ private:
 
   int _collection_list(
     Collection *c, const ghobject_t& start, const ghobject_t& end,
-    bool sort_bitwise, int max, vector<ghobject_t> *ls, ghobject_t *next);
+    int max, vector<ghobject_t> *ls, ghobject_t *next);
 
   template <typename T, typename F>
   T select_option(const std::string& opt_name, T val1, F f) {
@@ -1949,12 +1949,12 @@ public:
   int collection_list(const coll_t& cid,
                      const ghobject_t& start,
                      const ghobject_t& end,
-                     bool sort_bitwise, int max,
+                     int max,
                      vector<ghobject_t> *ls, ghobject_t *next) override;
   int collection_list(CollectionHandle &c,
                      const ghobject_t& start,
                      const ghobject_t& end,
-                     bool sort_bitwise, int max,
+                     int max,
                      vector<ghobject_t> *ls, ghobject_t *next) override;
 
   int omap_get(
index 51431ac12efe77b4199cb72a7f092239e7545d2c..7f7d7ffa23a7ba3142de1fd9a329f26539b2bb2b 100644 (file)
@@ -168,7 +168,6 @@ protected:
   virtual int collection_list_partial(
     const ghobject_t &start, ///< [in] object at which to start
     const ghobject_t &end,    ///< [in] list only objects < end
-    bool sort_bitwise,      ///< [in] use bitwise sort
     int max_count,          ///< [in] return at most max_count objects
     vector<ghobject_t> *ls,  ///< [out] Listed objects
     ghobject_t *next         ///< [out] Next object to list
index 21cc1823d9910796081eeb8644c65d3ce2a89114..6c1c4c67419e1975260c6811dbfedd6e07464717 100644 (file)
@@ -4617,7 +4617,7 @@ int FileStore::_collection_remove_recursive(const coll_t &cid,
   vector<ghobject_t> objects;
   ghobject_t max;
   while (!max.is_max()) {
-    r = collection_list(cid, max, ghobject_t::get_max(), true,
+    r = collection_list(cid, max, ghobject_t::get_max(),
                        300, &objects, &max);
     if (r < 0)
       return r;
@@ -4748,7 +4748,7 @@ int FileStore::collection_empty(const coll_t& c, bool *empty)
   RWLock::RLocker l((index.index)->access_lock);
 
   vector<ghobject_t> ls;
-  r = index->collection_list_partial(ghobject_t(), ghobject_t::get_max(), true,
+  r = index->collection_list_partial(ghobject_t(), ghobject_t::get_max(),
                                     1, &ls, NULL);
   if (r < 0) {
     derr << __func__ << " collection_list_partial returned: "
@@ -4763,7 +4763,7 @@ int FileStore::collection_empty(const coll_t& c, bool *empty)
 int FileStore::collection_list(const coll_t& c,
                               const ghobject_t& orig_start,
                               const ghobject_t& end,
-                              bool sort_bitwise, int max,
+                              int max,
                               vector<ghobject_t> *ls, ghobject_t *next)
 {
   ghobject_t start = orig_start;
@@ -4804,7 +4804,7 @@ int FileStore::collection_list(const coll_t& c,
     if (cmp_bitwise(start, sep) < 0) { // bitwise vs nibble doesn't matter here
       dout(10) << __func__ << " first checking temp pool" << dendl;
       coll_t temp = c.get_temp();
-      int r = collection_list(temp, start, end, sort_bitwise, max, ls, next);
+      int r = collection_list(temp, start, end, max, ls, next);
       if (r < 0)
        return r;
       if (*next != ghobject_t::get_max())
@@ -4825,7 +4825,7 @@ int FileStore::collection_list(const coll_t& c,
   assert(NULL != index.index);
   RWLock::RLocker l((index.index)->access_lock);
 
-  r = index->collection_list_partial(start, end, sort_bitwise, max, ls, next);
+  r = index->collection_list_partial(start, end, max, ls, next);
 
   if (r < 0) {
     assert(!m_filestore_fail_eio || r != -EIO);
@@ -5459,7 +5459,6 @@ int FileStore::_split_collection(const coll_t& cid,
       collection_list(
        cid,
        next, ghobject_t::get_max(),
-       true,
        get_ideal_list_max(),
        &objects,
        &next);
@@ -5479,7 +5478,6 @@ int FileStore::_split_collection(const coll_t& cid,
       collection_list(
        dest,
        next, ghobject_t::get_max(),
-       true,
        get_ideal_list_max(),
        &objects,
        &next);
index ac57de7998a51d7104eeb33907a47b8e927aa090..4a0656fc1f7d114f48941824e23d9aa04e4eae74 100644 (file)
@@ -656,8 +656,7 @@ public:
   // collections
   using ObjectStore::collection_list;
   int collection_list(const coll_t& c,
-                     const ghobject_t& start, const ghobject_t& end,
-                     bool sort_bitwise, int max,
+                     const ghobject_t& start, const ghobject_t& end, int max,
                      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 39efacd1d2b79bbac3c0dd231a903040074200e3..6bbb6330333e5def90081af73ca39478fb777732 100644 (file)
@@ -440,7 +440,6 @@ int HashIndex::_lookup(const ghobject_t &oid,
 
 int HashIndex::_collection_list_partial(const ghobject_t &start,
                                        const ghobject_t &end,
-                                       bool sort_bitwise,
                                        int max_count,
                                        vector<ghobject_t> *ls,
                                        ghobject_t *next) {
@@ -450,7 +449,7 @@ int HashIndex::_collection_list_partial(const ghobject_t &start,
     next = &_next;
   *next = start;
   dout(20) << __func__ << " start:" << start << " end:" << end << "-" << max_count << " ls.size " << ls->size() << dendl;
-  return list_by_hash(path, end, sort_bitwise, max_count, next, ls);
+  return list_by_hash(path, end, max_count, next, ls);
 }
 
 int HashIndex::prep_delete() {
@@ -947,73 +946,14 @@ int HashIndex::get_path_contents_by_hash_bitwise(
   return 0;
 }
 
-int HashIndex::get_path_contents_by_hash_nibblewise(
-  const vector<string> &path,
-  const ghobject_t *next_object,
-  set<string> *hash_prefixes,
-  set<pair<string, ghobject_t>, CmpPairNibblewise > *objects)
-{
-  map<string, ghobject_t> rev_objects;
-  int r;
-  r = list_objects(path, 0, 0, &rev_objects);
-  if (r < 0)
-    return r;
-
-  for (map<string, ghobject_t>::iterator i = rev_objects.begin();
-       i != rev_objects.end();
-       ++i) {
-    string hash_prefix = get_path_str(i->second);
-    if (next_object && cmp_nibblewise(i->second, *next_object) < 0)
-      continue;
-    hash_prefixes->insert(hash_prefix);
-    objects->insert(pair<string, ghobject_t>(hash_prefix, i->second));
-  }
-
-  vector<string> subdirs;
-  r = list_subdirs(path, &subdirs);
-  if (r < 0)
-    return r;
-
-  // sort nibblewise (string sort of (reversed) hex digits)
-  std::sort(subdirs.begin(), subdirs.end());
-
-  string cur_prefix;
-  for (vector<string>::const_iterator i = path.begin();
-       i != path.end();
-       ++i) {
-    cur_prefix.append(*i);
-  }
-  string next_object_string;
-  if (next_object)
-    next_object_string = get_path_str(*next_object);
-
-  for (vector<string>::iterator i = subdirs.begin();
-       i != subdirs.end();
-       ++i) {
-    string candidate = cur_prefix + *i;
-    if (next_object) {
-      if (next_object->is_max())
-       continue;
-      if (candidate < next_object_string.substr(0, candidate.size()))
-       continue;
-    }
-    hash_prefixes->insert(cur_prefix + *i);
-  }
-  return 0;
-}
-
 int HashIndex::list_by_hash(const vector<string> &path,
                            const ghobject_t &end,
-                           bool sort_bitwise,
                            int max_count,
                            ghobject_t *next,
                            vector<ghobject_t> *out)
 {
   assert(out);
-  if (sort_bitwise)
-    return list_by_hash_bitwise(path, end, max_count, next, out);
-  else
-    return list_by_hash_nibblewise(path, end, max_count, next, out);
+  return list_by_hash_bitwise(path, end, max_count, next, out);
 }
 
 int HashIndex::list_by_hash_bitwise(
@@ -1082,67 +1022,4 @@ int HashIndex::list_by_hash_bitwise(
   return 0;
 }
 
-int HashIndex::list_by_hash_nibblewise(
-  const vector<string> &path,
-  const ghobject_t& end,
-  int max_count,
-  ghobject_t *next,
-  vector<ghobject_t> *out)
-{
-  vector<string> next_path = path;
-  next_path.push_back("");
-  set<string> hash_prefixes;
-  set<pair<string, ghobject_t>, CmpPairNibblewise> objects;
-  int r = get_path_contents_by_hash_nibblewise(path,
-                                              next,
-                                              &hash_prefixes,
-                                              &objects);
-  if (r < 0)
-    return r;
-  for (set<string>::iterator i = hash_prefixes.begin();
-       i != hash_prefixes.end();
-       ++i) {
-    dout(20) << __func__ << " prefix " << *i << dendl;
-    set<pair<string, ghobject_t>, CmpPairNibblewise >::iterator j =
-      objects.lower_bound(make_pair(*i, ghobject_t()));
-    if (j == objects.end() || j->first != *i) {
-      *(next_path.rbegin()) = *(i->rbegin());
-      ghobject_t next_recurse;
-      if (next)
-       next_recurse = *next;
-      r = list_by_hash_nibblewise(next_path,
-                                 end,
-                                 max_count,
-                                 &next_recurse,
-                                 out);
 
-      if (r < 0)
-       return r;
-      if (!next_recurse.is_max()) {
-       if (next)
-         *next = next_recurse;
-       return 0;
-      }
-    } else {
-      while (j != objects.end() && j->first == *i) {
-       if (max_count > 0 && out->size() == (unsigned)max_count) {
-         if (next)
-           *next = j->second;
-         return 0;
-       }
-       if (cmp_nibblewise(j->second, end) >= 0) {
-         if (next)
-           *next = j->second;
-         return 0;
-       }
-       if (!next || cmp_nibblewise(j->second, *next) >= 0) {
-         out->push_back(j->second);
-       }
-       ++j;
-      }
-    }
-  }
-  if (next)
-    *next = ghobject_t::get_max();
-  return 0;
-}
index e3fa3d9ab32e01e51a9acf0b89d979b3ead331ae..add3c3559fcfd64258942a73e5a89bc321255909 100644 (file)
@@ -196,7 +196,6 @@ protected:
   int _collection_list_partial(
     const ghobject_t &start,
     const ghobject_t &end,
-    bool sort_bitwise,
     int max_count,
     vector<ghobject_t> *ls,
     ghobject_t *next
@@ -401,18 +400,11 @@ private:
     set<string, CmpHexdigitStringBitwise> *hash_prefixes, /// [out] prefixes in dir
     set<pair<string, ghobject_t>, CmpPairBitwise> *objects /// [out] objects
     );
-  int get_path_contents_by_hash_nibblewise(
-    const vector<string> &path,             /// [in] Path to list
-    const ghobject_t *next_object,          /// [in] list > *next_object
-    set<string> *hash_prefixes,             /// [out] prefixes in dir
-    set<pair<string, ghobject_t>, CmpPairNibblewise> *objects /// [out] objects
-    );
 
   /// List objects in collection in ghobject_t order
   int list_by_hash(
     const vector<string> &path, /// [in] Path to list
     const ghobject_t &end,      /// [in] List only objects < end
-    bool sort_bitwise,          /// [in] sort bitwise
     int max_count,              /// [in] List at most max_count
     ghobject_t *next,            /// [in,out] List objects >= *next
     vector<ghobject_t> *out      /// [out] Listed objects
@@ -425,13 +417,6 @@ private:
     ghobject_t *next,            /// [in,out] List objects >= *next
     vector<ghobject_t> *out      /// [out] Listed objects
     ); ///< @return Error Code, 0 on success
-  int list_by_hash_nibblewise(
-    const vector<string> &path, /// [in] Path to list
-    const ghobject_t &end,      /// [in] List only objects < end
-    int max_count,              /// [in] List at most max_count
-    ghobject_t *next,            /// [in,out] List objects >= *next
-    vector<ghobject_t> *out      /// [out] Listed objects
-    ); ///< @return Error Code, 0 on success
 
   /// Create the given levels of sub directories from the given root.
   /// The contents of *path* is not changed after calling this function.
index c498aa2612ad209913affb7dbcc03281ae8c125a..5ccdad2be8f6442ad666dc16154ca8725257e0c6 100644 (file)
@@ -157,12 +157,11 @@ int LFNIndex::pre_hash_collection(uint32_t pg_num, uint64_t expected_num_objs)
 
 int LFNIndex::collection_list_partial(const ghobject_t &start,
                                      const ghobject_t &end,
-                                     bool sort_bitwise,
                                      int max_count,
                                      vector<ghobject_t> *ls,
                                      ghobject_t *next)
 {
-  return _collection_list_partial(start, end, sort_bitwise, max_count, ls, next);
+  return _collection_list_partial(start, end, max_count, ls, next);
 }
 
 /* Derived class utility methods */
index c23b915206b357ae5ce0d71fadbaa5540706bbcc..6cb3ed76e218bbf8df622e78d7a6e323035a8612 100644 (file)
@@ -189,7 +189,6 @@ public:
   int collection_list_partial(
     const ghobject_t &start,
     const ghobject_t &end,
-    bool sort_bitwise,
     int max_count,
     vector<ghobject_t> *ls,
     ghobject_t *next
@@ -255,7 +254,6 @@ protected:
   virtual int _collection_list_partial(
     const ghobject_t &start,
     const ghobject_t &end,
-    bool sort_bitwise,
     int max_count,
     vector<ghobject_t> *ls,
     ghobject_t *next
index 2319050423e19f3c4a5d3adfebd11e6849fc8a1f..faf8ce4a5cc05eb58bfc781244cb1bdabbcf73e6 100755 (executable)
@@ -1388,7 +1388,7 @@ int KStore::collection_empty(const coll_t& cid, bool *empty)
   dout(15) << __func__ << " " << cid << dendl;
   vector<ghobject_t> ls;
   ghobject_t next;
-  int r = collection_list(cid, ghobject_t(), ghobject_t::get_max(), true, 1,
+  int r = collection_list(cid, ghobject_t(), ghobject_t::get_max(), 1,
                          &ls, &next);
   if (r < 0) {
     derr << __func__ << " collection_list returned: " << cpp_strerror(r)
@@ -1401,19 +1401,17 @@ int KStore::collection_empty(const coll_t& cid, bool *empty)
 }
 
 int KStore::collection_list(
-  const coll_t& cid, const ghobject_t& start, const ghobject_t& end,
-  bool sort_bitwise, int max,
+  const coll_t& cid, const ghobject_t& start, const ghobject_t& end, int max,
   vector<ghobject_t> *ls, ghobject_t *pnext)
 {
   CollectionHandle c = _get_collection(cid);
   if (!c)
     return -ENOENT;
-  return collection_list(c, start, end, sort_bitwise, max, ls, pnext);
+  return collection_list(c, start, end, max, ls, pnext);
 }
 
 int KStore::collection_list(
-  CollectionHandle &c_, const ghobject_t& start, const ghobject_t& end,
-  bool sort_bitwise, int max,
+  CollectionHandle &c_, const ghobject_t& start, const ghobject_t& end, int max,
   vector<ghobject_t> *ls, ghobject_t *pnext)
 
 {
@@ -1423,7 +1421,7 @@ int KStore::collection_list(
   int r;
   {
     RWLock::RLocker l(c->lock);
-    r = _collection_list(c, start, end, sort_bitwise, max, ls, pnext);
+    r = _collection_list(c, start, end, max, ls, pnext);
   }
 
   dout(10) << __func__ << " " << c->cid
@@ -1434,13 +1432,9 @@ int KStore::collection_list(
 }
 
 int KStore::_collection_list(
-  Collection* c, const ghobject_t& start, const ghobject_t& end,
-  bool sort_bitwise, int max,
+  Collection* c, const ghobject_t& start, const ghobject_t& end, int max,
   vector<ghobject_t> *ls, ghobject_t *pnext)
 {
-  if (!sort_bitwise)
-    return -EOPNOTSUPP;
-
   int r = 0;
   KeyValueDB::Iterator it;
   string temp_start_key, temp_end_key;
@@ -3293,7 +3287,7 @@ int KStore::_remove_collection(TransContext *txc, coll_t cid,
     // Enumerate onodes in db, up to nonexistent_count + 1
     // then check if all of them are marked as non-existent.
     // Bypass the check if returned number is greater than nonexistent_count
-    r = _collection_list(c->get(), ghobject_t(), ghobject_t::get_max(), true,
+    r = _collection_list(c->get(), ghobject_t(), ghobject_t::get_max(),
                          nonexistent_count + 1, &ls, &next);
     if (r >= 0) {
       bool exists = false; //ls.size() > nonexistent_count;
index c4acd16590bdba9fb9a4146a9c5e39df8b36097f..520cd8329ccf3fc2b8661063b16b0967cf32f810 100644 (file)
@@ -399,7 +399,7 @@ private:
 
   int _collection_list(
     Collection *c, const ghobject_t& start, const ghobject_t& end,
-    bool sort_bitwise, int max, vector<ghobject_t> *ls, ghobject_t *next);
+    int max, vector<ghobject_t> *ls, ghobject_t *next);
 
 public:
   KStore(CephContext *cct, const string& path);
@@ -483,11 +483,11 @@ public:
 
   int collection_list(
     const coll_t& cid, const ghobject_t& start, const ghobject_t& end,
-    bool sort_bitwise, int max,
+    int max,
     vector<ghobject_t> *ls, ghobject_t *next) override;
   int collection_list(
     CollectionHandle &c, const ghobject_t& start, const ghobject_t& end,
-    bool sort_bitwise, int max,
+    int max,
     vector<ghobject_t> *ls, ghobject_t *next) override;
 
   using ObjectStore::omap_get;
index 4ff957527c59e57a2e0135c5264707c7414c0953..73ed1f720edd62436cb48668a907582c8b613663 100644 (file)
@@ -463,11 +463,9 @@ int MemStore::collection_empty(const coll_t& cid, bool *empty)
 int MemStore::collection_list(const coll_t& cid,
                              const ghobject_t& start,
                              const ghobject_t& end,
-                             bool sort_bitwise, int max,
+                             int max,
                              vector<ghobject_t> *ls, ghobject_t *next)
 {
-  if (!sort_bitwise)
-    return -EOPNOTSUPP;
   CollectionRef c = get_collection(cid);
   if (!c)
     return -ENOENT;
index 4d8d4aadf7654a4358d1cb9024116e791a4400b0..b28b3ba78eae9aaccda484487b062665c95d0303 100644 (file)
@@ -327,8 +327,7 @@ public:
   int collection_empty(const coll_t& c, bool *empty) override;
   using ObjectStore::collection_list;
   int collection_list(const coll_t& cid,
-                     const ghobject_t& start, const ghobject_t& end,
-                     bool sort_bitwise, int max,
+                     const ghobject_t& start, const ghobject_t& end, int max,
                      vector<ghobject_t> *ls, ghobject_t *next) override;
 
   using ObjectStore::omap_get;
index 7fb5767627561f77873ea8cfb4f2c41a98df2f02..26df67911b8ffbd54d4a74f7cf6157b06a7969a0 100644 (file)
@@ -3039,7 +3039,7 @@ void OSD::clear_temp_objects()
     ghobject_t next;
     while (1) {
       vector<ghobject_t> objects;
-      store->collection_list(*p, next, ghobject_t::get_max(), true,
+      store->collection_list(*p, next, ghobject_t::get_max(),
                             store->get_ideal_list_max(),
                             &objects, &next);
       if (objects.empty())
@@ -3092,7 +3092,7 @@ void OSD::recursive_remove_collection(CephContext* cct,
   SnapMapper mapper(cct, &driver, 0, 0, 0, pgid.shard);
 
   vector<ghobject_t> objects;
-  store->collection_list(tmp, ghobject_t(), ghobject_t::get_max(), true,
+  store->collection_list(tmp, ghobject_t(), ghobject_t::get_max(),
                         INT_MAX, &objects, 0);
 
   // delete them.
@@ -4763,7 +4763,6 @@ bool remove_dir(
     coll,
     next,
     ghobject_t::get_max(),
-    true,
     store->get_ideal_list_max(),
     &olist,
     &next);
index 024657d8e4366d0e0fa3a20b1928400b4f82fe93..805fd520ca3b2a778f0d1c39e177fbbfc0f01e20 100644 (file)
@@ -212,7 +212,6 @@ int PGBackend::objects_list_partial(
       ch,
       _next,
       ghobject_t::get_max(),
-      parent->sort_bitwise(),
       max - ls->size(),
       &objects,
       &_next);
@@ -249,7 +248,6 @@ int PGBackend::objects_list_range(
     ch,
     ghobject_t(start, ghobject_t::NO_GEN, get_parent()->whoami_shard().shard),
     ghobject_t(end, ghobject_t::NO_GEN, get_parent()->whoami_shard().shard),
-    parent->sort_bitwise(),
     INT_MAX,
     &objects,
     NULL);
index 2596166546bd4847740cd7312147b4ffee9b5d6a..5134522017abad421efac494097c9abd50752ae9 100644 (file)
@@ -134,14 +134,14 @@ 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(coll, ghobject_t(), ghobject_t::get_max(),
-                                true, INT_MAX, &b_objects, NULL);
+                                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(),
-                                true, INT_MAX, &a_objects, NULL);
+                                INT_MAX, &a_objects, NULL);
   if (err < 0) {
     dout(0) << "diff_objects list on store coll " << coll.to_str()
               << " returns " << err << dendl;
index da74c1b701aa406e319c2afcf05d648ba7f5d1da..4035b6d411c2b8acfbe5aac312bfe9b456b35b84 100644 (file)
@@ -86,12 +86,12 @@ int apply_transaction(
 }
 
 
-bool sorted(const vector<ghobject_t> &in, bool bitwise) {
+bool sorted(const vector<ghobject_t> &in) {
   ghobject_t start;
   for (vector<ghobject_t>::const_iterator i = in.begin();
        i != in.end();
        ++i) {
-    if (cmp(start, *i, bitwise) > 0) {
+    if (cmp(start, *i, true) > 0) {
       cout << start << " should follow " << *i << std::endl;
       return false;
     }
@@ -2234,20 +2234,16 @@ TEST_P(StoreTest, SimpleListTest) {
     r = apply_transaction(store, &osr, std::move(t));
     ASSERT_EQ(r, 0);
   }
-  for (int bitwise=0; bitwise<2; ++bitwise) {
+  {
     set<ghobject_t, ghobject_t::BitwiseComparator> saw;
     vector<ghobject_t> objects;
     ghobject_t next, current;
     while (!next.is_max()) {
       int r = store->collection_list(cid, current, ghobject_t::get_max(),
-                                    (bool)bitwise, 50,
+                                    50,
                                     &objects, &next);
-      if (r == -EOPNOTSUPP) {
-       ++bitwise; // skip nibblewise test
-       continue;
-      }
       ASSERT_EQ(r, 0);
-      ASSERT_TRUE(sorted(objects, (bool)bitwise));
+      ASSERT_TRUE(sorted(objects));
       cout << " got " << objects.size() << " next " << next << std::endl;
       for (vector<ghobject_t>::iterator p = objects.begin(); p != objects.end();
           ++p) {
@@ -2308,8 +2304,7 @@ TEST_P(StoreTest, ListEndTest) {
     end.hobj.pool = 1;
     vector<ghobject_t> objects;
     ghobject_t next;
-    int r = store->collection_list(cid, ghobject_t(), end,
-                                  true, 500,
+    int r = store->collection_list(cid, ghobject_t(), end, 500,
                                   &objects, &next);
     ASSERT_EQ(r, 0);
     for (auto &p : objects) {
@@ -2389,8 +2384,7 @@ TEST_P(StoreTest, MultipoolListTest) {
     vector<ghobject_t> objects;
     ghobject_t next, current;
     while (!next.is_max()) {
-      int r = store->collection_list(cid, current, ghobject_t::get_max(),
-                                    true, 50,
+      int r = store->collection_list(cid, current, ghobject_t::get_max(), 50,
                                     &objects, &next);
       ASSERT_EQ(r, 0);
       cout << " got " << objects.size() << " next " << next << std::endl;
@@ -3049,7 +3043,7 @@ TEST_P(StoreTest, ManyObjectTest) {
 
   set<ghobject_t, ghobject_t::BitwiseComparator> listed, listed2;
   vector<ghobject_t> objects;
-  r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(), true, INT_MAX, &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;
@@ -3067,7 +3061,6 @@ TEST_P(StoreTest, ManyObjectTest) {
     cid,
     ghobject_t::get_max(),
     ghobject_t::get_max(),
-    true,
     50,
     &objects,
     &next
@@ -3079,28 +3072,11 @@ TEST_P(StoreTest, ManyObjectTest) {
   listed.clear();
   ghobject_t start2, next2;
   while (1) {
-    // nibblewise
-    r = store->collection_list(cid, start2, ghobject_t::get_max(), false,
-                              50,
-                              &objects,
-                              &next2);
-    if (r != -EOPNOTSUPP) {
-      ASSERT_TRUE(sorted(objects, false));
-      ASSERT_EQ(r, 0);
-      listed2.insert(objects.begin(), objects.end());
-      if (objects.size() < 50) {
-       ASSERT_TRUE(next2.is_max());
-      }
-      objects.clear();
-      start2 = next2;
-    }
-
-    // bitwise
-    r = store->collection_list(cid, start, ghobject_t::get_max(), true,
+    r = store->collection_list(cid, start, ghobject_t::get_max(),
                               50,
                               &objects,
                               &next);
-    ASSERT_TRUE(sorted(objects, true));
+    ASSERT_TRUE(sorted(objects));
     ASSERT_EQ(r, 0);
     listed.insert(objects.begin(), objects.end());
     if (objects.size() < 50) {
@@ -3323,7 +3299,7 @@ public:
     while (1) {
       vector<ghobject_t> objects;
       int r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(),
-                                    true, 10, &objects, 0);
+                                    10, &objects, 0);
       assert(r >= 0);
       if (objects.empty())
        break;
@@ -3897,11 +3873,10 @@ public:
     ghobject_t next, current;
     while (1) {
       //cerr << "scanning..." << std::endl;
-      int r = store->collection_list(cid, current, ghobject_t::get_max(),
-                                    true, 100,
+      int r = store->collection_list(cid, current, ghobject_t::get_max(), 100,
                                     &objects, &next);
       ASSERT_EQ(r, 0);
-      ASSERT_TRUE(sorted(objects, true));
+      ASSERT_TRUE(sorted(objects));
       objects_set.insert(objects.begin(), objects.end());
       objects.clear();
       if (next.is_max()) break;
@@ -3932,7 +3907,8 @@ public:
       ASSERT_GT(available_objects.count(*i), (unsigned)0);
     }
 
-    int r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(), true, INT_MAX, &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());
@@ -4413,7 +4389,7 @@ TEST_P(StoreTest, HashCollisionTest) {
   }
   }
   vector<ghobject_t> objects;
-  r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(), true, INT_MAX, &objects, 0);
+  r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(), INT_MAX, &objects, 0);
   ASSERT_EQ(r, 0);
   set<ghobject_t, ghobject_t::BitwiseComparator> listed(objects.begin(), objects.end());
   cerr << "listed.size() is " << listed.size() << " and created.size() is " << created.size() << std::endl;
@@ -4422,10 +4398,10 @@ TEST_P(StoreTest, HashCollisionTest) {
   listed.clear();
   ghobject_t current, next;
   while (1) {
-    r = store->collection_list(cid, current, ghobject_t::get_max(), true, 60,
+    r = store->collection_list(cid, current, ghobject_t::get_max(), 60,
                               &objects, &next);
     ASSERT_EQ(r, 0);
-    ASSERT_TRUE(sorted(objects, true));
+    ASSERT_TRUE(sorted(objects));
     for (vector<ghobject_t>::iterator i = objects.begin();
         i != objects.end();
         ++i) {
@@ -4511,7 +4487,7 @@ TEST_P(StoreTest, ScrubTest) {
   }
 
   vector<ghobject_t> objects;
-  r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(), true,
+  r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(),
                             INT_MAX, &objects, 0);
   ASSERT_EQ(r, 0);
   set<ghobject_t, ghobject_t::BitwiseComparator> listed(objects.begin(), objects.end());
@@ -4521,10 +4497,10 @@ TEST_P(StoreTest, ScrubTest) {
   listed.clear();
   ghobject_t current, next;
   while (1) {
-    r = store->collection_list(cid, current, ghobject_t::get_max(), true, 60,
+    r = store->collection_list(cid, current, ghobject_t::get_max(), 60,
                               &objects, &next);
     ASSERT_EQ(r, 0);
-    ASSERT_TRUE(sorted(objects, true));
+    ASSERT_TRUE(sorted(objects));
     for (vector<ghobject_t>::iterator i = objects.begin();
          i != objects.end(); ++i) {
       if (listed.count(*i))
@@ -4975,7 +4951,7 @@ void colsplittest(
 
   ObjectStore::Transaction t;
   vector<ghobject_t> objects;
-  r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(), true,
+  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);
@@ -4994,7 +4970,7 @@ void colsplittest(
   }
 
   objects.clear();
-  r = store->collection_list(tid, ghobject_t(), ghobject_t::get_max(), true,
+  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);
@@ -5272,7 +5248,7 @@ TEST_P(StoreTest, BigRGWObjectName) {
 
   {
     vector<ghobject_t> objects;
-    r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(), true,
+    r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(),
                               INT_MAX, &objects, 0);
     ASSERT_EQ(r, 0);
     ASSERT_EQ(objects.size(), 1u);
index b5e6dde149a0a0fd34666e315774b372cc354873..a529e576b7909a512445f2d940f0d9066c0cf216 100644 (file)
@@ -356,7 +356,7 @@ void WorkloadGenerator::do_destroy_collection(ObjectStore::Transaction *t,
   entry->m_osr.flush();
   vector<ghobject_t> ls;
   m_store->collection_list(entry->m_coll, ghobject_t(), ghobject_t::get_max(),
-                          true, INT_MAX, &ls, NULL);
+                          INT_MAX, &ls, NULL);
   dout(2) << __func__ << " coll " << entry->m_coll
       << " (" << ls.size() << " objects)" << dendl;
 
index 367bba2dd945c4d781c2660ad77a03361bc95dc8..87a5a00e01f2a069fcc638711577fd648299925d 100644 (file)
@@ -80,7 +80,6 @@ protected:
   virtual int _collection_list_partial(
                                       const ghobject_t &start,
                                       const ghobject_t &end,
-                                      bool sort_bitwise,
                                       int max_count,
                                       vector<ghobject_t> *ls,
                                       ghobject_t *next
index d7d1319f6c35bc915d0eb820f3f7b91ba73cfe9f..0e5cbf93efbc2157d8b2a4b13170f473ca1fc521 100644 (file)
@@ -90,7 +90,6 @@ int _action_on_all_objects_in_pg(ObjectStore *store, coll_t coll, action_on_obje
                                   coll,
                                   next,
                                   ghobject_t::get_max(),
-                                  true,
                                   LIST_AT_A_TIME,
                                   &list,
                                   &next);
@@ -621,7 +620,7 @@ int ObjectStoreTool::export_files(ObjectStore *store, coll_t coll)
 
   while (!next.is_max()) {
     vector<ghobject_t> objects;
-    int r = store->collection_list(coll, next, ghobject_t::get_max(), true, 300,
+    int r = store->collection_list(coll, next, ghobject_t::get_max(), 300,
       &objects, &next);
     if (r < 0)
       return r;