Librados Library Functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Everyone, I am working on a Project-Based on ceph which Integrates PDC API with Ceph Rados with the help of librados Library.
I am working under the UC Santa Cruz organization Under the Google summer of code 2021 Program. I am stuck at storing the Key-Value(integer form) Pairs in RADOS.
I tried running the code, but I am unable to read the values from associated keys, Can anyone please help me in reading/Write operations of Key-value pairs.
 My dummy code is : 
 rados_write_op_t write_op = rados_create_write_op();
        printf("Created an Func for Object Operations");
        rados_write_op_create(write_op(),LIBRADOS_CREATE_EXCLUSIVE, NULL);
        printf("Created an Object For operation");

        size_t p = 2; //No.of key value Pairs
        char *key1="key1", *key2 = "key2"; //keys

        char *key_arr[2] = {key1,key2}; //Pointer array to keys
        int v1 = 21,v2 = 22; //values to associate to each key (integer form)
        int  *vals[2] = {&v1,&v2}; //pointer array storing the location of values to set
        
        int lens[2] = {4,4};
        rados_write_op_omap_set(write_op, key_arr, vals, lens, p); //func used to set those key-value pairs
        printf("Set the key/value pairs on an object\n");
        rados_write_op_operate(write_op,io,"keytest",NULL,0); //operated on object "keytest"
rados_release_write_op(write_op);
        rados_read_op_t read_op = rados_create_read_op();
        rados_omap_iter_t iter_vals;
        int r_vals;
 
       rados_read_op_omap_get_vals_by_keys(read_op,key_arr,p,&iter_vals,&r_vals); //To read the values of keys
        rados_read_op_operate(read_op,io,"keytest",0);
        printf("%D\n",r_vals);
rados_release_read_op(read_op);
Thanks
Mishal
LNM IIT JAIPUR
India
_______________________________________________
Dev mailing list -- dev@xxxxxxx
To unsubscribe send an email to dev-leave@xxxxxxx

[Index of Archives]     [CEPH Users]     [Ceph Devel]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux