]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
radosgw-admin: add --compression for zone placement add/modify
authorCasey Bodley <cbodley@redhat.com>
Wed, 30 Nov 2016 18:09:35 +0000 (13:09 -0500)
committerCasey Bodley <cbodley@redhat.com>
Thu, 1 Dec 2016 01:06:14 +0000 (20:06 -0500)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_admin.cc
src/test/cli/radosgw-admin/help.t

index 940bca28bda8ff27ff42dfe3c5e523b1596f69ca..b6c7bb915022de16f75f8d4b161b80bcbb264210 100644 (file)
@@ -5,6 +5,8 @@
 #include <sstream>
 #include <string>
 
+#include <boost/optional.hpp>
+
 #include "auth/Crypto.h"
 
 #include "common/armor.h"
@@ -232,6 +234,7 @@ void _usage()
   cout << "   --data_extra_pool=<pool>  placement target data extra (non-ec) pool\n";
   cout << "   --placement-index-type=<type>\n";
   cout << "                             placement target index type (normal, indexless, or #id)\n";
+  cout << "   --compression=<type>      placement target compression type (plugin name or empty/none)\n";
   cout << "   --tier-type=<type>        zone tier type\n";
   cout << "   --tier-config=<k>=<v>[,...]\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<std::string> compression_type;
+
   for (std::vector<const char*>::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);
         }
index 795396f15860f757c5b170fcc6027d36129665ce..3b642dd9d30e07b7cd02970b86d996f7e34ed727 100644 (file)
      --data_extra_pool=<pool>  placement target data extra (non-ec) pool
      --placement-index-type=<type>
                                placement target index type (normal, indexless, or #id)
+     --compression=<type>      placement target compression type (plugin name or empty/none)
      --tier-type=<type>        zone tier type
      --tier-config=<k>=<v>[,...]
                                set zone tier config keys, values