OP_COLL_HINT = 40, // cid, type, bl
OP_TRY_RENAME = 41, // oldcid, oldoid, newoid
+ OP_MERGE_DELETE = 42, //move tempobj to base object. cid, oid, newoid, vector of tuple <src offset, dest offset, len>
};
// Transaction hint type
case OP_CLONERANGE2:
case OP_CLONE:
+ case OP_MERGE_DELETE:
assert(op->cid < cm.size());
assert(op->oid < om.size());
assert(op->dest_oid < om.size());
void decode_attrset(map<string,bufferlist>& aset) {
::decode(aset, data_bl_p);
}
+ void decode_move_info(vector<boost::tuple<uint64_t, uint64_t, uint64_t >>& move_info) {
+ ::decode(move_info, data_bl_p);
+ }
void decode_attrset_bl(bufferlist *pbl) {
decode_str_str_map_to_bl(data_bl_p, pbl);
}
}
data.ops++;
}
+
+ /*
+ * Move source object to base object.
+ * Data portion is only copied from source object to base object.
+ * The copy is done according to the move_info vector of tuple, which
+ * has information of src_offset, dest_offset and length.
+ * Finally, the source object is deleted.
+ */
+ void move_ranges_destroy_src(
+ const coll_t& cid,
+ const ghobject_t& src_oid,
+ ghobject_t oid,
+ const vector<boost::tuple<uint64_t, uint64_t, uint64_t>>& move_info) {
+ Op* _op = _get_next_op();
+ _op->op = OP_MERGE_DELETE;
+ _op->cid = _get_coll_id(cid);
+ _op->oid = _get_object_id(src_oid);
+ _op->dest_oid = _get_object_id(oid);
+ ::encode(move_info, data_bl);
+ data.ops++;
+ }
+
/// Create the collection
void create_collection(const coll_t& cid, int bits) {
if (use_tbl) {