]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
FileStore: Index caching is introduced for performance improvement
authorSomnath Roy <somnath.roy@sandisk.com>
Mon, 30 Jun 2014 08:28:07 +0000 (01:28 -0700)
committerSomnath Roy <somnath.roy@sandisk.com>
Thu, 14 Aug 2014 22:28:30 +0000 (15:28 -0700)
commit78d70daff4fcc8170d192ed7d9e3fe90fc881a95
tree96cae7d4b12b36695b7de5597cf2eeec286bb988
parentb04d84db8c1060cf7489abfaa55253dd2125ba66
FileStore: Index caching is introduced for performance improvement

IndexManager now has a Index caching. Index will only be created if not
found in the cache. Earlier, each op is creating an Index object and other
ops requesting the same index needed to wait till previous op is done.
Also, after finishing lookup, this Index object was destroyed.
Now, a Index cache is been implemented to persists these Indexes since
there is a major performance hit because each op is creating and destroying
these. A RWlock is been introduced in the CollectionIndex class and that is
responsible for sync between lookup and create.
Also, since these Index objects are persistent there is no need to use
smart pointers. So, Index is a wrapper class of CollecIndex* now.
It is the responsibility of the users of Index now to lock explicitely
before using them. Index object is sufficient now for locking and no need
to hold IndexPath for locking. The function interfaces of lfn_open,lfn_find
are changed accordingly.

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
13 files changed:
src/os/CollectionIndex.h
src/os/FileStore.cc
src/os/FileStore.h
src/os/FlatIndex.cc
src/os/FlatIndex.h
src/os/HashIndex.cc
src/os/HashIndex.h
src/os/IndexManager.cc
src/os/IndexManager.h
src/os/LFNIndex.cc
src/os/LFNIndex.h
src/test/os/TestFlatIndex.cc
src/test/os/TestLFNIndex.cc