]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os: rename and make use of the split_threshold parameter.
authorGreg Farnum <gregory.farnum@dreamhost.com>
Wed, 9 Nov 2011 19:43:21 +0000 (11:43 -0800)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Wed, 9 Nov 2011 19:43:21 +0000 (11:43 -0800)
This was accidentally left out of the must_split calculation. Put it
in, and rename it to split_multiplier (as that is a much better name
for how it's used).

In the default case this won't actually change behavior, but it
makes the behavior configurable as it's supposed to be.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
src/os/HashIndex.cc
src/os/HashIndex.h

index 540cb4c9270ff9d9ee16ca418ccc84fabf4e9aaa..cfbd9bf0cf4525560c64ed3187f92aa4ebc1647e 100644 (file)
@@ -207,7 +207,7 @@ bool HashIndex::must_merge(const subdir_info_s &info) {
 
 bool HashIndex::must_split(const subdir_info_s &info) {
   return (info.hash_level < (unsigned)MAX_HASH_LEVEL &&
-         info.objs > ((unsigned)merge_threshold * 32));
+         info.objs > ((unsigned)merge_threshold * 16 * split_multiplier));
                            
 }
 
index bbcbc9904adcadd8e929bd0a643742518c6fcd94..a4256e3fd24d49e3219af7a753368905bb66c7ca 100644 (file)
@@ -56,10 +56,10 @@ private:
   /**
    * Merges occur when the number of object drops below
    * merge_threshold and splits occur when the number of objects
-   * exceeds 16 * merge_threshold * split_threshold.
+   * exceeds 16 * merge_threshold * split_multiplier.
    */
   int merge_threshold;
-  int split_threshold;
+  int split_multiplier;
 
   /// Encodes current subdir state for determining when to split/merge.
   struct subdir_info_s {
@@ -128,10 +128,10 @@ public:
   HashIndex(
     const char *base_path, ///< [in] Path to the index root.
     int merge_at,          ///< [in] Merge threshhold.
-    int split_at,         ///< [in] Split threshhold.
+    int split_multiple,           ///< [in] Split threshhold.
     uint32_t index_version)///< [in] Index version
     : LFNIndex(base_path, index_version), merge_threshold(merge_at),
-      split_threshold(split_at) {}
+      split_multiplier(split_multiple) {}
 
   /// @see CollectionIndex
   uint32_t collection_version() { return index_version; }