]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
int * working with perl
authorMichael Rodriguez <michael@newdream.net>
Tue, 4 Mar 2008 23:44:24 +0000 (15:44 -0800)
committerMichael Rodriguez <michael@newdream.net>
Tue, 4 Mar 2008 23:44:24 +0000 (15:44 -0800)
src/crush/CrushWrapper.h

index 2a66fc1996b68ac0fb5f4b968579fefc1f38ff4e..1c0bb0699c9afe3029d0fea06ed7a3360a3271ae 100644 (file)
@@ -236,47 +236,17 @@ public:
 
   /* modifiers */
   int add_bucket(int bucketno, int alg, int type, int size,
-                int *items, int *weights, double *min, double *max, double *avg) {
-    std::cout << "here" <<std::endl;
-    //crush_bucket *b = crush_make_bucket(alg, type, size, 0, 0);
+                int *items, int *weights) {
+    crush_bucket *b = crush_make_bucket(alg, type, size, items, weights);
 
-
-    int num = 0;
-    std::cout << "bucket size: "<<size<<std::endl;
-
-
-    *min = *max = *items;
-    *avg = 0.0;
-    for (int i=0; i < size; i++) {
-      std::cout << "stats: " << num << " : " << *items << " : "  << *weights <<std::endl;
-      *avg += *items;
-      if (*items < *min)
-        *min = *items;
-      else if (*items > *max)       
-       *max = *items;      
-      items++;
-      weights++;
-      num++;
-    }    
-
-    printf("here\n");
-
-    *avg /= num;
-
-    return 10;
-    //return crush_add_bucket(crush, bucketno, b);
+    return crush_add_bucket(crush, bucketno, b);
   }
 
-
-
   void finalize() {
     assert(crush);
     crush_finalize(crush);
   }
 
-
-
-
   void set_offload(int i, unsigned o) {
     assert(i < crush->max_devices);
     crush->device_offload[i] = o;