From: Casey Bodley Date: Wed, 30 Nov 2016 18:09:35 +0000 (-0500) Subject: radosgw-admin: add --compression for zone placement add/modify X-Git-Tag: v11.1.0~105^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ec0d5dfe54fe4fb40ae752510544a78f9877e561;p=ceph.git radosgw-admin: add --compression for zone placement add/modify Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 940bca28bda..b6c7bb91502 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -5,6 +5,8 @@ #include #include +#include + #include "auth/Crypto.h" #include "common/armor.h" @@ -232,6 +234,7 @@ void _usage() cout << " --data_extra_pool= placement target data extra (non-ec) pool\n"; cout << " --placement-index-type=\n"; cout << " placement target index type (normal, indexless, or #id)\n"; + cout << " --compression= placement target compression type (plugin name or empty/none)\n"; cout << " --tier-type= zone tier type\n"; cout << " --tier-config==[,...]\n"; cout << " set zone tier config keys, values\n"; @@ -2380,6 +2383,8 @@ int main(int argc, char **argv) RGWBucketIndexType placement_index_type = RGWBIType_Normal; bool index_type_specified = false; + boost::optional compression_type; + for (std::vector::iterator i = args.begin(); i != args.end(); ) { if (ceph_argparse_double_dash(args, i)) { break; @@ -2689,6 +2694,8 @@ int main(int argc, char **argv) } } index_type_specified = true; + } else if (ceph_argparse_witharg(args, i, &val, "--compression", (char*)NULL)) { + compression_type = val; } else if (strncmp(*i, "-", 1) == 0) { cerr << "ERROR: invalid flag " << *i << std::endl; return EINVAL; @@ -4102,6 +4109,9 @@ int main(int argc, char **argv) if (index_type_specified) { info.index_type = placement_index_type; } + if (compression_type) { + info.compression_type = *compression_type; + } } else if (opt_cmd == OPT_ZONE_PLACEMENT_MODIFY) { auto p = zone.placement_pools.find(placement_id); if (p == zone.placement_pools.end()) { @@ -4122,6 +4132,9 @@ int main(int argc, char **argv) if (index_type_specified) { info.index_type = placement_index_type; } + if (compression_type) { + info.compression_type = *compression_type; + } } else if (opt_cmd == OPT_ZONE_PLACEMENT_RM) { zone.placement_pools.erase(placement_id); } diff --git a/src/test/cli/radosgw-admin/help.t b/src/test/cli/radosgw-admin/help.t index 795396f1586..3b642dd9d30 100644 --- a/src/test/cli/radosgw-admin/help.t +++ b/src/test/cli/radosgw-admin/help.t @@ -182,6 +182,7 @@ --data_extra_pool= placement target data extra (non-ec) pool --placement-index-type= placement target index type (normal, indexless, or #id) + --compression= placement target compression type (plugin name or empty/none) --tier-type= zone tier type --tier-config==[,...] set zone tier config keys, values