summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2012-05-02 12:15:23 -0700
committerSage Weil <sage@newdream.net>2012-05-02 14:55:53 -0700
commit5aadb5783315d83241ea4a1dbaf4d763e5e0fb34 (patch)
tree259cd752d58db27558cf167f7cd0088ad7f1e6e4
parent8220ab251bb59a6b274dbd9456d129aef48a0c30 (diff)
downloadceph-5aadb5783315d83241ea4a1dbaf4d763e5e0fb34.tar.gz
crush: do some docs
Signed-off-by: Sage Weil <sage@newdream.net>
-rw-r--r--src/crush/CrushWrapper.cc9
-rw-r--r--src/crush/CrushWrapper.h40
2 files changed, 41 insertions, 8 deletions
diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc
index 396fcfacde0..9d9307b1f34 100644
--- a/src/crush/CrushWrapper.cc
+++ b/src/crush/CrushWrapper.cc
@@ -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
{
diff --git a/src/crush/CrushWrapper.h b/src/crush/CrushWrapper.h
index 3db2a23c34a..cd0b32c79a7 100644
--- a/src/crush/CrushWrapper.h
+++ b/src/crush/CrushWrapper.h
@@ -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) {