From: Xiaoxi Chen Date: Wed, 29 Apr 2015 08:27:16 +0000 (+0800) Subject: Kill collection_list in CollectionIndex X-Git-Tag: v9.1.0~421^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7ee3eeffa68b14386aa7845d7e439697231fe5a5;p=ceph.git Kill collection_list in CollectionIndex Now we use CollectionIndex.collection_list_partial. Signed-off-by: Xiaoxi Chen --- diff --git a/src/os/CollectionIndex.h b/src/os/CollectionIndex.h index 2f832477b29f4..093acc0aabdc4 100644 --- a/src/os/CollectionIndex.h +++ b/src/os/CollectionIndex.h @@ -173,11 +173,6 @@ protected: ghobject_t *next ///< [out] Next object to list ) = 0; - /// List contents of collection. - virtual int collection_list( - vector *ls ///< [out] Listed Objects - ) = 0; - /// Call prior to removing directory virtual int prep_delete() { return 0; } diff --git a/src/os/HashIndex.cc b/src/os/HashIndex.cc index d5494a90df7b3..e791d6614ec9f 100644 --- a/src/os/HashIndex.cc +++ b/src/os/HashIndex.cc @@ -320,11 +320,6 @@ int HashIndex::_lookup(const ghobject_t &oid, return get_mangled_name(*path, oid, mangled_name, exists_out); } -int HashIndex::_collection_list(vector *ls) { - vector path; - return list_by_hash(path, ghobject_t::get_max(), 0, 0, 0, ls); -} - int HashIndex::_collection_list_partial(const ghobject_t &start, const ghobject_t &end, int max_count, diff --git a/src/os/HashIndex.h b/src/os/HashIndex.h index b94cb50524808..0723a85114165 100644 --- a/src/os/HashIndex.h +++ b/src/os/HashIndex.h @@ -178,9 +178,6 @@ protected: string *mangled_name, int *exists ); - int _collection_list( - vector *ls - ); /** * Pre-hash the collection to create folders according to the expected number diff --git a/src/os/LFNIndex.cc b/src/os/LFNIndex.cc index f0f5affc02531..06dd161fedb2a 100644 --- a/src/os/LFNIndex.cc +++ b/src/os/LFNIndex.cc @@ -143,11 +143,6 @@ int LFNIndex::lookup(const ghobject_t &oid, ); } -int LFNIndex::collection_list(vector *ls) -{ - return _collection_list(ls); -} - int LFNIndex::pre_hash_collection(uint32_t pg_num, uint64_t expected_num_objs) { return _pre_hash_collection(pg_num, expected_num_objs); diff --git a/src/os/LFNIndex.h b/src/os/LFNIndex.h index 684d3ca08cc48..a754477fafaea 100644 --- a/src/os/LFNIndex.h +++ b/src/os/LFNIndex.h @@ -178,11 +178,6 @@ public: int *exist ); - /// @see CollectionIndex - int collection_list( - vector *ls - ); - /// @see CollectionIndex; int pre_hash_collection( uint32_t pg_num, @@ -243,21 +238,6 @@ protected: int *exists ///< [out] True if the object exists. ) = 0; - /** - * List contents of the collection, must be implemented by derived class. - * - * @param [out] seq Snapid to list. - * @param [in] max_count Max number to list (0 for no limit). - * @param [out] ls Container for listed objects. - * @param [in,out] last List handle. 0 for beginning. Passing the same - * cookie location will cause the next max_count to be listed. - * @return Error code. 0 on success. - */ - /// List contents of collection. - virtual int _collection_list( - vector *ls ///< [out] Listed objects. - ) = 0; - /// Pre-hash the collection with the given pg number and /// expected number of objects in the collection. virtual int _pre_hash_collection( diff --git a/src/test/objectstore/workload_generator.cc b/src/test/objectstore/workload_generator.cc index 60d88e14082b0..04bb906ce416d 100644 --- a/src/test/objectstore/workload_generator.cc +++ b/src/test/objectstore/workload_generator.cc @@ -353,7 +353,7 @@ void WorkloadGenerator::do_destroy_collection(ObjectStore::Transaction *t, m_nr_runs.set(0); entry->m_osr.flush(); vector ls; - m_store->collection_list(entry->m_coll, ls); + m_store->collection_list_impl(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;