" setomapheader <obj-name> <val>\n"
" tmap-to-omap <obj-name> convert tmap keys/values to omap\n"
" listwatchers <obj-name> list the watchers of this object\n"
+" set-alloc-hint <obj-name> <expected-object-size> <expected-write-size>\n"
+" set allocation hint for an object\n"
"\n"
"IMPORT AND EXPORT\n"
" import [options] <local-directory> <rados-pool>\n"
ret = io_ctx.notify(oid, 0, bl);
if (ret != 0)
cerr << "error calling notify: " << ret << std::endl;
+ } else if (strcmp(nargs[0], "set-alloc-hint") == 0) {
+ if (!pool_name || nargs.size() < 4)
+ usage_exit();
+ string err;
+ string oid(nargs[1]);
+ uint64_t expected_object_size = strict_strtoll(nargs[2], 10, &err);
+ if (!err.empty()) {
+ cerr << "couldn't parse expected_object_size: " << err << std::endl;
+ usage_exit();
+ }
+ uint64_t expected_write_size = strict_strtoll(nargs[3], 10, &err);
+ if (!err.empty()) {
+ cerr << "couldn't parse expected_write_size: " << err << std::endl;
+ usage_exit();
+ }
+ ret = io_ctx.set_alloc_hint(oid, expected_object_size, expected_write_size);
+ if (ret < 0) {
+ cerr << "error setting alloc-hint " << pool_name << "/" << oid << ": "
+ << strerror_r(-ret, buf, sizeof(buf)) << std::endl;
+ goto out;
+ }
} else if (strcmp(nargs[0], "load-gen") == 0) {
if (!pool_name) {
cerr << "error: must specify pool" << std::endl;