2 * Argument types used by cls_kvs.cc
4 * Created on: Aug 10, 2012
13 #include "include/encoding.h"
14 #include "key_value_store/kv_flat_btree_async.h"
17 using ceph::bufferlist;
19 struct assert_size_args {
20 uint64_t bound; //the size to compare to - should be k or 2k
21 uint64_t comparator; //should be CEPH_OSD_CMPXATTR_OP_EQ,
22 //CEPH_OSD_CMPXATTR_OP_LT, or
23 //CEPH_OSD_CMPXATTR_OP_GT
25 void encode(bufferlist &bl) const {
28 ::encode(comparator, bl);
31 void decode(bufferlist::iterator &p) {
34 ::decode(comparator, p);
38 WRITE_CLASS_ENCODER(assert_size_args)
40 struct idata_from_key_args {
43 index_data next_idata;
45 void encode(bufferlist &bl) const {
49 ::encode(next_idata, bl);
52 void decode(bufferlist::iterator &p) {
56 ::decode(next_idata, p);
60 WRITE_CLASS_ENCODER(idata_from_key_args)
62 struct idata_from_idata_args {
64 index_data next_idata;
66 void encode(bufferlist &bl) const {
69 ::encode(next_idata, bl);
72 void decode(bufferlist::iterator &p) {
75 ::decode(next_idata, p);
79 WRITE_CLASS_ENCODER(idata_from_idata_args)
81 struct omap_set_args {
82 map<string, bufferlist> omap;
86 void encode(bufferlist &bl) const {
90 ::encode(exclusive, bl);
93 void decode(bufferlist::iterator &p) {
97 ::decode(exclusive, p);
101 WRITE_CLASS_ENCODER(omap_set_args)
103 struct omap_rm_args {
104 std::set<string> omap;
107 void encode(bufferlist &bl) const {
108 ENCODE_START(1,1,bl);
113 void decode(bufferlist::iterator &p) {
120 WRITE_CLASS_ENCODER(omap_rm_args)
122 struct rebalance_args {
127 void encode(bufferlist &bl) const {
128 ENCODE_START(1,1,bl);
131 ::encode(comparator, bl);
134 void decode(bufferlist::iterator &p) {
138 ::decode(comparator, p);
142 WRITE_CLASS_ENCODER(rebalance_args)
145 #endif /* CLS_KVS_H_ */