]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: do some docs
authorSage Weil <sage@newdream.net>
Wed, 2 May 2012 19:15:23 +0000 (12:15 -0700)
committerSage Weil <sage@newdream.net>
Wed, 2 May 2012 21:55:53 +0000 (14:55 -0700)
Signed-off-by: Sage Weil <sage@newdream.net>
src/crush/CrushWrapper.cc
src/crush/CrushWrapper.h

index 396fcfacde0d0c019e742c10d597466b4979aa55..9d9307b1f34dc446e93d3735b3bca0a7c29b842e 100644 (file)
@@ -60,18 +60,11 @@ int CrushWrapper::remove_item(CephContext *cct, int item)
     name_map.erase(item);
     have_rmaps = false;
     ret = 0;
-  }  
+  }
   
   return ret;
 }
 
-/**
- * see if item is located where we think it is
- *
- * @param cct cct
- * @param item item id
- * @param loc location to check (map of type to bucket names)
- */
 bool CrushWrapper::check_item_loc(CephContext *cct, int item, map<string,string>& loc,
                                  float *weight)  // typename -> bucketname
 {
index 3db2a23c34a682a51566a29c9a241f5fef35ba61..cd0b32c79a7671fd7f6de6f4f21c0754ad5a6df0 100644 (file)
@@ -164,9 +164,49 @@ public:
 
 
   void find_roots(set<int>& roots) const;
+
+  /**
+   * see if item is located where we think it is
+   *
+   * @param cct cct
+   * @param item item id
+   * @param loc location to check (map of type to bucket names)
+   */
   bool check_item_loc(CephContext *cct, int item, map<string,string>& loc, float *weight);
+
+  /**
+   * insert an item into the map at a specific position
+   *
+   * If the item is already present in the map, we will return EEXIST or similar errors.
+   *
+   * @param cct cct
+   * @param id item id
+   * @param weight item weight
+   * @param name item name
+   * @param loc location (map of type to bucket names)
+   */
   int insert_item(CephContext *cct, int id, float weight, string name, map<string,string>& loc);
+
+  /**
+   * add or update an item's position in the map
+   *
+   * This is analogous to insert_item, except we will move an item if
+   * it is already present.
+   *
+   * @param cct cct
+   * @param id item id
+   * @param weight item weight
+   * @param name item name
+   * @param loc location (map of type to bucket names)
+   */
   int update_item(CephContext *cct, int id, float weight, string name, map<string,string>& loc);
+
+  /**
+   * remove an item from the map
+   *
+   * @param cct cct
+   * @param id item id to remove
+   */
   int remove_item(CephContext *cct, int id);
   int adjust_item_weight(CephContext *cct, int id, int weight);
   int adjust_item_weightf(CephContext *cct, int id, float weight) {