]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/osd: Code formatting changes for plugin support in ceph_test_rados_io_support 61404/head
authorJon Bailey <jonathan.bailey1@ibm.com>
Thu, 30 Jan 2025 16:57:03 +0000 (16:57 +0000)
committerJon Bailey <jonathan.bailey1@ibm.com>
Wed, 5 Mar 2025 16:15:01 +0000 (16:15 +0000)
Modified variables used in ceph_test_rados_io_sequence to use snake_case instead of camelCase to be consistent with prior work.

Signed-off-by: Jon Bailey <jonathan.bailey1@ibm.com>
src/common/io_exerciser/EcIoSequence.cc
src/common/io_exerciser/EcIoSequence.h
src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.cc
src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.h

index c28008b5f05e36290977d9bcd9cfa2397f5dcac9..4b879fc7d5b3cd20a26db4b0454c95d7f587717b 100644 (file)
@@ -14,7 +14,7 @@ bool EcIoSequence::is_supported(Sequence sequence) const { return true; }
 std::unique_ptr<IoSequence> EcIoSequence::generate_sequence(
     Sequence sequence, std::pair<int, int> obj_size_range,
     std::optional<std::pair<int, int>> km,
-    std::optional<std::pair<std::string_view, std::string_view>> mappingLayers,
+    std::optional<std::pair<std::string_view, std::string_view>> mappinglayers,
     int seed) {
   switch (sequence) {
     case Sequence::SEQUENCE_SEQ0:
@@ -45,9 +45,9 @@ std::unique_ptr<IoSequence> EcIoSequence::generate_sequence(
       [[fallthrough]];
     case Sequence::SEQUENCE_SEQ14:
       return std::make_unique<ReadInjectSequence>(obj_size_range, seed,
-                                                  sequence, km, mappingLayers);
+                                                  sequence, km, mappinglayers);
     case Sequence::SEQUENCE_SEQ10:
-      return std::make_unique<Seq10>(obj_size_range, seed, km, mappingLayers);
+      return std::make_unique<Seq10>(obj_size_range, seed, km, mappinglayers);
     default:
       ceph_abort_msg("Unrecognised sequence");
   }
@@ -62,19 +62,19 @@ EcIoSequence::EcIoSequence(std::pair<int, int> obj_size_range, int seed)
 void EcIoSequence::select_random_data_shard_to_inject_read_error(
     std::optional<std::pair<int, int>> km,
     std::optional<std::pair<std::string_view, std::string_view>>
-        mappingLayers) {
+        mappinglayers) {
   if (km) {
     shard_to_inject = rng(km->first - 1);
   }
-  if (mappingLayers) {
-    int count = std::ranges::count(mappingLayers->first, 'D');
-    int dataShardPosition = rng(count - 1);
+  if (mappinglayers) {
+    int count = std::ranges::count(mappinglayers->first, 'D');
+    int data_shard_position = rng(count - 1);
     shard_to_inject = 0;
-    for (int i = 0; i < dataShardPosition; i++) {
+    for (int i = 0; i < data_shard_position; i++) {
       shard_to_inject =
-          std::distance(std::find(mappingLayers->first.begin(),
-                                  mappingLayers->first.end(), *shard_to_inject),
-                        mappingLayers->first.begin());
+          std::distance(std::find(mappinglayers->first.begin(),
+                                  mappinglayers->first.end(), *shard_to_inject),
+                        mappinglayers->first.begin());
       ceph_assert(*shard_to_inject != std::string::npos);
     }
   }
@@ -84,23 +84,23 @@ void EcIoSequence::select_random_data_shard_to_inject_read_error(
 void EcIoSequence::select_random_data_shard_to_inject_write_error(
     std::optional<std::pair<int, int>> km,
     std::optional<std::pair<std::string_view, std::string_view>>
-        mappingLayers) {
+        mappinglayers) {
   // Write errors do not support injecting to the primary OSD
   if (km) {
     shard_to_inject = rng(1, km->first - 1);
   }
-  if (mappingLayers) {
-    int count = std::ranges::count(mappingLayers->first, 'D');
-    if (mappingLayers->first[0] == 'D') {
+  if (mappinglayers) {
+    int count = std::ranges::count(mappinglayers->first, 'D');
+    if (mappinglayers->first[0] == 'D') {
       count--;
     }
-    int dataShardPosition = rng(1, count - 1);
+    int data_shard_position = rng(1, count - 1);
     shard_to_inject = 0;
-    for (int i = 1; i < dataShardPosition; i++) {
+    for (int i = 1; i < data_shard_position; i++) {
       shard_to_inject =
-          std::distance(std::find(mappingLayers->first.begin(),
-                                  mappingLayers->first.end(), *shard_to_inject),
-                        mappingLayers->first.begin());
+          std::distance(std::find(mappinglayers->first.begin(),
+                                  mappinglayers->first.end(), *shard_to_inject),
+                        mappinglayers->first.begin());
       ceph_assert(*shard_to_inject != std::string::npos);
     }
   }
@@ -110,19 +110,19 @@ void EcIoSequence::select_random_data_shard_to_inject_write_error(
 void EcIoSequence::select_random_shard_to_inject_read_error(
     std::optional<std::pair<int, int>> km,
     std::optional<std::pair<std::string_view, std::string_view>>
-        mappingLayers) {
+        mappinglayers) {
   if (km) {
     shard_to_inject = rng(km->first + km->second - 1);
   }
-  if (mappingLayers) {
-    int count = std::ranges::count(mappingLayers->first, 'D');
-    int dataShardPosition = rng(count - 1);
+  if (mappinglayers) {
+    int count = std::ranges::count(mappinglayers->first, 'D');
+    int data_shard_position = rng(count - 1);
     shard_to_inject = 0;
-    for (int i = 0; i < dataShardPosition; i++) {
+    for (int i = 0; i < data_shard_position; i++) {
       shard_to_inject =
-          std::distance(std::find(mappingLayers->first.begin(),
-                                  mappingLayers->first.end(), *shard_to_inject),
-                        mappingLayers->first.begin());
+          std::distance(std::find(mappinglayers->first.begin(),
+                                  mappinglayers->first.end(), *shard_to_inject),
+                        mappinglayers->first.begin());
       ceph_assert(*shard_to_inject != std::string::npos);
     }
   }
@@ -132,23 +132,23 @@ void EcIoSequence::select_random_shard_to_inject_read_error(
 void EcIoSequence::select_random_shard_to_inject_write_error(
     std::optional<std::pair<int, int>> km,
     std::optional<std::pair<std::string_view, std::string_view>>
-        mappingLayers) {
+        mappinglayers) {
   // Write errors do not support injecting to the primary OSD
   if (km) {
     shard_to_inject = rng(1, km->first + km->second - 1);
   }
-  if (mappingLayers) {
-    int count = std::ranges::count(mappingLayers->first, 'D');
-    if (mappingLayers->first[0] == 'D') {
+  if (mappinglayers) {
+    int count = std::ranges::count(mappinglayers->first, 'D');
+    if (mappinglayers->first[0] == 'D') {
       count--;
     }
-    int dataShardPosition = rng(count - 1);
+    int data_shard_position = rng(count - 1);
     shard_to_inject = 0;
-    for (int i = 0; i < dataShardPosition; i++) {
+    for (int i = 0; i < data_shard_position; i++) {
       shard_to_inject =
-          std::distance(std::find(mappingLayers->first.begin(),
-                                  mappingLayers->first.end(), *shard_to_inject),
-                        mappingLayers->first.begin());
+          std::distance(std::find(mappinglayers->first.begin(),
+                                  mappinglayers->first.end(), *shard_to_inject),
+                        mappinglayers->first.begin());
       ceph_assert(*shard_to_inject != std::string::npos);
     }
   }
@@ -172,10 +172,10 @@ ceph::io_exerciser::ReadInjectSequence::ReadInjectSequence(
     int seed,
     Sequence s,
     std::optional<std::pair<int, int>> km,
-    std::optional<std::pair<std::string_view, std::string_view>> mappingLayers)
+    std::optional<std::pair<std::string_view, std::string_view>> mappinglayers)
     : EcIoSequence(obj_size_range, seed) {
   child_sequence = IoSequence::generate_sequence(s, obj_size_range, seed);
-  select_random_data_shard_to_inject_read_error(km, mappingLayers);
+  select_random_data_shard_to_inject_read_error(km, mappinglayers);
   generate_random_read_inject_type();
 }
 
@@ -196,17 +196,17 @@ std::string ceph::io_exerciser::ReadInjectSequence::get_name() const {
 std::unique_ptr<IoOp> ReadInjectSequence::next() {
   step++;
 
-  if (nextOp) {
-    std::unique_ptr<IoOp> retOp = nullptr;
-    nextOp.swap(retOp);
-    return retOp;
+  if (next_op) {
+    std::unique_ptr<IoOp> ret_op = nullptr;
+    next_op.swap(ret_op);
+    return ret_op;
   }
 
-  std::unique_ptr<IoOp> childOp = child_sequence->next();
+  std::unique_ptr<IoOp> child_op = child_sequence->next();
 
-  switch (childOp->getOpType()) {
+  switch (child_op->getOpType()) {
     case OpType::Remove:
-      nextOp.swap(childOp);
+      next_op.swap(child_op);
       switch (inject_op_type) {
         ceph_assert(shard_to_inject.has_value());
         case InjectOpType::ReadEIO:
@@ -226,19 +226,19 @@ std::unique_ptr<IoOp> ReadInjectSequence::next() {
     case OpType::Create:
       switch (inject_op_type) {
         case InjectOpType::ReadEIO:
-          nextOp = InjectReadErrorOp::generate(
+          next_op = InjectReadErrorOp::generate(
               *shard_to_inject, 0, 0, std::numeric_limits<uint64_t>::max());
           break;
         case InjectOpType::ReadMissingShard:
-          nextOp = InjectReadErrorOp::generate(
+          next_op = InjectReadErrorOp::generate(
               *shard_to_inject, 1, 0, std::numeric_limits<uint64_t>::max());
           break;
         case InjectOpType::WriteFailAndRollback:
-          nextOp = InjectWriteErrorOp::generate(
+          next_op = InjectWriteErrorOp::generate(
               *shard_to_inject, 0, 0, std::numeric_limits<uint64_t>::max());
           break;
         case InjectOpType::WriteOSDAbort:
-          nextOp = InjectWriteErrorOp::generate(
+          next_op = InjectWriteErrorOp::generate(
               *shard_to_inject, 3, 0, std::numeric_limits<uint64_t>::max());
           break;
         case InjectOpType::None:
@@ -252,7 +252,7 @@ std::unique_ptr<IoOp> ReadInjectSequence::next() {
       break;
   }
 
-  return childOp;
+  return child_op;
 }
 
 std::unique_ptr<ceph::io_exerciser::IoOp>
@@ -267,7 +267,7 @@ ceph::io_exerciser::ReadInjectSequence::_next() {
 ceph::io_exerciser::Seq10::Seq10(
     std::pair<int, int> obj_size_range, int seed,
     std::optional<std::pair<int, int>> km,
-    std::optional<std::pair<std::string_view, std::string_view>> mappingLayers)
+    std::optional<std::pair<std::string_view, std::string_view>> mappinglayers)
     : EcIoSequence(obj_size_range, seed),
       offset(0),
       length(1),
@@ -279,7 +279,7 @@ ceph::io_exerciser::Seq10::Seq10(
       test_all_sizes(
           false)  // Only test obj_size(rand()) due to time constraints
 {
-  select_random_shard_to_inject_write_error(km, mappingLayers);
+  select_random_shard_to_inject_write_error(km, mappinglayers);
   // We will inject specifically as part of our sequence in this sequence
   setup_inject = false;
   if (!test_all_sizes) {
index 33d46fbbe41ab77dc0b1d965deb5dbcf3181bcb6..8082b2267a78eebf1e7a1d6f87b58b8b7a3ff6da 100644 (file)
@@ -11,7 +11,7 @@ class EcIoSequence : public IoSequence {
       Sequence s, std::pair<int, int> obj_size_range,
       std::optional<std::pair<int, int>> km,
       std::optional<std::pair<std::string_view, std::string_view>>
-          mappingLayers,
+          mappinglayers,
       int seed);
 
  protected:
@@ -27,19 +27,19 @@ class EcIoSequence : public IoSequence {
   void select_random_data_shard_to_inject_read_error(
       std::optional<std::pair<int, int>> km,
       std::optional<std::pair<std::string_view, std::string_view>>
-          mappingLayers);
+          mappinglayers);
   void select_random_data_shard_to_inject_write_error(
       std::optional<std::pair<int, int>> km,
       std::optional<std::pair<std::string_view, std::string_view>>
-          mappingLayers);
+          mappinglayers);
   void select_random_shard_to_inject_read_error(
       std::optional<std::pair<int, int>> km,
       std::optional<std::pair<std::string_view, std::string_view>>
-          mappingLayers);
+          mappinglayers);
   void select_random_shard_to_inject_write_error(
       std::optional<std::pair<int, int>> km,
       std::optional<std::pair<std::string_view, std::string_view>>
-          mappingLayers);
+          mappinglayers);
   void generate_random_read_inject_type();
   void generate_random_write_inject_type();
 };
@@ -50,7 +50,7 @@ class ReadInjectSequence : public EcIoSequence {
       std::pair<int, int> obj_size_range, int seed, Sequence s,
       std::optional<std::pair<int, int>> km,
       std::optional<std::pair<std::string_view, std::string_view>>
-          mappingLayers);
+          mappinglayers);
 
   Sequence get_id() const override;
   std::string get_name() const override;
@@ -59,7 +59,7 @@ class ReadInjectSequence : public EcIoSequence {
 
  private:
   std::unique_ptr<IoSequence> child_sequence;
-  std::unique_ptr<IoOp> nextOp;
+  std::unique_ptr<IoOp> next_op;
 };
 
 class Seq10 : public EcIoSequence {
@@ -67,7 +67,7 @@ class Seq10 : public EcIoSequence {
   Seq10(std::pair<int, int> obj_size_range, int seed,
         std::optional<std::pair<int, int>> km,
         std::optional<std::pair<std::string_view, std::string_view>>
-            mappingLayers);
+            mappinglayers);
 
   Sequence get_id() const override;
   std::string get_name() const override;
index d645edbd0f13426793c9d1e2055de0fe88d44e27..2d6806fbed8a573c78b38bf7aeec95583d93b1bb 100644 (file)
@@ -89,14 +89,14 @@ void validate(boost::any& v, const std::vector<std::string>& values,
   po::validators::check_first_occurrence(v);
   const std::string& s = po::validators::get_single_string(values);
 
-  const std::string_view* pluginIt =
-      std::find(ceph::io_sequence::tester::pluginChoices.begin(),
-                ceph::io_sequence::tester::pluginChoices.end(), s);
-  if (ceph::io_sequence::tester::pluginChoices.end() == pluginIt) {
+  const std::string_view* plugin_iter =
+      std::find(ceph::io_sequence::tester::plugin_choices.begin(),
+                ceph::io_sequence::tester::plugin_choices.end(), s);
+  if (ceph::io_sequence::tester::plugin_choices.end() == plugin_iter) {
     throw po::validation_error(po::validation_error::invalid_option_value);
   }
 
-  v = boost::any(*pluginIt);
+  v = boost::any(*plugin_iter);
 }
 
 constexpr std::string_view usage[] = {
@@ -590,38 +590,38 @@ ceph::io_sequence::tester::SelectErasureProfile::select() {
       shec::SelectErasureC ssc{rng, vm, profile.plugin, profile.km, first_use};
       profile.c = ssc.select();
     } else if (profile.plugin == "lrc") {
-      std::pair<std::string, std::string> mappingAndLayers = sml.select();
-      profile.mapping = mappingAndLayers.first;
-      profile.layers = mappingAndLayers.second;
+      std::pair<std::string, std::string> mappinglayers = sml.select();
+      profile.mapping = mappinglayers.first;
+      profile.layers = mappinglayers.second;
     }
 
-    ErasureCodeProfile erasureCodeProfile;
-    erasureCodeProfile["plugin"] = std::string(profile.plugin);
+    ErasureCodeProfile erasure_code_profile;
+    erasure_code_profile["plugin"] = std::string(profile.plugin);
     if (profile.km) {
-      erasureCodeProfile["k"] = std::to_string(profile.km->first);
-      erasureCodeProfile["m"] = std::to_string(profile.km->second);
+      erasure_code_profile["k"] = std::to_string(profile.km->first);
+      erasure_code_profile["m"] = std::to_string(profile.km->second);
     }
     if (profile.technique) {
-      erasureCodeProfile["technique"] = *profile.technique;
+      erasure_code_profile["technique"] = *profile.technique;
     }
     if (profile.packet_size) {
-      erasureCodeProfile["packetsize"] = std::to_string(*profile.packet_size);
+      erasure_code_profile["packetsize"] = std::to_string(*profile.packet_size);
     }
     if (profile.c) {
-      erasureCodeProfile["c"] = std::to_string(*profile.c);
+      erasure_code_profile["c"] = std::to_string(*profile.c);
     }
     if (profile.w) {
-      erasureCodeProfile["packetsize"] = std::to_string(*profile.w);
+      erasure_code_profile["packetsize"] = std::to_string(*profile.w);
     }
     if (profile.jerasure_per_chunk_alignment) {
-      erasureCodeProfile["jerasure_per_chunk_alignment"] =
+      erasure_code_profile["jerasure_per_chunk_alignment"] =
           std::to_string(*profile.jerasure_per_chunk_alignment);
     }
     if (profile.mapping) {
-      erasureCodeProfile["mapping"] = *profile.mapping;
+      erasure_code_profile["mapping"] = *profile.mapping;
     }
     if (profile.layers) {
-      erasureCodeProfile["layers"] = *profile.layers;
+      erasure_code_profile["layers"] = *profile.layers;
     }
 
     ErasureCodePluginRegistry& instance = ErasureCodePluginRegistry::instance();
@@ -629,7 +629,7 @@ ceph::io_sequence::tester::SelectErasureProfile::select() {
     std::stringstream ss;
     instance.factory(std::string(profile.plugin),
                      cct->_conf.get_val<std::string>("erasure_code_dir"),
-                     erasureCodeProfile, &ec_impl, &ss);
+                     erasure_code_profile, &ec_impl, &ss);
     ceph_assert(ec_impl);
 
     SelectErasureChunkSize scs{rng, vm, ec_impl, first_use};
@@ -704,10 +704,10 @@ void ceph::io_sequence::tester::SelectErasureProfile::create(
 
   bool force =
       profile.chunk_size.has_value() && (*(profile.chunk_size) % 4096 != 0);
-  ceph::messaging::osd::OSDECProfileSetRequest ecProfileSetRequest{
+  ceph::messaging::osd::OSDECProfileSetRequest ec_profile_set_request{
       profile.name, profile_values, force};
   int rc =
-      send_mon_command(ecProfileSetRequest, rados, "OSDECProfileSetRequest",
+      send_mon_command(ec_profile_set_request, rados, "OSDECProfileSetRequest",
                        inbl, &outbl, formatter.get());
   ceph_assert(rc == 0);
 }
@@ -719,9 +719,9 @@ ceph::io_sequence::tester::SelectErasureProfile::selectExistingProfile(
   bufferlist inbl, outbl;
   auto formatter = std::make_shared<JSONFormatter>(false);
 
-  ceph::messaging::osd::OSDECProfileGetRequest osdECProfileGetRequest{
+  ceph::messaging::osd::OSDECProfileGetRequest ec_profile_get_request{
       profile_name};
-  rc = send_mon_command(osdECProfileGetRequest, rados, "OSDECProfileGetRequest",
+  rc = send_mon_command(ec_profile_get_request, rados, "OSDECProfileGetRequest",
                         inbl, &outbl, formatter.get());
   ceph_assert(rc == 0);
 
@@ -802,10 +802,10 @@ const std::string ceph::io_sequence::tester::SelectErasurePool::select() {
       bool success = p.parse(outbl.c_str(), outbl.length());
       ceph_assert(success);
 
-      ceph::messaging::osd::OSDPoolGetReply osdPoolGetReply;
-      osdPoolGetReply.decode_json(&p);
+      ceph::messaging::osd::OSDPoolGetReply pool_get_reply;
+      pool_get_reply.decode_json(&p);
 
-      profile = sep.selectExistingProfile(osdPoolGetReply.erasure_code_profile);
+      profile = sep.selectExistingProfile(pool_get_reply.erasure_code_profile);
     } else {
       created_pool_name = create();
     }
@@ -829,9 +829,9 @@ std::string ceph::io_sequence::tester::SelectErasurePool::create() {
   profile = sep.select();
   pool_name = fmt::format("testpool-pr{}", profile->name);
 
-  ceph::messaging::osd::OSDECPoolCreateRequest poolCreateRequest{
+  ceph::messaging::osd::OSDECPoolCreateRequest pool_create_request{
       pool_name, "erasure", 8, 8, profile->name};
-  rc = send_mon_command(poolCreateRequest, rados, "OSDECPoolCreateRequest",
+  rc = send_mon_command(pool_create_request, rados, "OSDECPoolCreateRequest",
                         inbl, &outbl, formatter.get());
   ceph_assert(rc == 0);
 
@@ -849,21 +849,21 @@ void ceph::io_sequence::tester::SelectErasurePool::configureServices(
   auto formatter = std::make_shared<JSONFormatter>(false);
 
   if (!allow_pool_autoscaling) {
-    ceph::messaging::osd::OSDSetRequest setNoAutoscaleRequest{"noautoscale",
+    ceph::messaging::osd::OSDSetRequest no_autoscale_request{"noautoscale",
                                                               std::nullopt};
-    rc = send_mon_command(setNoAutoscaleRequest, rados, "OSDSetRequest", inbl,
+    rc = send_mon_command(no_autoscale_request, rados, "OSDSetRequest", inbl,
                           &outbl, formatter.get());
     ceph_assert(rc == 0);
   }
 
   if (!allow_pool_balancer) {
-    ceph::messaging::balancer::BalancerOffRequest balancerOffRequest;
-    rc = send_mon_command(balancerOffRequest, rados, "BalancerOffRequest", inbl,
+    ceph::messaging::balancer::BalancerOffRequest balancer_off_request;
+    rc = send_mon_command(balancer_off_request, rados, "BalancerOffRequest", inbl,
                           &outbl, formatter.get());
     ceph_assert(rc == 0);
 
-    ceph::messaging::balancer::BalancerStatusRequest balancerStatusRequest;
-    rc = send_mon_command(balancerStatusRequest, rados, "BalancerStatusRequest",
+    ceph::messaging::balancer::BalancerStatusRequest balancer_status_request;
+    rc = send_mon_command(balancer_status_request, rados, "BalancerStatusRequest",
                           inbl, &outbl, formatter.get());
     ceph_assert(rc == 0);
 
@@ -871,37 +871,37 @@ void ceph::io_sequence::tester::SelectErasurePool::configureServices(
     bool success = p.parse(outbl.c_str(), outbl.length());
     ceph_assert(success);
 
-    ceph::messaging::balancer::BalancerStatusReply reply;
-    reply.decode_json(&p);
-    ceph_assert(!reply.active);
+    ceph::messaging::balancer::BalancerStatusReply balancer_status_reply;
+    balancer_status_reply.decode_json(&p);
+    ceph_assert(!balancer_status_reply.active);
   }
 
-  if (allow_pool_deep_scrubbing) {
-    ceph::messaging::osd::OSDSetRequest setNoDeepScrubRequest{"nodeep-scrub",
+  if (!allow_pool_deep_scrubbing) {
+    ceph::messaging::osd::OSDSetRequest no_deep_scrub_request{"nodeep-scrub",
                                                               std::nullopt};
-    rc = send_mon_command(setNoDeepScrubRequest, rados, "setNoDeepScrubRequest",
+    rc = send_mon_command(no_deep_scrub_request, rados, "setNoDeepScrubRequest",
                           inbl, &outbl, formatter.get());
     ceph_assert(rc == 0);
   }
 
-  if (allow_pool_scrubbing) {
-    ceph::messaging::osd::OSDSetRequest setNoScrubRequest{"noscrub",
+  if (!allow_pool_scrubbing) {
+    ceph::messaging::osd::OSDSetRequest no_scrub_request{"noscrub",
                                                           std::nullopt};
-    rc = send_mon_command(setNoScrubRequest, rados, "OSDSetRequest", inbl,
+    rc = send_mon_command(no_scrub_request, rados, "OSDSetRequest", inbl,
                           &outbl, formatter.get());
     ceph_assert(rc == 0);
   }
 
   if (test_recovery) {
-    ceph::messaging::config::ConfigSetRequest configSetBluestoreDebugRequest{
+    ceph::messaging::config::ConfigSetRequest bluestore_debug_request{
         "global", "bluestore_debug_inject_read_err", "true", std::nullopt};
-    rc = send_mon_command(configSetBluestoreDebugRequest, rados,
+    rc = send_mon_command(bluestore_debug_request, rados,
                           "ConfigSetRequest", inbl, &outbl, formatter.get());
     ceph_assert(rc == 0);
 
-    ceph::messaging::config::ConfigSetRequest configSetMaxMarkdownRequest{
+    ceph::messaging::config::ConfigSetRequest max_markdown_request{
         "global", "osd_max_markdown_count", "99999999", std::nullopt};
-    rc = send_mon_command(configSetMaxMarkdownRequest, rados,
+    rc = send_mon_command(max_markdown_request, rados,
                           "ConfigSetRequest", inbl, &outbl, formatter.get());
     ceph_assert(rc == 0);
   }
@@ -922,9 +922,9 @@ ceph::io_sequence::tester::TestObject::TestObject(
     const std::string pool = spo.select();
     if (!dryrun) {
       ceph_assert(spo.getProfile());
-      poolKM = spo.getProfile()->km;
+      pool_km = spo.getProfile()->km;
       if (spo.getProfile()->mapping && spo.getProfile()->layers) {
-        poolMappingLayers = {*spo.getProfile()->mapping,
+        pool_mappinglayers = {*spo.getProfile()->mapping,
                              *spo.getProfile()->layers};
       }
     }
@@ -966,7 +966,7 @@ ceph::io_sequence::tester::TestObject::TestObject(
 
   if (testrecovery) {
     seq = ceph::io_exerciser::EcIoSequence::generate_sequence(
-        curseq, obj_size_range, poolKM, poolMappingLayers,
+        curseq, obj_size_range, pool_km, pool_mappinglayers,
         seqseed.value_or(rng()));
   } else {
     seq = ceph::io_exerciser::IoSequence::generate_sequence(
@@ -1005,7 +1005,7 @@ bool ceph::io_sequence::tester::TestObject::next() {
       } else {
         if (testrecovery) {
           seq = ceph::io_exerciser::EcIoSequence::generate_sequence(
-              curseq, obj_size_range, poolKM, poolMappingLayers,
+              curseq, obj_size_range, pool_km, pool_mappinglayers,
               seqseed.value_or(rng()));
         } else {
           seq = ceph::io_exerciser::IoSequence::generate_sequence(
@@ -1103,15 +1103,15 @@ void ceph::io_sequence::tester::TestRunner::list_sequence(bool testrecovery) {
     std::optional<ceph::io_sequence::tester::Profile> profile =
         spo.getProfile();
     std::optional<std::pair<int, int>> km;
-    std::optional<std::pair<std::string_view, std::string_view>> mappingLayers;
+    std::optional<std::pair<std::string_view, std::string_view>> mappinglayers;
     if (profile) {
       km = profile->km;
       if (profile->mapping && profile->layers) {
-        mappingLayers = {*spo.getProfile()->mapping, *spo.getProfile()->layers};
+        mappinglayers = {*spo.getProfile()->mapping, *spo.getProfile()->layers};
       }
     }
     seq = ceph::io_exerciser::EcIoSequence::generate_sequence(
-        s, obj_size_range, km, mappingLayers, seqseed.value_or(rng()));
+        s, obj_size_range, km, mappinglayers, seqseed.value_or(rng()));
   } else {
     seq = ceph::io_exerciser::IoSequence::generate_sequence(
         s, obj_size_range, seqseed.value_or(rng()));
@@ -1207,8 +1207,8 @@ bool ceph::io_sequence::tester::TestRunner::run_interactive_test() {
     bufferlist inbl, outbl;
     auto formatter = std::make_unique<JSONFormatter>(false);
 
-    ceph::messaging::osd::OSDMapRequest osdMapRequest{pool, object_name, ""};
-    int rc = send_mon_command(osdMapRequest, rados, "OSDMapRequest", inbl,
+    ceph::messaging::osd::OSDMapRequest osd_map_request{pool, object_name, ""};
+    int rc = send_mon_command(osd_map_request, rados, "OSDMapRequest", inbl,
                               &outbl, formatter.get());
     ceph_assert(rc == 0);
 
@@ -1216,11 +1216,11 @@ bool ceph::io_sequence::tester::TestRunner::run_interactive_test() {
     bool success = p.parse(outbl.c_str(), outbl.length());
     ceph_assert(success);
 
-    ceph::messaging::osd::OSDMapReply reply{};
-    reply.decode_json(&p);
+    ceph::messaging::osd::OSDMapReply osd_map_reply{};
+    osd_map_reply.decode_json(&p);
 
     model = std::make_unique<ceph::io_exerciser::RadosIo>(
-        rados, asio, pool, object_name, reply.acting, sbs.select(), rng(),
+        rados, asio, pool, object_name, osd_map_reply.acting, sbs.select(), rng(),
         1,  // 1 thread
         lock, cond);
   }
index 986b823104e499eca1e6c8963937242c6ba87bb8..dabe8faf748bb04473050084fe38b02864255142 100644 (file)
@@ -84,9 +84,9 @@ class ErasureCodePlugin;
 namespace io_sequence {
 namespace tester {
 // Choices for min and max object size
-inline static constexpr size_t objectSizeSize = 10;
-inline static constexpr std::array<std::pair<int, int>, objectSizeSize>
-    objectSizeChoices = {{{1, 32},  // Default - best for boundary checking
+inline static constexpr size_t object_size_array_size = 10;
+inline static constexpr std::array<std::pair<int, int>, object_size_array_size>
+    object_size_choices = {{{1, 32},  // Default - best for boundary checking
                           {12, 14},
                           {28, 30},
                           {36, 38},
@@ -99,30 +99,30 @@ inline static constexpr std::array<std::pair<int, int>, objectSizeSize>
 
 using SelectObjectSize =
     ProgramOptionSelector<std::pair<int, int>,
-                          io_sequence::tester ::objectSizeSize,
-                          io_sequence::tester ::objectSizeChoices>;
+                          io_sequence::tester::object_size_array_size,
+                          io_sequence::tester::object_size_choices>;
 
 // Choices for block size
-inline static constexpr int blockSizeSize = 5;
-inline static constexpr std::array<uint64_t, blockSizeSize> blockSizeChoices = {
+inline static constexpr int block_size_array_size = 5;
+inline static constexpr std::array<uint64_t, block_size_array_size> block_size_choices = {
     {2048,  // Default - test boundaries for EC 4K chunk size
      512, 3767, 4096, 32768}};
 
 using SelectBlockSize =
     ProgramOptionSelector<uint64_t,
-                          io_sequence::tester ::blockSizeSize,
-                          io_sequence::tester ::blockSizeChoices>;
+                          io_sequence::tester::block_size_array_size,
+                          io_sequence::tester::block_size_choices>;
 
 // Choices for number of threads
-inline static constexpr int threadArraySize = 4;
-inline static constexpr std::array<int, threadArraySize> threadCountChoices = {
+inline static constexpr int thread_array_size = 4;
+inline static constexpr std::array<int, thread_array_size> thread_count_choices = {
     {1,  // Default
      2, 4, 8}};
 
 using SelectNumThreads =
     ProgramOptionSelector<int,
-                          io_sequence::tester ::threadArraySize,
-                          io_sequence::tester ::threadCountChoices>;
+                          io_sequence::tester::thread_array_size,
+                          io_sequence::tester::thread_count_choices>;
 
 class SelectSeqRange
     : public ProgramOptionReader<std::pair<ceph::io_exerciser ::Sequence,
@@ -134,14 +134,14 @@ class SelectSeqRange
 };
 
 // Choices for plugin
-inline static constexpr int pluginListSize = 5;
-inline static constexpr std::array<std::string_view, pluginListSize>
-    pluginChoices = {{"jerasure", "isa", "clay", "shec", "lrc"}};
+inline static constexpr int plugin_array_size = 5;
+inline static constexpr std::array<std::string_view, plugin_array_size>
+    plugin_choices = {{"jerasure", "isa", "clay", "shec", "lrc"}};
 
 using SelectErasurePlugin =
     ProgramOptionSelector<std::string_view,
-                          io_sequence::tester ::pluginListSize,
-                          io_sequence::tester ::pluginChoices>;
+                          io_sequence::tester::plugin_array_size,
+                          io_sequence::tester::plugin_choices>;
 
 class SelectErasureKM
     : public ProgramOptionGeneratedSelector<std::pair<int, int>> {
@@ -226,9 +226,9 @@ class SelectErasurePacketSize
 namespace lrc {
 // Choices for lrc mappings and layers. The index selected for the mapping
 // matches what index will be chosen from the layers array.
-inline static constexpr int mappingLayerListSizes = 15;
+inline static constexpr int mapping_layer_array_sizes = 15;
 
-inline static std::array<std::string, mappingLayerListSizes> mappingChoices = {{
+inline static std::array<std::string, mapping_layer_array_sizes> mapping_choices = {{
     "_DD",
     "_DDD",
     "_DDDD",
@@ -246,7 +246,7 @@ inline static std::array<std::string, mappingLayerListSizes> mappingChoices = {{
     "_D_D_DDDD",
 }};
 
-inline static std::array<std::string, mappingLayerListSizes> layerChoices = {{
+inline static std::array<std::string, mapping_layer_array_sizes> layer_choices = {{
     "[[\"cDD\",\"\"]]",
     "[[\"cDDD\",\"\"]]",
     "[[\"cDDDD\",\"\"]]",
@@ -266,13 +266,13 @@ inline static std::array<std::string, mappingLayerListSizes> layerChoices = {{
 
 using SelectMapping =
     ProgramOptionSelector<std::string,
-                          io_sequence::tester::lrc::mappingLayerListSizes,
-                          io_sequence::tester::lrc::mappingChoices>;
+                          io_sequence::tester::lrc::mapping_layer_array_sizes,
+                          io_sequence::tester::lrc::mapping_choices>;
 
 using SelectLayers =
     ProgramOptionSelector<std::string,
-                          io_sequence::tester::lrc::mappingLayerListSizes,
-                          io_sequence::tester::lrc::layerChoices>;
+                          io_sequence::tester::lrc::mapping_layer_array_sizes,
+                          io_sequence::tester::lrc::layer_choices>;
 
 class SelectMappingAndLayers {
  public:
@@ -358,7 +358,7 @@ class SelectErasureProfile : public ProgramOptionReader<Profile> {
   SelectErasurePlugin spl;
   lrc::SelectMappingAndLayers sml;
 
-  std::unique_ptr<ErasureCodePlugin> erasureCode;
+  std::unique_ptr<ErasureCodePlugin> erasure_code;
 };
 
 class SelectErasurePool : public ProgramOptionReader<std::string> {
@@ -442,9 +442,9 @@ class TestObject {
   ceph::util::random_number_generator<int>& rng;
   bool verbose;
   std::optional<int> seqseed;
-  std::optional<std::pair<int, int>> poolKM;
+  std::optional<std::pair<int, int>> pool_km;
   std::optional<std::pair<std::string_view, std::string_view>>
-      poolMappingLayers;
+      pool_mappinglayers;
   bool testrecovery;
 };