std::map<int, Continuation::stagePtr> callbacks;
bool _continue_function(int r, int n) {
- set<int>::iterator stage_iter = stages_in_flight.find(n);
- ceph_assert(stage_iter != stages_in_flight.end());
+ std::set<int>::iterator in_flight_iter = stages_in_flight.find(n);
+ ceph_assert(in_flight_iter != stages_in_flight.end());
ceph_assert(callbacks.count(n));
stagePtr p = callbacks[n];
- pair<set<int>::iterator,bool> insert_r = stages_processing.insert(n);
+ [[maybe_unused]] auto [processing_iter, inserted] =
+ stages_processing.insert(n);
bool done = (this->*p)(r);
if (done)
reported_done = true;
- stages_processing.erase(insert_r.first);
- stages_in_flight.erase(stage_iter);
+ stages_processing.erase(processing_iter);
+ stages_in_flight.erase(in_flight_iter);
return done;
}
} // namespace ceph::logging::detail
JournaldLogger::JournaldLogger(const SubsystemMap *s) :
- m_entry_encoder(make_unique<detail::EntryEncoder>()),
+ m_entry_encoder(std::make_unique<detail::EntryEncoder>()),
m_subs(s)
{
client.m_msghdr.msg_iov = m_entry_encoder->iovec();
}
JournaldClusterLogger::JournaldClusterLogger() :
- m_log_entry_encoder(make_unique<detail::LogEntryEncoder>())
+ m_log_entry_encoder(std::make_unique<detail::LogEntryEncoder>())
{
client.m_msghdr.msg_iov = m_log_entry_encoder->iovec();
client.m_msghdr.msg_iovlen = m_log_entry_encoder->iovec_len();
// ---- quincy+ ----
LRUSet<LogEntryKey> recent_keys;
- std::map<std::string, pair<uint64_t,uint64_t>> channel_info; // channel -> [begin, end)
+ std::map<std::string, std::pair<uint64_t,uint64_t>> channel_info; // channel -> [begin, end)
LogSummary() : version(0) {}
#define dout_subsys ceph_subsys_
+using namespace std;
+
MemoryModel::MemoryModel(CephContext *cct_)
: cct(cct_)
{
using std::string_view;
using std::vector;
+using namespace std::literals;
+
/**
* Given a cmddesc like "foo baz name=bar,type=CephString",
* return the prefix "foo baz".
#include "common/Clock.h"
#include "obj_bencher.h"
+using std::ostream;
+using std::cerr;
+using std::cout;
+using std::setfill;
+using std::setprecision;
+using std::setw;
+using std::string;
+using std::unique_lock;
+using std::unique_ptr;
+
const std::string BENCH_LASTRUN_METADATA = "benchmark_last_metadata";
const std::string BENCH_PREFIX = "benchmark_data";
const std::string BENCH_OBJ_NAME = BENCH_PREFIX + "_%s_%d_object%d";
class ObjBencher {
bool show_time;
Formatter *formatter = NULL;
- ostream *outstream = NULL;
+ std::ostream *outstream = NULL;
public:
CephContext *cct;
protected:
int fetch_bench_metadata(const std::string& metadata_file, uint64_t* op_size,
uint64_t* object_size, int* num_ops, int* num_objects, int* prev_pid);
- int write_bench(int secondsToRun, int concurrentios, const string& run_name_meta, unsigned max_objects, int prev_pid);
+ int write_bench(int secondsToRun, int concurrentios, const std::string& run_name_meta, unsigned max_objects, int prev_pid);
int seq_read_bench(int secondsToRun, int num_ops, int num_objects, int concurrentios, int writePid, bool no_verify=false);
int rand_read_bench(int secondsToRun, int num_ops, int num_objects, int concurrentios, int writePid, bool no_verify=false);
virtual bool get_objects(std::list< std::pair<std::string, std::string> >* objects, int num) = 0;
virtual void set_namespace(const std::string&) {}
- ostream& out(ostream& os);
- ostream& out(ostream& os, utime_t& t);
+ std::ostream& out(std::ostream& os);
+ std::ostream& out(std::ostream& os, utime_t& t);
public:
explicit ObjBencher(CephContext *cct_) : show_time(false), cct(cct_), data() {}
virtual ~ObjBencher() {}
void set_formatter(Formatter *f) {
formatter = f;
}
- void set_outstream(ostream& os) {
+ void set_outstream(std::ostream& os) {
outstream = &os;
}
int clean_up_slow(const std::string& prefix, int concurrentios);
#include "include/scope_guard.h"
using std::string;
+using std::ostream;
using std::vector;
// -----------------------------------------------------------------------------
vector<string> confs = get_str_vec(opts, ":");
for (auto conf : confs) {
// Construct engine section statement like "engine1=engine1_section"
- engine_id = id_prefix + to_string(index++);
+ engine_id = id_prefix + std::to_string(index++);
engine_statement += engine_id + "=" + engine_id + suffix + delimiter;
// Adapt to OpenSSL parser
#ifndef CEPH_STRESCAPE_H
#define CEPH_STRESCAPE_H
+#include <algorithm>
#include <ostream>
#include <string_view>
s = std::string(sv);
} else {
maxlen = std::max<size_t>(8, maxlen);
- s = std::string(sv.substr(0, maxlen-3))+"..."s;
+ s = std::string(sv.substr(0, maxlen-3)) + "...";
}
std::replace_if(s.begin(), s.end(), [](char c){ return !(isalnum(c) || ispunct(c)); }, '.');
return s;
#define dout_subsys ceph_subsys_
+using namespace std;
namespace ceph {
g_ceph_context->_log->set_flush_on_exit();
// drop privileges?
- ostringstream priv_ss;
+ std::ostringstream priv_ss;
#ifndef _WIN32
// consider --setuser root a no-op, even if we're not root