OP_COLL_MOVE_RENAME = 38, // oldcid, oldoid, newcid, newoid
OP_SETALLOCHINT = 39, // cid, oid, object_size, write_size
+ OP_COLL_HINT = 40, // cid, type, bl
};
private:
::encode(cid, tbl);
ops++;
}
+
+ /**
+ * Give the collection a hint.
+ *
+ * @param cid - collection id.
+ * @param type - hint type.
+ * @param hint - the hint payload, which contains the customized
+ * data along with the hint type.
+ */
+ void collection_hint(coll_t cid, uint32_t type, const bufferlist& hint) {
+ __u32 op = OP_COLL_HINT;
+ ::encode(op, tbl);
+ ::encode(cid, tbl);
+ ::encode(type, tbl);
+ ::encode(hint, tbl);
+ ops++;
+ }
+
/// remove the collection, the collection must be empty
void remove_collection(coll_t cid) {
__u32 op = OP_RMCOLL;
}
break;
+ case Transaction::OP_COLL_HINT:
+ {
+ coll_t cid = i.decode_cid();
+ uint32_t type = i.decode_u32();
+ f->dump_string("op_name", "coll_hint");
+ f->dump_stream("collection") << cid;
+ f->dump_unsigned("type", type);
+ }
+ break;
+
case Transaction::OP_RMCOLL:
{
coll_t cid = i.decode_cid();
ceph_osd_feature_incompat.insert(CEPH_OSD_FEATURE_INCOMPAT_LEVELDBINFO);
ceph_osd_feature_incompat.insert(CEPH_OSD_FEATURE_INCOMPAT_LEVELDBLOG);
ceph_osd_feature_incompat.insert(CEPH_OSD_FEATURE_INCOMPAT_SNAPMAPPER);
+ ceph_osd_feature_incompat.insert(CEPH_OSD_FEATURE_INCOMPAT_HINTS);
return CompatSet(ceph_osd_feature_compat, ceph_osd_feature_ro_compat,
ceph_osd_feature_incompat);
}
#define CEPH_OSD_FEATURE_INCOMPAT_LEVELDBLOG CompatSet::Feature(9, "leveldblog")
#define CEPH_OSD_FEATURE_INCOMPAT_SNAPMAPPER CompatSet::Feature(10, "snapmapper")
#define CEPH_OSD_FEATURE_INCOMPAT_SHARDS CompatSet::Feature(11, "sharded objects")
+#define CEPH_OSD_FEATURE_INCOMPAT_HINTS CompatSet::Feature(12, "transaction hints")
/// max recovery priority for MBackfillReserve