cfuse = cf;
client = cl;
}
- ~RemountTest() {}
+ ~RemountTest() override {}
void *entry() override {
#if defined(__linux__)
int ver = get_linux_version();
public:
explicit CommandHook(Client *client);
bool call(std::string command, cmdmap_t &cmdmap, std::string format,
- bufferlist& out);
+ bufferlist& out) override;
};
CommandHook m_command_hook;
// friends
friend class SyntheticClient;
- bool ms_dispatch(Message *m);
+ bool ms_dispatch(Message *m) override;
- void ms_handle_connect(Connection *con);
- bool ms_handle_reset(Connection *con);
- void ms_handle_remote_reset(Connection *con);
- bool ms_handle_refused(Connection *con);
- bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bool force_new);
+ void ms_handle_connect(Connection *con) override;
+ bool ms_handle_reset(Connection *con) override;
+ void ms_handle_remote_reset(Connection *con) override;
+ bool ms_handle_refused(Connection *con) override;
+ bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bool force_new) override;
int authenticate();
void clear_filer_flags(int flags);
Client(Messenger *m, MonClient *mc);
- ~Client();
+ ~Client() override;
void tear_down_cache();
void update_metadata(std::string const &k, std::string const &v);
Client *client;
Fh *f;
C_Readahead(Client *c, Fh *f);
- ~C_Readahead();
- void finish(int r);
+ ~C_Readahead() override;
+ void finish(int r) override;
};
int _read_sync(Fh *f, uint64_t off, uint64_t len, bufferlist *bl, bool *checkeof);
void ll_register_callbacks(struct client_callback_args *args);
int test_dentry_handling(bool can_invalidate);
- virtual const char** get_tracked_conf_keys() const;
- virtual void handle_conf_change(const struct md_config_t *conf,
- const std::set <std::string> &changed);
+ const char** get_tracked_conf_keys() const override;
+ void handle_conf_change(const struct md_config_t *conf,
+ const std::set <std::string> &changed) override;
};
#endif
: m_objecter(o),
m_finisher(fin),
m_lock(lock) { }
- virtual ~ObjecterWriteback() {}
+ ~ObjecterWriteback() override {}
- virtual void read(const object_t& oid, uint64_t object_no,
+ void read(const object_t& oid, uint64_t object_no,
const object_locator_t& oloc, uint64_t off, uint64_t len,
snapid_t snapid, bufferlist *pbl, uint64_t trunc_size,
- __u32 trunc_seq, int op_flags, Context *onfinish) {
+ __u32 trunc_seq, int op_flags, Context *onfinish) override {
m_objecter->read_trunc(oid, oloc, off, len, snapid, pbl, 0,
trunc_size, trunc_seq,
new C_OnFinisher(new C_Lock(m_lock, onfinish),
m_finisher));
}
- virtual bool may_copy_on_write(const object_t& oid, uint64_t read_off,
- uint64_t read_len, snapid_t snapid) {
+ bool may_copy_on_write(const object_t& oid, uint64_t read_off,
+ uint64_t read_len, snapid_t snapid) override {
return false;
}
- virtual ceph_tid_t write(const object_t& oid, const object_locator_t& oloc,
+ ceph_tid_t write(const object_t& oid, const object_locator_t& oloc,
uint64_t off, uint64_t len,
const SnapContext& snapc, const bufferlist &bl,
ceph::real_time mtime, uint64_t trunc_size,
__u32 trunc_seq, ceph_tid_t journal_tid,
- Context *oncommit) {
+ Context *oncommit) override {
return m_objecter->write_trunc(oid, oloc, off, len, snapc, bl, mtime, 0,
trunc_size, trunc_seq,
new C_OnFinisher(new C_Lock(m_lock,
m_finisher));
}
- virtual bool can_scattered_write() { return true; }
+ bool can_scattered_write() override { return true; }
using WritebackHandler::write;
- virtual ceph_tid_t write(const object_t& oid, const object_locator_t& oloc,
+ ceph_tid_t write(const object_t& oid, const object_locator_t& oloc,
vector<pair<uint64_t, bufferlist> >& io_vec,
const SnapContext& snapc, ceph::real_time mtime,
uint64_t trunc_size, __u32 trunc_seq,
- Context *oncommit) {
+ Context *oncommit) override {
ObjectOperation op;
for (vector<pair<uint64_t, bufferlist> >::iterator p = io_vec.begin();
p != io_vec.end();
return 0;
}
- ~PGLSCephFSFilter() {}
+ ~PGLSCephFSFilter() override {}
bool reject_empty_xattr() override { return false; }
bool filter(const hobject_t &obj, bufferlist& xattr_data,
bufferlist& outdata) override;
return 0;
}
- ~PGLSHelloFilter() {}
+ ~PGLSHelloFilter() override {}
bool filter(const hobject_t &obj, bufferlist& xattr_data,
bufferlist& outdata) override
{
int *ret_code;
public:
ClsBucketIndexOpCtx(T* _data, int *_ret_code) : data(_data), ret_code(_ret_code) { assert(data); }
- ~ClsBucketIndexOpCtx() {}
+ ~ClsBucketIndexOpCtx() override {}
void handle_completion(int r, bufferlist& outbl) override {
if (r >= 0) {
try {
RGWGetDirHeader_CB *ret_ctx;
public:
explicit GetDirHeaderCompletion(RGWGetDirHeader_CB *_ctx) : ret_ctx(_ctx) {}
- ~GetDirHeaderCompletion() {
+ ~GetDirHeaderCompletion() override {
ret_ctx->put();
}
void handle_completion(int r, bufferlist& outbl) override {
class RGWGetDirHeader_CB : public RefCountedObject {
public:
- virtual ~RGWGetDirHeader_CB() {}
+ ~RGWGetDirHeader_CB() override {}
virtual void handle_response(int r, rgw_bucket_dir_header& header) = 0;
};
class CLSRGWIssueBucketIndexInit : public CLSRGWConcurrentIO {
protected:
- int issue_op(int shard_id, const string& oid);
- int valid_ret_code() { return -EEXIST; }
- void cleanup();
+ int issue_op(int shard_id, const string& oid) override;
+ int valid_ret_code() override { return -EEXIST; }
+ void cleanup() override;
public:
CLSRGWIssueBucketIndexInit(librados::IoCtx& ioc, map<int, string>& _bucket_objs,
uint32_t _max_aio) :
class CLSRGWIssueSetTagTimeout : public CLSRGWConcurrentIO {
uint64_t tag_timeout;
protected:
- int issue_op(int shard_id, const string& oid);
+ int issue_op(int shard_id, const string& oid) override;
public:
CLSRGWIssueSetTagTimeout(librados::IoCtx& ioc, map<int, string>& _bucket_objs,
uint32_t _max_aio, uint64_t _tag_timeout) :
bool list_versions;
map<int, rgw_cls_list_ret>& result;
protected:
- int issue_op(int shard_id, const string& oid);
+ int issue_op(int shard_id, const string& oid) override;
public:
CLSRGWIssueBucketList(librados::IoCtx& io_ctx, const cls_rgw_obj_key& _start_obj,
const string& _filter_prefix, uint32_t _num_entries,
BucketIndexShardsManager& marker_mgr;
uint32_t max;
protected:
- int issue_op(int shard_id, const string& oid);
+ int issue_op(int shard_id, const string& oid) override;
public:
CLSRGWIssueBILogList(librados::IoCtx& io_ctx, BucketIndexShardsManager& _marker_mgr, uint32_t _max,
map<int, string>& oids,
BucketIndexShardsManager& start_marker_mgr;
BucketIndexShardsManager& end_marker_mgr;
protected:
- int issue_op(int shard_id, const string& oid);
+ int issue_op(int shard_id, const string& oid) override;
// Trim until -ENODATA is returned.
- int valid_ret_code() { return -ENODATA; }
- bool need_multiple_rounds() { return true; }
- void add_object(int shard, const string& oid) { objs_container[shard] = oid; }
- void reset_container(map<int, string>& objs) {
+ int valid_ret_code() override { return -ENODATA; }
+ bool need_multiple_rounds() override { return true; }
+ void add_object(int shard, const string& oid) override { objs_container[shard] = oid; }
+ void reset_container(map<int, string>& objs) override {
objs_container.swap(objs);
iter = objs_container.begin();
objs.clear();
class CLSRGWIssueBucketCheck : public CLSRGWConcurrentIO /*<map<string, struct rgw_cls_check_index_ret> >*/ {
map<int, struct rgw_cls_check_index_ret>& result;
protected:
- int issue_op(int shard_id, const string& oid);
+ int issue_op(int shard_id, const string& oid) override;
public:
CLSRGWIssueBucketCheck(librados::IoCtx& ioc, map<int, string>& oids, map<int, struct rgw_cls_check_index_ret>& bucket_objs_ret,
uint32_t _max_aio) :
class CLSRGWIssueBucketRebuild : public CLSRGWConcurrentIO {
protected:
- int issue_op(int shard_id, const string& oid);
+ int issue_op(int shard_id, const string& oid) override;
public:
CLSRGWIssueBucketRebuild(librados::IoCtx& io_ctx, map<int, string>& bucket_objs,
uint32_t max_aio) : CLSRGWConcurrentIO(io_ctx, bucket_objs, max_aio) {}
class CLSRGWIssueGetDirHeader : public CLSRGWConcurrentIO {
map<int, rgw_cls_list_ret>& result;
protected:
- int issue_op(int shard_id, const string& oid);
+ int issue_op(int shard_id, const string& oid) override;
public:
CLSRGWIssueGetDirHeader(librados::IoCtx& io_ctx, map<int, string>& oids, map<int, rgw_cls_list_ret>& dir_headers,
uint32_t max_aio) :
int *pret;
public:
ClsUserGetHeaderCtx(cls_user_header *_h, RGWGetUserHeader_CB *_ctx, int *_pret) : header(_h), ret_ctx(_ctx), pret(_pret) {}
- ~ClsUserGetHeaderCtx() {
+ ~ClsUserGetHeaderCtx() override {
if (ret_ctx) {
ret_ctx->put();
}
class RGWGetUserHeader_CB : public RefCountedObject {
public:
- virtual ~RGWGetUserHeader_CB() {}
+ ~RGWGetUserHeader_CB() override {}
virtual void handle_response(int r, cls_user_header& header) = 0;
};
C_Cond(Cond *c, bool *d, int *r) : cond(c), done(d), rval(r) {
*done = false;
}
- void finish(int r) {
+ void finish(int r) override {
*done = true;
*rval = r;
cond->Signal();
C_SafeCond(Mutex *l, Cond *c, bool *d, int *r=0) : lock(l), cond(c), done(d), rval(r) {
*done = false;
}
- void finish(int r) {
+ void finish(int r) override {
lock->Lock();
if (rval)
*rval = r;
int rval; ///< return value
public:
C_SaferCond() : lock("C_SaferCond"), done(false), rval(0) {}
- void finish(int r) { complete(r); }
+ void finish(int r) override { complete(r); }
/// We overload complete in order to not delete the context
- void complete(int r) {
+ void complete(int r) override {
Mutex::Locker l(lock);
done = true;
rval = r;
m_context_completion.start_op();
}
- virtual void finish(int r) {
+ void finish(int r) override {
m_context_completion.finish_op(r);
}
Callback(Continuation *c, int stage) :
continuation(c),
stage_to_activate(stage) {}
- void finish(int r) {
+ void finish(int r) override {
continuation->continue_function(r, stage_to_activate);
}
};
struct FinisherThread : public Thread {
Finisher *fin;
explicit FinisherThread(Finisher *f) : fin(f) {}
- void* entry() { return (void*)fin->finisher_thread_entry(); }
+ void* entry() override { return (void*)fin->finisher_thread_entry(); }
} finisher_thread;
public:
assert(con != NULL);
}
- ~C_OnFinisher() {
+ ~C_OnFinisher() override {
if (con != nullptr) {
delete con;
con = nullptr;
}
}
- void finish(int r) {
+ void finish(int r) override {
fin->queue(con, r);
con = nullptr;
}
public:
explicit JSONFormatter(bool p = false);
- virtual void set_status(int status, const char* status_name) {};
- virtual void output_header() {};
- virtual void output_footer() {};
- void flush(std::ostream& os);
+ void set_status(int status, const char* status_name) override {};
+ void output_header() override {};
+ void output_footer() override {};
+ void flush(std::ostream& os) override;
using Formatter::flush; // don't hide Formatter::flush(bufferlist &bl)
- void reset();
- virtual void open_array_section(const char *name);
- void open_array_section_in_ns(const char *name, const char *ns);
- void open_object_section(const char *name);
- void open_object_section_in_ns(const char *name, const char *ns);
- void close_section();
- void dump_unsigned(const char *name, uint64_t u);
- void dump_int(const char *name, int64_t u);
- void dump_float(const char *name, double d);
- void dump_string(const char *name, const std::string& s);
- std::ostream& dump_stream(const char *name);
- void dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap);
- int get_len() const;
- void write_raw_data(const char *data);
+ void reset() override;
+ void open_array_section(const char *name) override;
+ void open_array_section_in_ns(const char *name, const char *ns) override;
+ void open_object_section(const char *name) override;
+ void open_object_section_in_ns(const char *name, const char *ns) override;
+ void close_section() override;
+ void dump_unsigned(const char *name, uint64_t u) override;
+ void dump_int(const char *name, int64_t u) override;
+ void dump_float(const char *name, double d) override;
+ void dump_string(const char *name, const std::string& s) override;
+ std::ostream& dump_stream(const char *name) override;
+ void dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap) override;
+ int get_len() const override;
+ void write_raw_data(const char *data) override;
private:
static const char *XML_1_DTD;
XMLFormatter(bool pretty = false, bool lowercased = false, bool underscored = true);
- virtual void set_status(int status, const char* status_name) {}
- virtual void output_header();
- virtual void output_footer();
+ void set_status(int status, const char* status_name) override {}
+ void output_header() override;
+ void output_footer() override;
- void flush(std::ostream& os);
+ void flush(std::ostream& os) override;
using Formatter::flush; // don't hide Formatter::flush(bufferlist &bl)
- void reset();
- void open_array_section(const char *name);
- void open_array_section_in_ns(const char *name, const char *ns);
- void open_object_section(const char *name);
- void open_object_section_in_ns(const char *name, const char *ns);
- void close_section();
- void dump_unsigned(const char *name, uint64_t u);
- void dump_int(const char *name, int64_t u);
- void dump_float(const char *name, double d);
- void dump_string(const char *name, const std::string& s);
- std::ostream& dump_stream(const char *name);
- void dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap);
- int get_len() const;
- void write_raw_data(const char *data);
+ void reset() override;
+ void open_array_section(const char *name) override;
+ void open_array_section_in_ns(const char *name, const char *ns) override;
+ void open_object_section(const char *name) override;
+ void open_object_section_in_ns(const char *name, const char *ns) override;
+ void close_section() override;
+ void dump_unsigned(const char *name, uint64_t u) override;
+ void dump_int(const char *name, int64_t u) override;
+ void dump_float(const char *name, double d) override;
+ void dump_string(const char *name, const std::string& s) override;
+ std::ostream& dump_stream(const char *name) override;
+ void dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap) override;
+ int get_len() const override;
+ void write_raw_data(const char *data) override;
/* with attrs */
- void open_array_section_with_attrs(const char *name, const FormatterAttrs& attrs);
- void open_object_section_with_attrs(const char *name, const FormatterAttrs& attrs);
- void dump_string_with_attrs(const char *name, const std::string& s, const FormatterAttrs& attrs);
+ void open_array_section_with_attrs(const char *name, const FormatterAttrs& attrs) override;
+ void open_object_section_with_attrs(const char *name, const FormatterAttrs& attrs) override;
+ void dump_string_with_attrs(const char *name, const std::string& s, const FormatterAttrs& attrs) override;
protected:
void open_section_in_ns(const char *name, const char *ns, const FormatterAttrs *attrs);
public:
explicit TableFormatter(bool keyval = false);
- virtual void set_status(int status, const char* status_name) {};
- virtual void output_header() {};
- virtual void output_footer() {};
- void flush(std::ostream& os);
+ void set_status(int status, const char* status_name) override {};
+ void output_header() override {};
+ void output_footer() override {};
+ void flush(std::ostream& os) override;
using Formatter::flush; // don't hide Formatter::flush(bufferlist &bl)
- void reset();
- virtual void open_array_section(const char *name);
- void open_array_section_in_ns(const char *name, const char *ns);
- void open_object_section(const char *name);
- void open_object_section_in_ns(const char *name, const char *ns);
-
- void open_array_section_with_attrs(const char *name, const FormatterAttrs& attrs);
- void open_object_section_with_attrs(const char *name, const FormatterAttrs& attrs);
-
- void close_section();
- void dump_unsigned(const char *name, uint64_t u);
- void dump_int(const char *name, int64_t u);
- void dump_float(const char *name, double d);
- void dump_string(const char *name, const std::string& s);
- void dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap);
- void dump_string_with_attrs(const char *name, const std::string& s, const FormatterAttrs& attrs);
- std::ostream& dump_stream(const char *name);
-
- int get_len() const;
- void write_raw_data(const char *data);
+ void reset() override;
+ void open_array_section(const char *name) override;
+ void open_array_section_in_ns(const char *name, const char *ns) override;
+ void open_object_section(const char *name) override;
+ void open_object_section_in_ns(const char *name, const char *ns) override;
+
+ void open_array_section_with_attrs(const char *name, const FormatterAttrs& attrs) override;
+ void open_object_section_with_attrs(const char *name, const FormatterAttrs& attrs) override;
+
+ void close_section() override;
+ void dump_unsigned(const char *name, uint64_t u) override;
+ void dump_int(const char *name, int64_t u) override;
+ void dump_float(const char *name, double d) override;
+ void dump_string(const char *name, const std::string& s) override;
+ void dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap) override;
+ void dump_string_with_attrs(const char *name, const std::string& s, const FormatterAttrs& attrs) override;
+ std::ostream& dump_stream(const char *name) override;
+
+ int get_len() const override;
+ void write_raw_data(const char *data) override;
void get_attrs_str(const FormatterAttrs *attrs, std::string& attrs_str);
private:
class HTMLFormatter : public XMLFormatter {
public:
explicit HTMLFormatter(bool pretty = false);
- ~HTMLFormatter();
- void reset();
+ ~HTMLFormatter() override;
+ void reset() override;
- virtual void set_status(int status, const char* status_name);
- virtual void output_header();
+ void set_status(int status, const char* status_name) override;
+ void output_header() override;
- void dump_unsigned(const char *name, uint64_t u);
- void dump_int(const char *name, int64_t u);
- void dump_float(const char *name, double d);
- void dump_string(const char *name, const std::string& s);
- std::ostream& dump_stream(const char *name);
- void dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap);
+ void dump_unsigned(const char *name, uint64_t u) override;
+ void dump_int(const char *name, int64_t u) override;
+ void dump_float(const char *name, double d) override;
+ void dump_string(const char *name, const std::string& s) override;
+ std::ostream& dump_stream(const char *name) override;
+ void dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap) override;
/* with attrs */
- void dump_string_with_attrs(const char *name, const std::string& s, const FormatterAttrs& attrs);
+ void dump_string_with_attrs(const char *name, const std::string& s, const FormatterAttrs& attrs) override;
private:
template <typename T> void dump_template(const char *name, T arg);
{
public:
OutputDataSocket(CephContext *cct, uint64_t _backlog);
- virtual ~OutputDataSocket();
+ ~OutputDataSocket() override;
bool init(const std::string &path);
std::string create_shutdown_pipe(int *pipe_rd, int *pipe_wr);
std::string bind_and_listen(const std::string &sock_path, int *fd);
- void *entry();
+ void *entry() override;
bool do_accept();
void handle_connection(int fd);
PrebufferedStreambuf(char *buf, size_t len);
// called when the buffer fills up
- int_type overflow(int_type c);
+ int_type overflow(int_type c) override;
// called when we read and need more data
- int_type underflow();
+ int_type underflow() override;
/// return a string copy (inefficiently)
std::string get_str() const;
min_cost(min_c)
{}
- unsigned length() const override final {
+ unsigned length() const final {
unsigned total = 0;
for (typename SubQueues::const_iterator i = queue.begin();
i != queue.end();
}
void remove_by_filter(
- std::function<bool (T)> f) override final {
+ std::function<bool (T)> f) final {
for (typename SubQueues::iterator i = queue.begin();
i != queue.end();
) {
}
}
- void remove_by_class(K k, std::list<T> *out = 0) override final {
+ void remove_by_class(K k, std::list<T> *out = 0) final {
for (typename SubQueues::iterator i = queue.begin();
i != queue.end();
) {
}
}
- void enqueue_strict(K cl, unsigned priority, T item) override final {
+ void enqueue_strict(K cl, unsigned priority, T item) final {
high_queue[priority].enqueue(cl, 0, item);
}
- void enqueue_strict_front(K cl, unsigned priority, T item) override final {
+ void enqueue_strict_front(K cl, unsigned priority, T item) final {
high_queue[priority].enqueue_front(cl, 0, item);
}
- void enqueue(K cl, unsigned priority, unsigned cost, T item) override final {
+ void enqueue(K cl, unsigned priority, unsigned cost, T item) final {
if (cost < min_cost)
cost = min_cost;
if (cost > max_tokens_per_subqueue)
create_queue(priority)->enqueue(cl, cost, item);
}
- void enqueue_front(K cl, unsigned priority, unsigned cost, T item) override final {
+ void enqueue_front(K cl, unsigned priority, unsigned cost, T item) final {
if (cost < min_cost)
cost = min_cost;
if (cost > max_tokens_per_subqueue)
create_queue(priority)->enqueue_front(cl, cost, item);
}
- bool empty() const override final {
+ bool empty() const final {
assert(total_priority >= 0);
assert((total_priority == 0) || !(queue.empty()));
return queue.empty() && high_queue.empty();
}
- T dequeue() override final {
+ T dequeue() final {
assert(!empty());
if (!(high_queue.empty())) {
return ret;
}
- void dump(ceph::Formatter *f) const override final {
+ void dump(ceph::Formatter *f) const final {
f->dump_int("total_priority", total_priority);
f->dump_int("max_tokens_per_subqueue", max_tokens_per_subqueue);
f->dump_int("min_cost", min_cost);
int timeout = 0, int sigkill = SIGKILL);
protected:
- virtual void exec();
+ void exec() override;
private:
int timeout;
}
protected:
- virtual void finish(int r);
+ void finish(int r) override;
private:
OrderedThrottle *m_ordered_throttle;
TracepointProvider(CephContext *cct, const char *library,
const char *config_key);
- virtual ~TracepointProvider();
+ ~TracepointProvider() override;
template <const Traits &traits>
static void initialize(CephContext *cct) {
}
protected:
- virtual const char** get_tracked_conf_keys() const {
+ const char** get_tracked_conf_keys() const override {
return m_config_keys;
}
- virtual void handle_conf_change(const struct md_config_t *conf,
- const std::set <std::string> &changed);
+ void handle_conf_change(const struct md_config_t *conf,
+ const std::set <std::string> &changed) override;
private:
CephContext *m_cct;
{
std::srand(time(0));
}
- unsigned length() const override final {
+ unsigned length() const final {
return strict.size + normal.size;
}
- void remove_by_filter(std::function<bool (T)> f) override final {
+ void remove_by_filter(std::function<bool (T)> f) final {
strict.filter_list_pairs(f);
normal.filter_list_pairs(f);
}
- void remove_by_class(K cl, std::list<T>* removed = 0) override final {
+ void remove_by_class(K cl, std::list<T>* removed = 0) final {
strict.filter_class(cl, removed);
normal.filter_class(cl, removed);
}
- bool empty() const override final {
+ bool empty() const final {
return !(strict.size + normal.size);
}
- void enqueue_strict(K cl, unsigned p, T item) override final {
+ void enqueue_strict(K cl, unsigned p, T item) final {
strict.insert(p, cl, 0, item);
}
- void enqueue_strict_front(K cl, unsigned p, T item) override final {
+ void enqueue_strict_front(K cl, unsigned p, T item) final {
strict.insert(p, cl, 0, item, true);
}
- void enqueue(K cl, unsigned p, unsigned cost, T item) override final {
+ void enqueue(K cl, unsigned p, unsigned cost, T item) final {
normal.insert(p, cl, cost, item);
}
- void enqueue_front(K cl, unsigned p, unsigned cost, T item) override final {
+ void enqueue_front(K cl, unsigned p, unsigned cost, T item) final {
normal.insert(p, cl, cost, item, true);
}
T dequeue() override {
string _thread_num_option;
const char **_conf_keys;
- const char **get_tracked_conf_keys() const {
+ const char **get_tracked_conf_keys() const override {
return _conf_keys;
}
void handle_conf_change(const struct md_config_t *conf,
- const std::set <std::string> &changed);
+ const std::set <std::string> &changed) override;
public:
/** @brief Work queue that processes several submitted items at once.
virtual void _process_finish(const list<T*> &) {}
// virtual methods from WorkQueue_ below
- void *_void_dequeue() {
+ void *_void_dequeue() override {
list<T*> *out(new list<T*>);
_dequeue(out);
if (!out->empty()) {
return 0;
}
}
- void _void_process(void *p, TPHandle &handle) {
+ void _void_process(void *p, TPHandle &handle) override {
_process(*((list<T*>*)p), handle);
}
- void _void_process_finish(void *p) {
+ void _void_process_finish(void *p) override {
_process_finish(*(list<T*>*)p);
delete (list<T*> *)p;
}
: WorkQueue_(std::move(n), ti, sti), pool(p) {
pool->add_work_queue(this);
}
- ~BatchWorkQueue() {
+ ~BatchWorkQueue() override {
pool->remove_work_queue(this);
}
list<U> to_finish;
virtual void _enqueue(T) = 0;
virtual void _enqueue_front(T) = 0;
- virtual bool _empty() = 0;
+ bool _empty() override = 0;
virtual U _dequeue() = 0;
virtual void _process_finish(U) {}
- void *_void_dequeue() {
+ void *_void_dequeue() override {
{
Mutex::Locker l(_lock);
if (_empty())
}
return ((void*)1); // Not used
}
- void _void_process(void *, TPHandle &handle) {
+ void _void_process(void *, TPHandle &handle) override {
_lock.Lock();
assert(!to_process.empty());
U u = to_process.front();
_lock.Unlock();
}
- void _void_process_finish(void *) {
+ void _void_process_finish(void *) override {
_lock.Lock();
assert(!to_finish.empty());
U u = to_finish.front();
_process_finish(u);
}
- void _clear() {}
+ void _clear() override {}
public:
WorkQueueVal(string n, time_t ti, time_t sti, ThreadPool *p)
: WorkQueue_(std::move(n), ti, sti), _lock("WorkQueueVal::lock"), pool(p) {
pool->add_work_queue(this);
}
- ~WorkQueueVal() {
+ ~WorkQueueVal() override {
pool->remove_work_queue(this);
}
void queue(T item) {
virtual void _process_finish(T *) {}
// implementation of virtual methods from WorkQueue_
- void *_void_dequeue() {
+ void *_void_dequeue() override {
return (void *)_dequeue();
}
- void _void_process(void *p, TPHandle &handle) {
+ void _void_process(void *p, TPHandle &handle) override {
_process(static_cast<T *>(p), handle);
}
- void _void_process_finish(void *p) {
+ void _void_process_finish(void *p) override {
_process_finish(static_cast<T *>(p));
}
: WorkQueue_(std::move(n), ti, sti), pool(p) {
pool->add_work_queue(this);
}
- ~WorkQueue() {
+ ~WorkQueue() override {
pool->remove_work_queue(this);
}
template<typename T>
class PointerWQ : public WorkQueue_ {
public:
- ~PointerWQ() {
+ ~PointerWQ() override {
m_pool->remove_work_queue(this);
assert(m_processing == 0);
}
PointerWQ(string n, time_t ti, time_t sti, ThreadPool* p)
: WorkQueue_(std::move(n), ti, sti), m_pool(p), m_processing(0) {
}
- virtual void _clear() {
+ void _clear() override {
assert(m_pool->_lock.is_locked());
m_items.clear();
}
- virtual bool _empty() {
+ bool _empty() override {
assert(m_pool->_lock.is_locked());
return m_items.empty();
}
- virtual void *_void_dequeue() {
+ void *_void_dequeue() override {
assert(m_pool->_lock.is_locked());
if (m_items.empty()) {
return NULL;
m_items.pop_front();
return item;
}
- virtual void _void_process(void *item, ThreadPool::TPHandle &handle) {
+ void _void_process(void *item, ThreadPool::TPHandle &handle) override {
process(reinterpret_cast<T *>(item));
}
- virtual void _void_process_finish(void *item) {
+ void _void_process_finish(void *item) override {
assert(m_pool->_lock.is_locked());
assert(m_processing > 0);
--m_processing;
ThreadPool *pool;
// cppcheck-suppress noExplicitConstructor
WorkThread(ThreadPool *p) : pool(p) {}
- void *entry() {
+ void *entry() override {
pool->worker(this);
return 0;
}
public:
ThreadPool(CephContext *cct_, string nm, string tn, int n, const char *option = NULL);
- virtual ~ThreadPool();
+ ~ThreadPool() override;
/// return number of threads currently running
int get_num_threads() {
public:
C_QueueInWQ(GenContextWQ *wq, GenContext<ThreadPool::TPHandle &> *c)
: wq(wq), c(c) {}
- void finish(int) {
+ void finish(int) override {
wq->queue(c);
}
};
ThreadPool::PointerWQ<Context>::queue(ctx);
}
protected:
- virtual void _clear() {
+ void _clear() override {
ThreadPool::PointerWQ<Context>::_clear();
Mutex::Locker locker(m_lock);
m_context_results.clear();
}
- virtual void process(Context *ctx) {
+ void process(Context *ctx) override {
int result = 0;
{
Mutex::Locker locker(m_lock);
sharded_pool(tp) {
tp->set_wq(this);
}
- virtual ~ShardedWQ() {}
+ ~ShardedWQ() override {}
void queue(T item) {
_enqueue(item);
uint32_t thread_index;
WorkThreadSharded(ShardedThreadPool *p, uint32_t pthread_index): pool(p),
thread_index(pthread_index) {}
- void *entry() {
+ void *entry() override {
pool->shardedthreadpool_worker(thread_index);
return 0;
}
{
public:
AdminSocket(CephContext *cct);
- virtual ~AdminSocket();
+ ~AdminSocket() override;
/**
* register an admin socket command
std::string destroy_shutdown_pipe();
std::string bind_and_listen(const std::string &sock_path, int *fd);
- void *entry();
+ void *entry() override;
bool do_accept();
CephContext *m_cct;
size_list.push_back(table_size_);
}
- inline virtual std::size_t size() const
+ inline std::size_t size() const override
{
return size_list.back() * bits_per_char;
}
return true;
}
- virtual inline double approx_unique_element_count() const {
+ inline double approx_unique_element_count() const override {
// this is not a very good estimate; a better solution should have
// some asymptotic behavior as density() approaches 1.0.
//
private:
- inline virtual void compute_indices(const bloom_type& hash, std::size_t& bit_index, std::size_t& bit) const
+ inline void compute_indices(const bloom_type& hash, std::size_t& bit_index, std::size_t& bit) const override
{
bit_index = hash;
for (std::size_t i = 0; i < size_list.size(); ++i)
inc_total_alloc(len);
inc_history_alloc(len);
}
- ~raw_combined() {
+ ~raw_combined() override {
dec_total_alloc(len);
}
raw* clone_empty() override {
inc_total_alloc(len);
bdout << "raw_malloc " << this << " alloc " << (void *)data << " " << l << " " << buffer::get_total_alloc() << bendl;
}
- ~raw_malloc() {
+ ~raw_malloc() override {
free(data);
dec_total_alloc(len);
bdout << "raw_malloc " << this << " free " << (void *)data << " " << buffer::get_total_alloc() << bendl;
inc_history_alloc(len);
bdout << "raw_mmap " << this << " alloc " << (void *)data << " " << l << " " << buffer::get_total_alloc() << bendl;
}
- ~raw_mmap_pages() {
+ ~raw_mmap_pages() override {
::munmap(data, len);
dec_total_alloc(len);
bdout << "raw_mmap " << this << " free " << (void *)data << " " << buffer::get_total_alloc() << bendl;
inc_history_alloc(len);
bdout << "raw_posix_aligned " << this << " alloc " << (void *)data << " l=" << l << ", align=" << align << " total_alloc=" << buffer::get_total_alloc() << bendl;
}
- ~raw_posix_aligned() {
+ ~raw_posix_aligned() override {
mempool::buffer_data::alloc_char.deallocate_aligned(data, len);
dec_total_alloc(len);
bdout << "raw_posix_aligned " << this << " free " << (void *)data << " " << buffer::get_total_alloc() << bendl;
<< buffer::get_total_alloc() << bendl;
}
- ~raw_pipe() {
+ ~raw_pipe() override {
if (data)
free(data);
close_pipe(pipefds);
inc_total_alloc(len);
bdout << "raw_char " << this << " alloc " << (void *)data << " " << l << " " << buffer::get_total_alloc() << bendl;
}
- ~raw_char() {
+ ~raw_char() override {
if (data)
mempool::buffer_data::alloc_char.deallocate(data, len);
dec_total_alloc(len);
bool is_shareable() override {
return false; // !shareable, will force make_shareable()
}
- ~raw_unshareable() {
+ ~raw_unshareable() override {
delete[] data;
}
};
MEMPOOL_CLASS_HELPERS();
raw_static(const char *d, unsigned l) : raw((char*)d, l) { }
- ~raw_static() {}
+ ~raw_static() override {}
raw* clone_empty() override {
return new buffer::raw_char(len);
}
public:
raw_claim_buffer(const char *b, unsigned l, deleter d)
: raw((char*)b, l), del(std::move(d)) { }
- ~raw_claim_buffer() {}
+ ~raw_claim_buffer() override {}
raw* clone_empty() override {
return new buffer::raw_char(len);
}
public:
explicit LockdepObs(CephContext *cct) : m_cct(cct), m_registered(false) {
}
- ~LockdepObs() {
+ ~LockdepObs() override {
if (m_registered) {
lockdep_unregister_ceph_context(m_cct);
}
"get mempool stats");
assert(r == 0);
}
- ~MempoolObs() {
+ ~MempoolObs() override {
cct->_conf->remove_observer(this);
cct->get_admin_socket()->unregister_command("dump_mempools");
}
{
}
- ~CephContextServiceThread() {}
+ ~CephContextServiceThread() override {}
void *entry() override
{
struct TypedSingletonWrapper : public SingletonWrapper {
TypedSingletonWrapper(T *p) : singleton(p) {
}
- virtual ~TypedSingletonWrapper() {
+ ~TypedSingletonWrapper() override {
delete singleton;
}
bool success;
public:
JSONParser();
- virtual ~JSONParser();
+ ~JSONParser() override;
void handle_data(const char *s, int len);
bool parse(const char *buf_, int len);
Deleter del;
lambda_deleter_impl(deleter next, Deleter&& del)
: impl(std::move(next)), del(std::move(del)) {}
- virtual ~lambda_deleter_impl() override { del(); }
+ ~lambda_deleter_impl() override { del(); }
};
template <typename Object>
struct free_deleter_impl final : deleter::impl {
void* obj;
free_deleter_impl(void* obj) : impl(deleter()), obj(obj) {}
- virtual ~free_deleter_impl() override { std::free(obj); }
+ ~free_deleter_impl() override { std::free(obj); }
};
/// \endcond
CompressWQ(AsyncCompressor *ac, time_t timeout, time_t suicide_timeout, ThreadPool *tp)
: ThreadPool::WorkQueue<Job>("AsyncCompressor::CompressWQ", timeout, suicide_timeout, tp), async_compressor(ac) {}
- bool _enqueue(Job *item) {
+ bool _enqueue(Job *item) override {
job_queue.push_back(item);
return true;
}
- void _dequeue(Job *item) {
+ void _dequeue(Job *item) override {
ceph_abort();
}
- bool _empty() {
+ bool _empty() override {
return job_queue.empty();
}
- Job* _dequeue() {
+ Job* _dequeue() override {
if (job_queue.empty())
return NULL;
Job *item = NULL;
item->status.set(ERROR);
}
}
- void _process_finish(Job *item) {}
- void _clear() {}
+ void _process_finish(Job *item) override {}
+ void _clear() override {}
} compress_wq;
friend class CompressWQ;
void _compress(bufferlist &in, bufferlist &out);
compressor(0)
{}
- virtual ~CompressionPlugin() {}
+ ~CompressionPlugin() override {}
virtual int factory(CompressorRef *cs,
std::ostream *ss) = 0;
explicit CompressionPluginSnappy(CephContext* cct) : CompressionPlugin(cct)
{}
- virtual int factory(CompressorRef *cs,
- std::ostream *ss)
+ int factory(CompressorRef *cs,
+ std::ostream *ss) override
{
if (compressor == 0) {
SnappyCompressor *interface = new SnappyCompressor();
explicit CompressionPluginZlib(CephContext *cct) : CompressionPlugin(cct)
{}
- virtual int factory(CompressorRef *cs,
- std::ostream *ss)
+ int factory(CompressorRef *cs,
+ std::ostream *ss) override
{
bool isal;
if (cct->_conf->compressor_zlib_isal) {
explicit CompressionPluginZstd(CephContext* cct) : CompressionPlugin(cct)
{}
- virtual int factory(CompressorRef *cs,
- std::ostream *ss)
+ int factory(CompressorRef *cs,
+ std::ostream *ss) override
{
if (compressor == 0) {
ZstdCompressor *interface = new ZstdCompressor();
explicit FormattingDumper(const CrushWrapper *crush) : Dumper<Formatter>(crush) {}
protected:
- virtual void dump_item(const Item &qi, Formatter *f) {
+ void dump_item(const Item &qi, Formatter *f) override {
f->open_object_section("item");
dump_item_fields(qi, f);
dump_bucket_children(qi, f);
vector<int> chunk_mapping;
ErasureCodeProfile _profile;
- virtual ~ErasureCode() {}
+ ~ErasureCode() override {}
- virtual int init(ErasureCodeProfile &profile, ostream *ss) {
+ int init(ErasureCodeProfile &profile, ostream *ss) override {
_profile = profile;
return 0;
}
- virtual const ErasureCodeProfile &get_profile() const {
+ const ErasureCodeProfile &get_profile() const override {
return _profile;
}
int sanity_check_k(int k, ostream *ss);
- virtual unsigned int get_coding_chunk_count() const {
+ unsigned int get_coding_chunk_count() const override {
return get_chunk_count() - get_data_chunk_count();
}
- virtual int minimum_to_decode(const set<int> &want_to_read,
+ int minimum_to_decode(const set<int> &want_to_read,
const set<int> &available_chunks,
- set<int> *minimum);
+ set<int> *minimum) override;
- virtual int minimum_to_decode_with_cost(const set<int> &want_to_read,
+ int minimum_to_decode_with_cost(const set<int> &want_to_read,
const map<int, int> &available,
- set<int> *minimum);
+ set<int> *minimum) override;
int encode_prepare(const bufferlist &raw,
map<int, bufferlist> &encoded) const;
- virtual int encode(const set<int> &want_to_encode,
+ int encode(const set<int> &want_to_encode,
const bufferlist &in,
- map<int, bufferlist> *encoded);
+ map<int, bufferlist> *encoded) override;
- virtual int encode_chunks(const set<int> &want_to_encode,
- map<int, bufferlist> *encoded);
+ int encode_chunks(const set<int> &want_to_encode,
+ map<int, bufferlist> *encoded) override;
- virtual int decode(const set<int> &want_to_read,
+ int decode(const set<int> &want_to_read,
const map<int, bufferlist> &chunks,
- map<int, bufferlist> *decoded);
+ map<int, bufferlist> *decoded) override;
- virtual int decode_chunks(const set<int> &want_to_read,
+ int decode_chunks(const set<int> &want_to_read,
const map<int, bufferlist> &chunks,
- map<int, bufferlist> *decoded);
+ map<int, bufferlist> *decoded) override;
- virtual const vector<int> &get_chunk_mapping() const;
+ const vector<int> &get_chunk_mapping() const override;
int to_mapping(const ErasureCodeProfile &profile,
ostream *ss);
const std::string &default_value,
ostream *ss);
- virtual int decode_concat(const map<int, bufferlist> &chunks,
- bufferlist *decoded);
+ int decode_concat(const map<int, bufferlist> &chunks,
+ bufferlist *decoded) override;
protected:
int parse(const ErasureCodeProfile &profile,
{
}
- virtual
- ~ErasureCodeIsa()
+
+ ~ErasureCodeIsa() override
{
}
- virtual int create_ruleset(const string &name,
+ int create_ruleset(const string &name,
CrushWrapper &crush,
- ostream *ss) const;
+ ostream *ss) const override;
- virtual unsigned int
- get_chunk_count() const
+ unsigned int
+ get_chunk_count() const override
{
return k + m;
}
- virtual unsigned int
- get_data_chunk_count() const
+ unsigned int
+ get_data_chunk_count() const override
{
return k;
}
- virtual unsigned int get_chunk_size(unsigned int object_size) const;
+ unsigned int get_chunk_size(unsigned int object_size) const override;
- virtual int encode_chunks(const set<int> &want_to_encode,
- map<int, bufferlist> *encoded);
+ int encode_chunks(const set<int> &want_to_encode,
+ map<int, bufferlist> *encoded) override;
- virtual int decode_chunks(const set<int> &want_to_read,
+ int decode_chunks(const set<int> &want_to_read,
const map<int, bufferlist> &chunks,
- map<int, bufferlist> *decoded);
+ map<int, bufferlist> *decoded) override;
- virtual int init(ErasureCodeProfile &profile, ostream *ss);
+ int init(ErasureCodeProfile &profile, ostream *ss) override;
virtual void isa_encode(char **data,
char **coding,
matrixtype = matrix;
}
- virtual
- ~ErasureCodeIsaDefault()
+
+ ~ErasureCodeIsaDefault() override
{
}
- virtual void isa_encode(char **data,
+ void isa_encode(char **data,
char **coding,
- int blocksize);
+ int blocksize) override;
virtual bool erasure_contains(int *erasures, int i);
- virtual int isa_decode(int *erasures,
+ int isa_decode(int *erasures,
char **data,
char **coding,
- int blocksize);
+ int blocksize) override;
- virtual unsigned get_alignment() const;
+ unsigned get_alignment() const override;
- virtual void prepare();
+ void prepare() override;
private:
- virtual int parse(ErasureCodeProfile &profile,
- ostream *ss);
+ int parse(ErasureCodeProfile &profile,
+ ostream *ss) override;
};
#endif
public:
ErasureCodeIsaTableCache tcache;
- virtual int factory(const std::string &directory,
+ int factory(const std::string &directory,
ErasureCodeProfile &profile,
ErasureCodeInterfaceRef *erasure_code,
- ostream *ss);
+ ostream *ss) override;
};
#endif
per_chunk_alignment(false)
{}
- virtual ~ErasureCodeJerasure() {}
+ ~ErasureCodeJerasure() override {}
- virtual int create_ruleset(const string &name,
+ int create_ruleset(const string &name,
CrushWrapper &crush,
- ostream *ss) const;
+ ostream *ss) const override;
- virtual unsigned int get_chunk_count() const {
+ unsigned int get_chunk_count() const override {
return k + m;
}
- virtual unsigned int get_data_chunk_count() const {
+ unsigned int get_data_chunk_count() const override {
return k;
}
- virtual unsigned int get_chunk_size(unsigned int object_size) const;
+ unsigned int get_chunk_size(unsigned int object_size) const override;
- virtual int encode_chunks(const set<int> &want_to_encode,
- map<int, bufferlist> *encoded);
+ int encode_chunks(const set<int> &want_to_encode,
+ map<int, bufferlist> *encoded) override;
- virtual int decode_chunks(const set<int> &want_to_read,
+ int decode_chunks(const set<int> &want_to_read,
const map<int, bufferlist> &chunks,
- map<int, bufferlist> *decoded);
+ map<int, bufferlist> *decoded) override;
- virtual int init(ErasureCodeProfile &profile, ostream *ss);
+ int init(ErasureCodeProfile &profile, ostream *ss) override;
virtual void jerasure_encode(char **data,
char **coding,
DEFAULT_M = "3";
DEFAULT_W = "8";
}
- virtual ~ErasureCodeJerasureReedSolomonVandermonde() {
+ ~ErasureCodeJerasureReedSolomonVandermonde() override {
if (matrix)
free(matrix);
}
- virtual void jerasure_encode(char **data,
+ void jerasure_encode(char **data,
char **coding,
- int blocksize);
- virtual int jerasure_decode(int *erasures,
+ int blocksize) override;
+ int jerasure_decode(int *erasures,
char **data,
char **coding,
- int blocksize);
- virtual unsigned get_alignment() const;
- virtual void prepare();
+ int blocksize) override;
+ unsigned get_alignment() const override;
+ void prepare() override;
private:
- virtual int parse(ErasureCodeProfile &profile, ostream *ss);
+ int parse(ErasureCodeProfile &profile, ostream *ss) override;
};
class ErasureCodeJerasureReedSolomonRAID6 : public ErasureCodeJerasure {
DEFAULT_K = "7";
DEFAULT_W = "8";
}
- virtual ~ErasureCodeJerasureReedSolomonRAID6() {
+ ~ErasureCodeJerasureReedSolomonRAID6() override {
if (matrix)
free(matrix);
}
- virtual void jerasure_encode(char **data,
+ void jerasure_encode(char **data,
char **coding,
- int blocksize);
- virtual int jerasure_decode(int *erasures,
+ int blocksize) override;
+ int jerasure_decode(int *erasures,
char **data,
char **coding,
- int blocksize);
- virtual unsigned get_alignment() const;
- virtual void prepare();
+ int blocksize) override;
+ unsigned get_alignment() const override;
+ void prepare() override;
private:
- virtual int parse(ErasureCodeProfile &profile, ostream *ss);
+ int parse(ErasureCodeProfile &profile, ostream *ss) override;
};
#define DEFAULT_PACKETSIZE "2048"
DEFAULT_M = "3";
DEFAULT_W = "8";
}
- virtual ~ErasureCodeJerasureCauchy() {
+ ~ErasureCodeJerasureCauchy() override {
if (bitmatrix)
free(bitmatrix);
if (schedule)
free(schedule);
}
- virtual void jerasure_encode(char **data,
+ void jerasure_encode(char **data,
char **coding,
- int blocksize);
- virtual int jerasure_decode(int *erasures,
+ int blocksize) override;
+ int jerasure_decode(int *erasures,
char **data,
char **coding,
- int blocksize);
- virtual unsigned get_alignment() const;
+ int blocksize) override;
+ unsigned get_alignment() const override;
void prepare_schedule(int *matrix);
private:
- virtual int parse(ErasureCodeProfile &profile, ostream *ss);
+ int parse(ErasureCodeProfile &profile, ostream *ss) override;
};
class ErasureCodeJerasureCauchyOrig : public ErasureCodeJerasureCauchy {
ErasureCodeJerasureCauchy("cauchy_orig")
{}
- virtual void prepare();
+ void prepare() override;
};
class ErasureCodeJerasureCauchyGood : public ErasureCodeJerasureCauchy {
ErasureCodeJerasureCauchy("cauchy_good")
{}
- virtual void prepare();
+ void prepare() override;
};
class ErasureCodeJerasureLiberation : public ErasureCodeJerasure {
DEFAULT_M = "2";
DEFAULT_W = "7";
}
- virtual ~ErasureCodeJerasureLiberation();
+ ~ErasureCodeJerasureLiberation() override;
- virtual void jerasure_encode(char **data,
+ void jerasure_encode(char **data,
char **coding,
- int blocksize);
- virtual int jerasure_decode(int *erasures,
+ int blocksize) override;
+ int jerasure_decode(int *erasures,
char **data,
char **coding,
- int blocksize);
- virtual unsigned get_alignment() const;
+ int blocksize) override;
+ unsigned get_alignment() const override;
virtual bool check_k(ostream *ss) const;
virtual bool check_w(ostream *ss) const;
virtual bool check_packetsize_set(ostream *ss) const;
virtual bool check_packetsize(ostream *ss) const;
virtual int revert_to_default(ErasureCodeProfile &profile,
ostream *ss);
- virtual void prepare();
+ void prepare() override;
private:
- virtual int parse(ErasureCodeProfile &profile, ostream *ss);
+ int parse(ErasureCodeProfile &profile, ostream *ss) override;
};
class ErasureCodeJerasureBlaumRoth : public ErasureCodeJerasureLiberation {
{
}
- virtual bool check_w(ostream *ss) const;
- virtual void prepare();
+ bool check_w(ostream *ss) const override;
+ void prepare() override;
};
class ErasureCodeJerasureLiber8tion : public ErasureCodeJerasureLiberation {
DEFAULT_W = "8";
}
- virtual void prepare();
+ void prepare() override;
private:
- virtual int parse(ErasureCodeProfile &profile, ostream *ss);
+ int parse(ErasureCodeProfile &profile, ostream *ss) override;
};
#endif
class ErasureCodePluginJerasure : public ErasureCodePlugin {
public:
- virtual int factory(const std::string& directory,
+ int factory(const std::string& directory,
ErasureCodeProfile &profile,
ErasureCodeInterfaceRef *erasure_code,
- ostream *ss);
+ ostream *ss) override;
};
#endif
ruleset_steps.push_back(Step("chooseleaf", "host", 0));
}
- virtual ~ErasureCodeLrc() {}
+ ~ErasureCodeLrc() override {}
set<int> get_erasures(const set<int> &need,
const set<int> &available) const;
- virtual int minimum_to_decode(const set<int> &want_to_read,
+ int minimum_to_decode(const set<int> &want_to_read,
const set<int> &available,
- set<int> *minimum);
+ set<int> *minimum) override;
- virtual int create_ruleset(const string &name,
+ int create_ruleset(const string &name,
CrushWrapper &crush,
- ostream *ss) const;
+ ostream *ss) const override;
- virtual unsigned int get_chunk_count() const {
+ unsigned int get_chunk_count() const override {
return chunk_count;
}
- virtual unsigned int get_data_chunk_count() const {
+ unsigned int get_data_chunk_count() const override {
return data_chunk_count;
}
- virtual unsigned int get_chunk_size(unsigned int object_size) const;
+ unsigned int get_chunk_size(unsigned int object_size) const override;
- virtual int encode_chunks(const set<int> &want_to_encode,
- map<int, bufferlist> *encoded);
+ int encode_chunks(const set<int> &want_to_encode,
+ map<int, bufferlist> *encoded) override;
- virtual int decode_chunks(const set<int> &want_to_read,
+ int decode_chunks(const set<int> &want_to_read,
const map<int, bufferlist> &chunks,
- map<int, bufferlist> *decoded);
+ map<int, bufferlist> *decoded) override;
- virtual int init(ErasureCodeProfile &profile, ostream *ss);
+ int init(ErasureCodeProfile &profile, ostream *ss) override;
virtual int parse(ErasureCodeProfile &profile, ostream *ss);
class ErasureCodePluginLrc : public ErasureCodePlugin {
public:
- virtual int factory(const std::string &directory,
+ int factory(const std::string &directory,
ErasureCodeProfile &profile,
ErasureCodeInterfaceRef *erasure_code,
- ostream *ss);
+ ostream *ss) override;
};
#endif
public:
ErasureCodeShecTableCache tcache;
- virtual int factory(const std::string &directory,
+ int factory(const std::string &directory,
ErasureCodeProfile &profile,
ErasureCodeInterfaceRef *erasure_code,
- ostream *ss);
+ ostream *ss) override;
};
#endif
matrix(0)
{}
- virtual ~ErasureCodeShec() {}
+ ~ErasureCodeShec() override {}
- virtual int create_ruleset(const string &name,
+ int create_ruleset(const string &name,
CrushWrapper &crush,
- ostream *ss) const;
+ ostream *ss) const override;
- virtual unsigned int get_chunk_count() const {
+ unsigned int get_chunk_count() const override {
return k + m;
}
- virtual unsigned int get_data_chunk_count() const {
+ unsigned int get_data_chunk_count() const override {
return k;
}
- virtual unsigned int get_chunk_size(unsigned int object_size) const;
+ unsigned int get_chunk_size(unsigned int object_size) const override;
- virtual int minimum_to_decode(const set<int> &want_to_read,
+ int minimum_to_decode(const set<int> &want_to_read,
const set<int> &available_chunks,
- set<int> *minimum);
+ set<int> *minimum) override;
- virtual int minimum_to_decode_with_cost(const set<int> &want_to_read,
+ int minimum_to_decode_with_cost(const set<int> &want_to_read,
const map<int, int> &available,
- set<int> *minimum);
+ set<int> *minimum) override;
- virtual int encode(const set<int> &want_to_encode,
+ int encode(const set<int> &want_to_encode,
const bufferlist &in,
- map<int, bufferlist> *encoded);
- virtual int encode_chunks(const set<int> &want_to_encode,
- map<int, bufferlist> *encoded);
+ map<int, bufferlist> *encoded) override;
+ int encode_chunks(const set<int> &want_to_encode,
+ map<int, bufferlist> *encoded) override;
- virtual int decode(const set<int> &want_to_read,
+ int decode(const set<int> &want_to_read,
const map<int, bufferlist> &chunks,
- map<int, bufferlist> *decoded);
- virtual int decode_chunks(const set<int> &want_to_read,
+ map<int, bufferlist> *decoded) override;
+ int decode_chunks(const set<int> &want_to_read,
const map<int, bufferlist> &chunks,
- map<int, bufferlist> *decoded);
+ map<int, bufferlist> *decoded) override;
- virtual int init(ErasureCodeProfile &profile, ostream *ss);
+ int init(ErasureCodeProfile &profile, ostream *ss) override;
virtual void shec_encode(char **data,
char **coding,
int blocksize) = 0;
ErasureCodeShec(technique, _tcache)
{}
- virtual ~ErasureCodeShecReedSolomonVandermonde() {
+ ~ErasureCodeShecReedSolomonVandermonde() override {
}
- virtual void shec_encode(char **data,
+ void shec_encode(char **data,
char **coding,
- int blocksize);
- virtual int shec_decode(int *erasures,
+ int blocksize) override;
+ int shec_decode(int *erasures,
int *avails,
char **data,
char **coding,
- int blocksize);
- virtual unsigned get_alignment() const;
- virtual void prepare();
+ int blocksize) override;
+ unsigned get_alignment() const override;
+ void prepare() override;
private:
- virtual int parse(const ErasureCodeProfile &profile);
+ int parse(const ErasureCodeProfile &profile) override;
};
#endif
create("signal_handler");
}
- ~SignalHandler() {
+ ~SignalHandler() override {
shutdown();
}
T obj;
public:
ContainerContext(T &obj) : obj(obj) {}
- void finish(int r) {}
+ void finish(int r) override {}
};
template <typename T>
ContainerContext<T> *make_container_context(T &&t) {
Context *to_run;
T val;
Wrapper(Context *to_run, T val) : to_run(to_run), val(val) {}
- void finish(int r) {
+ void finish(int r) override {
if (to_run)
to_run->complete(r);
}
struct LambdaContext : public Context {
T t;
LambdaContext(T &&t) : t(std::forward<T>(t)) {}
- void finish(int) {
+ void finish(int) override {
t();
}
};
struct LambdaGenContext : GenContext<T> {
F f;
LambdaGenContext(F &&f) : f(std::forward<F>(f)) {}
- void finish(T t) {
+ void finish(T t) override {
f(std::forward<T>(t));
}
};
class C_NoopContext : public Context {
public:
- void finish(int r) { }
+ void finish(int r) override { }
};
Mutex *lock;
Context *fin;
C_Lock(Mutex *l, Context *c) : lock(l), fin(c) {}
- ~C_Lock() {
+ ~C_Lock() override {
delete fin;
}
- void finish(int r) {
+ void finish(int r) override {
if (fin) {
lock->Lock();
fin->complete(r);
void take(std::list<ContextType*>& ls) {
contexts.splice(contexts.end(), ls);
}
- void complete(int r) {
+ void complete(int r) override {
// Neuter any ContextInstanceType custom complete(), because although
// I want to look like it, I don't actually want to run its code.
Context::complete(r);
}
- void finish(int r) {
+ void finish(int r) override {
finish_contexts(cct, contexts, r);
}
bool empty() { return contexts.empty(); }
C_GatherBase *gather;
public:
C_GatherSub(C_GatherBase *g) : gather(g) {}
- void complete(int r) {
+ void complete(int r) override {
// Cancel any customized complete() functionality
// from the Context subclass we're templated for,
// we only want to hit that in onfinish, not at each
// sub finish. e.g. MDSInternalContext.
Context::complete(r);
}
- void finish(int r) {
+ void finish(int r) override {
gather->sub_finish(this, r);
gather = 0;
}
- ~C_GatherSub() {
+ ~C_GatherSub() override {
if (gather)
gather->sub_finish(this, 0);
}
{
mydout(cct,10) << "C_GatherBase " << this << ".new" << dendl;
}
- ~C_GatherBase() {
+ ~C_GatherBase() override {
mydout(cct,10) << "C_GatherBase " << this << ".delete" << dendl;
}
void set_finisher(ContextType *onfinish_) {
mydout(cct,10) << "C_GatherBase " << this << ".new_sub is " << sub_created_count << " " << s << dendl;
return s;
}
- void finish(int r) {
+ void finish(int r) override {
ceph_abort(); // nobody should ever call me.
}
{
}
- virtual void finish(int r) {
+ void finish(int r) override {
m_callback(r);
}
private:
*/
struct error : public std::exception{
- const char *what() const throw ();
+ const char *what() const throw () override;
};
struct bad_alloc : public error {
- const char *what() const throw ();
+ const char *what() const throw () override;
};
struct end_of_buffer : public error {
- const char *what() const throw ();
+ const char *what() const throw () override;
};
struct malformed_input : public error {
explicit malformed_input(const std::string& w) {
snprintf(buf, sizeof(buf), "buffer::malformed_input: %s", w.c_str());
}
- const char *what() const throw ();
+ const char *what() const throw () override;
private:
char buf[256];
};
time_t *unused;
public:
ObjectWriteOperation() : unused(NULL) {}
- ~ObjectWriteOperation() {}
+ ~ObjectWriteOperation() override {}
void mtime(time_t *pt);
void mtime2(struct timespec *pts);
{
public:
ObjectReadOperation() {}
- ~ObjectReadOperation() {}
+ ~ObjectReadOperation() override {}
void stat(uint64_t *psize, time_t *pmtime, int *prval);
void stat2(uint64_t *psize, struct timespec *pts, int *prval);
struct C_ConsistentAck : public Context {
FutureImplPtr future;
C_ConsistentAck(FutureImpl *_future) : future(_future) {}
- virtual void complete(int r) {
+ void complete(int r) override {
future->consistent(r);
future.reset();
}
- virtual void finish(int r) {}
+ void finish(int r) override {}
};
uint64_t m_tag_tid;
client_id(client_id), client(client), on_finish(on_finish) {
async_op_tracker.start_op();
}
- ~C_GetClient() {
+ ~C_GetClient() override {
async_op_tracker.finish_op();
}
async_op_tracker.start_op();
tag->data = data;
}
- ~C_AllocateTag() {
+ ~C_AllocateTag() override {
async_op_tracker.finish_op();
}
tag_tid(tag_tid), tag(tag), on_finish(on_finish) {
async_op_tracker.start_op();
}
- ~C_GetTag() {
+ ~C_GetTag() override {
async_op_tracker.finish_op();
}
tags(tags), on_finish(on_finish) {
async_op_tracker.start_op();
}
- ~C_GetTags() {
+ ~C_GetTags() override {
async_op_tracker.finish_op();
}
client_id(client_id), tag_tid(tag_tid), on_finish(on_finish) {
async_op_tracker.start_op();
}
- ~C_AssertActiveTag() {
+ ~C_AssertActiveTag() override {
async_op_tracker.finish_op();
}
JournalMetadata(ContextWQ *work_queue, SafeTimer *timer, Mutex *timer_lock,
librados::IoCtx &ioctx, const std::string &oid,
const std::string &client_id, const Settings &settings);
- ~JournalMetadata();
+ ~JournalMetadata() override;
void init(Context *on_init);
void shut_down(Context *on_finish);
C_WatchCtx(JournalMetadata *_journal_metadata)
: journal_metadata(_journal_metadata) {}
- virtual void handle_notify(uint64_t notify_id, uint64_t cookie,
- uint64_t notifier_id, bufferlist& bl) {
+ void handle_notify(uint64_t notify_id, uint64_t cookie,
+ uint64_t notifier_id, bufferlist& bl) override {
journal_metadata->handle_watch_notify(notify_id, cookie);
}
- virtual void handle_error(uint64_t cookie, int err) {
+ void handle_error(uint64_t cookie, int err) override {
journal_metadata->handle_watch_error(err);
}
};
: journal_metadata(_journal_metadata) {
journal_metadata->m_async_op_tracker.start_op();
}
- virtual ~C_WatchReset() {
+ ~C_WatchReset() override {
journal_metadata->m_async_op_tracker.finish_op();
}
- virtual void finish(int r) {
+ void finish(int r) override {
journal_metadata->handle_watch_reset();
}
};
: journal_metadata(_journal_metadata) {
journal_metadata->m_async_op_tracker.start_op();
}
- virtual ~C_CommitPositionTask() {
+ ~C_CommitPositionTask() override {
journal_metadata->m_async_op_tracker.finish_op();
}
- virtual void finish(int r) {
+ void finish(int r) override {
Mutex::Locker locker(journal_metadata->m_lock);
journal_metadata->handle_commit_position_task();
};
: journal_metadata(_journal_metadata), on_safe(_on_safe) {
journal_metadata->m_async_op_tracker.start_op();
}
- virtual ~C_AioNotify() {
+ ~C_AioNotify() override {
journal_metadata->m_async_op_tracker.finish_op();
}
- virtual void finish(int r) {
+ void finish(int r) override {
journal_metadata->handle_notified(r);
if (on_safe != nullptr) {
on_safe->complete(0);
: journal_metadata(_journal_metadata), on_safe(_on_safe) {
journal_metadata->m_async_op_tracker.start_op();
}
- virtual ~C_NotifyUpdate() {
+ ~C_NotifyUpdate() override {
journal_metadata->m_async_op_tracker.finish_op();
}
- virtual void finish(int r) {
+ void finish(int r) override {
if (r == 0) {
journal_metadata->async_notify_update(on_safe);
return;
Mutex::Locker locker(journal_metadata->m_lock);
journal_metadata->m_async_op_tracker.start_op();
}
- virtual ~C_ImmutableMetadata() {
+ ~C_ImmutableMetadata() override {
journal_metadata->m_async_op_tracker.finish_op();
}
- virtual void finish(int r) {
+ void finish(int r) override {
journal_metadata->handle_immutable_metadata(r, on_finish);
}
};
Mutex::Locker locker(journal_metadata->m_lock);
journal_metadata->m_async_op_tracker.start_op();
}
- virtual ~C_Refresh() {
+ ~C_Refresh() override {
journal_metadata->m_async_op_tracker.finish_op();
}
- virtual void finish(int r) {
+ void finish(int r) override {
journal_metadata->handle_refresh_complete(this, r);
}
};
: replay_handler(_replay_handler) {
replay_handler->get();
}
- ~C_HandleComplete() {
+ ~C_HandleComplete() override {
replay_handler->put();
}
void finish(int r) override {
: replay_handler(_replay_handler) {
replay_handler->get();
}
- ~C_HandleEntriesAvailable() {
+ ~C_HandleEntriesAvailable() override {
replay_handler->put();
}
void finish(int r) override {
C_Fetch(JournalPlayer *p, uint64_t o) : player(p), object_num(o) {
player->m_async_op_tracker.start_op();
}
- virtual ~C_Fetch() {
+ ~C_Fetch() override {
player->m_async_op_tracker.finish_op();
}
- virtual void finish(int r) {
+ void finish(int r) override {
player->handle_fetched(object_num, r);
}
};
: player(player), object_num(object_num) {
player->m_async_op_tracker.start_op();
}
- virtual ~C_Watch() {
+ ~C_Watch() override {
player->m_async_op_tracker.finish_op();
}
- virtual void finish(int r) override {
+ void finish(int r) override {
player->handle_watch(object_num, r);
}
};
Listener(JournalRecorder *_journal_recorder)
: journal_recorder(_journal_recorder) {}
- virtual void handle_update(JournalMetadata *) {
+ void handle_update(JournalMetadata *) override {
journal_recorder->handle_update();
}
};
: journal_recorder(_journal_recorder) {
}
- virtual void closed(ObjectRecorder *object_recorder) {
+ void closed(ObjectRecorder *object_recorder) override {
journal_recorder->handle_closed(object_recorder);
}
- virtual void overflow(ObjectRecorder *object_recorder) {
+ void overflow(ObjectRecorder *object_recorder) override {
journal_recorder->handle_overflow(object_recorder);
}
};
C_AdvanceObjectSet(JournalRecorder *_journal_recorder)
: journal_recorder(_journal_recorder) {
}
- virtual void finish(int r) {
+ void finish(int r) override {
journal_recorder->handle_advance_object_set(r);
}
};
MetadataListener(JournalTrimmer *journal_trimmer)
: journal_trimmer(journal_trimmer) {
}
- void handle_update(JournalMetadata *) {
+ void handle_update(JournalMetadata *) override {
journal_trimmer->handle_metadata_updated();
}
};
: journal_trimmer(_journal_trimmer) {
journal_trimmer->m_async_op_tracker.start_op();
}
- virtual ~C_CommitPositionSafe() {
+ ~C_CommitPositionSafe() override {
journal_trimmer->m_async_op_tracker.finish_op();
}
- virtual void finish(int r) {
+ void finish(int r) override {
}
};
C_InitJournaler(Journaler *_journaler, Context *_on_safe)
: journaler(_journaler), on_safe(_on_safe) {
}
- virtual void finish(int r) {
+ void finish(int r) override {
if (r == 0) {
r = journaler->init_complete();
}
ObjectPlayer(librados::IoCtx &ioctx, const std::string &object_oid_prefix,
uint64_t object_num, SafeTimer &timer, Mutex &timer_lock,
uint8_t order, uint64_t max_fetch_bytes);
- ~ObjectPlayer();
+ ~ObjectPlayer() override;
inline const std::string &get_oid() const {
return m_oid;
bufferlist read_bl;
C_Fetch(ObjectPlayer *o, Context *ctx) : object_player(o), on_finish(ctx) {
}
- virtual void finish(int r);
+ void finish(int r) override;
};
struct C_WatchTask : public Context {
ObjectPlayerPtr object_player;
C_WatchTask(ObjectPlayer *o) : object_player(o) {
}
- virtual void finish(int r);
+ void finish(int r) override;
};
struct C_WatchFetch : public Context {
ObjectPlayerPtr object_player;
C_WatchFetch(ObjectPlayer *o) : object_player(o) {
}
- virtual void finish(int r);
+ void finish(int r) override;
};
librados::IoCtx m_ioctx;
ContextWQ *work_queue, SafeTimer &timer, Mutex &timer_lock,
Handler *handler, uint8_t order, uint32_t flush_interval,
uint64_t flush_bytes, double flush_age);
- ~ObjectRecorder();
+ ~ObjectRecorder() override;
inline uint64_t get_object_number() const {
return m_object_number;
struct FlushHandler : public FutureImpl::FlushHandler {
ObjectRecorder *object_recorder;
FlushHandler(ObjectRecorder *o) : object_recorder(o) {}
- virtual void get() {
+ void get() override {
object_recorder->get();
}
- virtual void put() {
+ void put() override {
object_recorder->put();
}
- virtual void flush(const FutureImplPtr &future) {
+ void flush(const FutureImplPtr &future) override {
Mutex::Locker locker(*(object_recorder->m_lock));
object_recorder->flush(future);
}
ObjectRecorder *object_recorder;
C_AppendTask(ObjectRecorder *o) : object_recorder(o) {
}
- virtual void finish(int r) {
+ void finish(int r) override {
object_recorder->handle_append_task();
}
};
: object_recorder(o), tid(_tid) {
object_recorder->get();
}
- virtual void finish(int r) {
+ void finish(int r) override {
object_recorder->handle_append_flushed(tid, r);
object_recorder->put();
}
C_AsyncCallback(M journal_metadata, Context *on_finish)
: journal_metadata(journal_metadata), on_finish(on_finish) {
}
- virtual void finish(int r) {
+ void finish(int r) override {
journal_metadata->queue(on_finish, r);
}
};
/**
* returns 0
*/
- int nothing();
+ int nothing() override;
/**
* 10% chance of waiting wait_ms seconds
*/
- int wait();
+ int wait() override;
/**
* 10% chance of killing the client.
*/
- int suicide();
+ int suicide() override;
KvFlatBtreeAsync(int k_val, string name, int cache, double cache_r,
bool verb)
* If inject is wait and wait_time is set, wait will have a 10% chance of
* sleeping for waite_time miliseconds.
*/
- void set_inject(injection_t inject, int wait_time);
+ void set_inject(injection_t inject, int wait_time) override;
/**
* sets up the rados and io_ctx of this KvFlatBtreeAsync. If the don't already
* exist, creates the index and max object.
*/
- int setup(int argc, const char** argv);
+ int setup(int argc, const char** argv) override;
int set(const string &key, const bufferlist &val,
- bool update_on_existing);
+ bool update_on_existing) override;
- int remove(const string &key);
+ int remove(const string &key) override;
/**
* returns true if all of the following are true:
*
* @pre: no operations are in progress
*/
- bool is_consistent();
+ bool is_consistent() override;
/**
* returns an ASCII representation of the index and sub objects, showing
* stats about each object and all omaps. Don't use if you have more than
* about 10 objects.
*/
- string str();
+ string str() override;
- int get(const string &key, bufferlist *val);
+ int get(const string &key, bufferlist *val) override;
//async versions of these methods
void aio_get(const string &key, bufferlist *val, callback cb,
- void *cb_args, int * err);
+ void *cb_args, int * err) override;
void aio_set(const string &key, const bufferlist &val, bool exclusive,
- callback cb, void * cb_args, int * err);
- void aio_remove(const string &key, callback cb, void *cb_args, int * err);
+ callback cb, void * cb_args, int * err) override;
+ void aio_remove(const string &key, callback cb, void *cb_args, int * err) override;
//these methods that deal with multiple keys at once are efficient, but make
//no guarantees about atomicity!
* attempt to do this safely - make sure this is the only operation running
* when it is called!
*/
- int remove_all();
+ int remove_all() override;
/**
* This does not add prefixes to the index and therefore DOES NOT guarantee
* * The keys are distributed across the range of keys in the store
* * there is a small number of keys compared to k
*/
- int set_many(const map<string, bufferlist> &in_map);
+ int set_many(const map<string, bufferlist> &in_map) override;
- int get_all_keys(std::set<string> *keys);
- int get_all_keys_and_values(map<string,bufferlist> *kv_map);
+ int get_all_keys(std::set<string> *keys) override;
+ int get_all_keys_and_values(map<string,bufferlist> *kv_map) override;
};
public:
IteratorImpl(const std::string &prefix, WholeSpaceIterator iter) :
prefix(prefix), generic_iter(iter) { }
- virtual ~IteratorImpl() { }
+ ~IteratorImpl() override { }
- int seek_to_first() {
+ int seek_to_first() override {
return generic_iter->seek_to_first(prefix);
}
int seek_to_last() {
return generic_iter->seek_to_last(prefix);
}
- int upper_bound(const std::string &after) {
+ int upper_bound(const std::string &after) override {
return generic_iter->upper_bound(prefix, after);
}
- int lower_bound(const std::string &to) {
+ int lower_bound(const std::string &to) override {
return generic_iter->lower_bound(prefix, to);
}
- bool valid() {
+ bool valid() override {
if (!generic_iter->valid())
return false;
return generic_iter->raw_key_is_prefixed(prefix);
}
// Note that next() and prev() shouldn't validate iters,
// it's responsibility of caller to ensure they're valid.
- int next(bool validate=true) {
+ int next(bool validate=true) override {
if (validate) {
if (valid())
return generic_iter->next();
return generic_iter->prev();
}
}
- std::string key() {
+ std::string key() override {
return generic_iter->key();
}
std::pair<std::string, std::string> raw_key() {
return generic_iter->raw_key();
}
- bufferlist value() {
+ bufferlist value() override {
return generic_iter->value();
}
bufferptr value_as_ptr() {
return generic_iter->value_as_ptr();
}
- int status() {
+ int status() override {
return generic_iter->status();
}
};
explicit CephLevelDBLogger(CephContext *c) : cct(c) {
cct->get();
}
- ~CephLevelDBLogger() {
+ ~CephLevelDBLogger() override {
cct->put();
}
LevelDBStore *db;
public:
explicit CompactThread(LevelDBStore *d) : db(d) {}
- void *entry() {
+ void *entry() override {
db->compact_thread_entry();
return NULL;
}
public:
/// compact the underlying leveldb store
- void compact();
+ void compact() override;
/// compact db for all keys with a given prefix
- void compact_prefix(const string& prefix) {
+ void compact_prefix(const string& prefix) override {
compact_range(prefix, past_prefix(prefix));
}
- void compact_prefix_async(const string& prefix) {
+ void compact_prefix_async(const string& prefix) override {
compact_range_async(prefix, past_prefix(prefix));
}
void compact_range(const string& prefix,
- const string& start, const string& end) {
+ const string& start, const string& end) override {
compact_range(combine_strings(prefix, start), combine_strings(prefix, end));
}
void compact_range_async(const string& prefix,
- const string& start, const string& end) {
+ const string& start, const string& end) override {
compact_range_async(combine_strings(prefix, start),
combine_strings(prefix, end));
}
options()
{}
- ~LevelDBStore();
+ ~LevelDBStore() override;
static int _test_init(const string& dir);
- int init(string option_str="");
+ int init(string option_str="") override;
/// Opens underlying db
- int open(ostream &out) {
+ int open(ostream &out) override {
return do_open(out, false);
}
/// Creates underlying db if missing and opens it
- int create_and_open(ostream &out) {
+ int create_and_open(ostream &out) override {
return do_open(out, true);
}
- void close();
+ void close() override;
class LevelDBTransactionImpl : public KeyValueDB::TransactionImpl {
public:
void set(
const string &prefix,
const string &k,
- const bufferlist &bl);
+ const bufferlist &bl) override;
using KeyValueDB::TransactionImpl::set;
void rmkey(
const string &prefix,
- const string &k);
+ const string &k) override;
void rmkeys_by_prefix(
const string &prefix
- );
+ ) override;
using KeyValueDB::TransactionImpl::rmkey;
};
- KeyValueDB::Transaction get_transaction() {
+ KeyValueDB::Transaction get_transaction() override {
return std::make_shared<LevelDBTransactionImpl>(this);
}
- int submit_transaction(KeyValueDB::Transaction t);
- int submit_transaction_sync(KeyValueDB::Transaction t);
+ int submit_transaction(KeyValueDB::Transaction t) override;
+ int submit_transaction_sync(KeyValueDB::Transaction t) override;
int get(
const string &prefix,
const std::set<string> &key,
std::map<string, bufferlist> *out
- );
+ ) override;
int get(const string &prefix,
const string &key,
- bufferlist *value);
+ bufferlist *value) override;
using KeyValueDB::get;
public:
explicit LevelDBWholeSpaceIteratorImpl(leveldb::Iterator *iter) :
dbiter(iter) { }
- virtual ~LevelDBWholeSpaceIteratorImpl() { }
+ ~LevelDBWholeSpaceIteratorImpl() override { }
- int seek_to_first() {
+ int seek_to_first() override {
dbiter->SeekToFirst();
return dbiter->status().ok() ? 0 : -1;
}
- int seek_to_first(const string &prefix) {
+ int seek_to_first(const string &prefix) override {
leveldb::Slice slice_prefix(prefix);
dbiter->Seek(slice_prefix);
return dbiter->status().ok() ? 0 : -1;
}
- int seek_to_last() {
+ int seek_to_last() override {
dbiter->SeekToLast();
return dbiter->status().ok() ? 0 : -1;
}
- int seek_to_last(const string &prefix) {
+ int seek_to_last(const string &prefix) override {
string limit = past_prefix(prefix);
leveldb::Slice slice_limit(limit);
dbiter->Seek(slice_limit);
}
return dbiter->status().ok() ? 0 : -1;
}
- int upper_bound(const string &prefix, const string &after) {
+ int upper_bound(const string &prefix, const string &after) override {
lower_bound(prefix, after);
if (valid()) {
pair<string,string> key = raw_key();
}
return dbiter->status().ok() ? 0 : -1;
}
- int lower_bound(const string &prefix, const string &to) {
+ int lower_bound(const string &prefix, const string &to) override {
string bound = combine_strings(prefix, to);
leveldb::Slice slice_bound(bound);
dbiter->Seek(slice_bound);
return dbiter->status().ok() ? 0 : -1;
}
- bool valid() {
+ bool valid() override {
return dbiter->Valid();
}
- int next() {
+ int next() override {
if (valid())
dbiter->Next();
return dbiter->status().ok() ? 0 : -1;
}
- int prev() {
+ int prev() override {
if (valid())
dbiter->Prev();
return dbiter->status().ok() ? 0 : -1;
}
- string key() {
+ string key() override {
string out_key;
split_key(dbiter->key(), 0, &out_key);
return out_key;
}
- pair<string,string> raw_key() {
+ pair<string,string> raw_key() override {
string prefix, key;
split_key(dbiter->key(), &prefix, &key);
return make_pair(prefix, key);
}
- bool raw_key_is_prefixed(const string &prefix) {
+ bool raw_key_is_prefixed(const string &prefix) override {
leveldb::Slice key = dbiter->key();
if ((key.size() > prefix.length()) && (key[prefix.length()] == '\0')) {
return memcmp(key.data(), prefix.c_str(), prefix.length()) == 0;
return false;
}
}
- bufferlist value() {
+ bufferlist value() override {
return to_bufferlist(dbiter->value());
}
- bufferptr value_as_ptr() {
+ bufferptr value_as_ptr() override {
leveldb::Slice data = dbiter->value();
return bufferptr(data.data(), data.size());
}
- int status() {
+ int status() override {
return dbiter->status().ok() ? 0 : -1;
}
};
return limit;
}
- virtual uint64_t get_estimated_size(map<string,uint64_t> &extra) {
+ uint64_t get_estimated_size(map<string,uint64_t> &extra) override {
DIR *store_dir = opendir(path.c_str());
if (!store_dir) {
lderr(cct) << __func__ << " something happened opening the store: "
protected:
- WholeSpaceIterator _get_iterator() {
+ WholeSpaceIterator _get_iterator() override {
return std::make_shared<LevelDBWholeSpaceIteratorImpl>(
db->NewIterator(leveldb::ReadOptions()));
}
int transaction_rollback(KeyValueDB::Transaction t);
int _open(ostream &out);
- void close();
+ void close() override;
bool _get(const string &prefix, const string &k, bufferlist *out);
bool _get_locked(const string &prefix, const string &k, bufferlist *out);
std::string _get_data_fn();
//Nothing as of now
}
- ~MemDB();
- virtual int set_merge_operator(const std::string& prefix,
- std::shared_ptr<MergeOperator> mop);
+ ~MemDB() override;
+ int set_merge_operator(const std::string& prefix,
+ std::shared_ptr<MergeOperator> mop) override;
std::shared_ptr<MergeOperator> _find_merge_op(std::string prefix);
get_ops() { return ops; };
void set(const std::string &prefix, const std::string &key,
- const bufferlist &val);
+ const bufferlist &val) override;
using KeyValueDB::TransactionImpl::set;
- void rmkey(const std::string &prefix, const std::string &k);
+ void rmkey(const std::string &prefix, const std::string &k) override;
using KeyValueDB::TransactionImpl::rmkey;
- void rmkeys_by_prefix(const std::string &prefix);
+ void rmkeys_by_prefix(const std::string &prefix) override;
- void merge(const std::string &prefix, const std::string &key, const bufferlist &value);
+ void merge(const std::string &prefix, const std::string &key, const bufferlist &value) override;
void clear() {
ops.clear();
}
{
ops.clear();
}
- ~MDBTransactionImpl() {};
+ ~MDBTransactionImpl() override {};
};
private:
public:
- int init(string option_str="") { m_options = option_str; return 0; }
+ int init(string option_str="") override { m_options = option_str; return 0; }
int _init(bool format);
int do_open(ostream &out, bool create);
- int open(ostream &out) { return do_open(out, false); }
- int create_and_open(ostream &out) { return do_open(out, true); }
+ int open(ostream &out) override { return do_open(out, false); }
+ int create_and_open(ostream &out) override { return do_open(out, true); }
- KeyValueDB::Transaction get_transaction() {
+ KeyValueDB::Transaction get_transaction() override {
return std::shared_ptr<MDBTransactionImpl>(new MDBTransactionImpl(this));
}
- int submit_transaction(Transaction);
- int submit_transaction_sync(Transaction);
+ int submit_transaction(Transaction) override;
+ int submit_transaction_sync(Transaction) override;
int get(const std::string &prefix, const std::set<std::string> &key,
std::map<std::string, bufferlist> *out) override;
void free_last();
- int seek_to_first(const std::string &k);
- int seek_to_last(const std::string &k);
+ int seek_to_first(const std::string &k) override;
+ int seek_to_last(const std::string &k) override;
- int seek_to_first() { return seek_to_first(std::string()); };
- int seek_to_last() { return seek_to_last(std::string()); };
+ int seek_to_first() override { return seek_to_first(std::string()); };
+ int seek_to_last() override { return seek_to_last(std::string()); };
- int upper_bound(const std::string &prefix, const std::string &after);
- int lower_bound(const std::string &prefix, const std::string &to);
- bool valid();
+ int upper_bound(const std::string &prefix, const std::string &after) override;
+ int lower_bound(const std::string &prefix, const std::string &to) override;
+ bool valid() override;
bool iterator_validate();
- int next();
- int prev();
- int status() { return 0; };
+ int next() override;
+ int prev() override;
+ int status() override { return 0; };
- std::string key();
- std::pair<std::string,std::string> raw_key();
- bool raw_key_is_prefixed(const std::string &prefix);
- bufferlist value();
- ~MDBWholeSpaceIteratorImpl();
+ std::string key() override;
+ std::pair<std::string,std::string> raw_key() override;
+ bool raw_key_is_prefixed(const std::string &prefix) override;
+ bufferlist value() override;
+ ~MDBWholeSpaceIteratorImpl() override;
};
- uint64_t get_estimated_size(std::map<std::string,uint64_t> &extra) {
+ uint64_t get_estimated_size(std::map<std::string,uint64_t> &extra) override {
std::lock_guard<std::mutex> l(m_lock);
return m_allocated_bytes;
};
- int get_statfs(struct store_statfs_t *buf) {
+ int get_statfs(struct store_statfs_t *buf) override {
std::lock_guard<std::mutex> l(m_lock);
buf->reset();
buf->total = m_total_bytes;
protected:
- WholeSpaceIterator _get_iterator() {
+ WholeSpaceIterator _get_iterator() override {
return std::shared_ptr<KeyValueDB::WholeSpaceIteratorImpl>(
new MDBWholeSpaceIteratorImpl(&m_map, &m_lock, &iterator_seq_no, m_using_btree));
}
explicit CephRocksdbLogger(CephContext *c) : cct(c) {
cct->get();
}
- ~CephRocksdbLogger() {
+ ~CephRocksdbLogger() override {
cct->put();
}
RocksDBStore *db;
public:
explicit CompactThread(RocksDBStore *d) : db(d) {}
- void *entry() {
+ void *entry() override {
db->compact_thread_entry();
return NULL;
}
/// compact the underlying rocksdb store
bool compact_on_mount;
bool disableWAL;
- void compact();
+ void compact() override;
int tryInterpret(const string key, const string val, rocksdb::Options &opt);
int ParseOptionsFromString(const string opt_str, rocksdb::Options &opt);
static int _test_init(const string& dir);
- int init(string options_str);
+ int init(string options_str) override;
/// compact rocksdb for all keys with a given prefix
- void compact_prefix(const string& prefix) {
+ void compact_prefix(const string& prefix) override {
compact_range(prefix, past_prefix(prefix));
}
- void compact_prefix_async(const string& prefix) {
+ void compact_prefix_async(const string& prefix) override {
compact_range_async(prefix, past_prefix(prefix));
}
- void compact_range(const string& prefix, const string& start, const string& end) {
+ void compact_range(const string& prefix, const string& start, const string& end) override {
compact_range(combine_strings(prefix, start), combine_strings(prefix, end));
}
- void compact_range_async(const string& prefix, const string& start, const string& end) {
+ void compact_range_async(const string& prefix, const string& start, const string& end) override {
compact_range_async(combine_strings(prefix, start), combine_strings(prefix, end));
}
disableWAL(false)
{}
- ~RocksDBStore();
+ ~RocksDBStore() override;
static bool check_omap_dir(string &omap_dir);
/// Opens underlying db
- int open(ostream &out) {
+ int open(ostream &out) override {
return do_open(out, false);
}
/// Creates underlying db if missing and opens it
- int create_and_open(ostream &out);
+ int create_and_open(ostream &out) override;
- void close();
+ void close() override;
void split_stats(const std::string &s, char delim, std::vector<std::string> &elems);
- void get_statistics(Formatter *f);
+ void get_statistics(Formatter *f) override;
struct RocksWBHandler: public rocksdb::WriteBatch::Handler {
std::string seen ;
}
return out;
}
- virtual void Put(const rocksdb::Slice& key,
+ void Put(const rocksdb::Slice& key,
const rocksdb::Slice& value) override {
string prefix ((key.ToString()).substr(0,1));
string key_to_decode ((key.ToString()).substr(2,string::npos));
+ " Value size = " + std::to_string(size) + ")";
num_seen++;
}
- virtual void SingleDelete(const rocksdb::Slice& key) override {
+ void SingleDelete(const rocksdb::Slice& key) override {
string prefix ((key.ToString()).substr(0,1));
string key_to_decode ((key.ToString()).substr(2,string::npos));
seen += "\nSingleDelete(Prefix = "+ prefix + " Key = "
+ pretty_binary_string(key_to_decode) + ")";
num_seen++;
}
- virtual void Delete(const rocksdb::Slice& key) override {
+ void Delete(const rocksdb::Slice& key) override {
string prefix ((key.ToString()).substr(0,1));
string key_to_decode ((key.ToString()).substr(2,string::npos));
seen += "\nDelete( Prefix = " + prefix + " key = "
num_seen++;
}
- virtual void Merge(const rocksdb::Slice& key,
+ void Merge(const rocksdb::Slice& key,
const rocksdb::Slice& value) override {
string prefix ((key.ToString()).substr(0,1));
string key_to_decode ((key.ToString()).substr(2,string::npos));
num_seen++;
}
- virtual bool Continue() override { return num_seen < 50; }
+ bool Continue() override { return num_seen < 50; }
};
const bufferlist &bl) override;
};
- KeyValueDB::Transaction get_transaction() {
+ KeyValueDB::Transaction get_transaction() override {
return std::make_shared<RocksDBTransactionImpl>(this);
}
- int submit_transaction(KeyValueDB::Transaction t);
- int submit_transaction_sync(KeyValueDB::Transaction t);
+ int submit_transaction(KeyValueDB::Transaction t) override;
+ int submit_transaction_sync(KeyValueDB::Transaction t) override;
int get(
const string &prefix,
const std::set<string> &key,
explicit RocksDBWholeSpaceIteratorImpl(rocksdb::Iterator *iter) :
dbiter(iter) { }
//virtual ~RocksDBWholeSpaceIteratorImpl() { }
- ~RocksDBWholeSpaceIteratorImpl();
-
- int seek_to_first();
- int seek_to_first(const string &prefix);
- int seek_to_last();
- int seek_to_last(const string &prefix);
- int upper_bound(const string &prefix, const string &after);
- int lower_bound(const string &prefix, const string &to);
- bool valid();
- int next();
- int prev();
- string key();
- pair<string,string> raw_key();
- bool raw_key_is_prefixed(const string &prefix);
- bufferlist value();
- bufferptr value_as_ptr();
- int status();
+ ~RocksDBWholeSpaceIteratorImpl() override;
+
+ int seek_to_first() override;
+ int seek_to_first(const string &prefix) override;
+ int seek_to_last() override;
+ int seek_to_last(const string &prefix) override;
+ int upper_bound(const string &prefix, const string &after) override;
+ int lower_bound(const string &prefix, const string &to) override;
+ bool valid() override;
+ int next() override;
+ int prev() override;
+ string key() override;
+ pair<string,string> raw_key() override;
+ bool raw_key_is_prefixed(const string &prefix) override;
+ bufferlist value() override;
+ bufferptr value_as_ptr() override;
+ int status() override;
size_t key_size() override;
size_t value_size() override;
};
class MergeOperatorRouter;
friend class MergeOperatorRouter;
- virtual int set_merge_operator(const std::string& prefix,
- std::shared_ptr<KeyValueDB::MergeOperator> mop);
+ int set_merge_operator(const std::string& prefix,
+ std::shared_ptr<KeyValueDB::MergeOperator> mop) override;
string assoc_name; ///< Name of associative operator
- virtual uint64_t get_estimated_size(map<string,uint64_t> &extra) {
+ uint64_t get_estimated_size(map<string,uint64_t> &extra) override {
DIR *store_dir = opendir(path.c_str());
if (!store_dir) {
lderr(cct) << __func__ << " something happened opening the store: "
protected:
- WholeSpaceIterator _get_iterator();
+ WholeSpaceIterator _get_iterator() override;
};
bool m_inject_segv;
- void *entry();
+ void *entry() override;
void _flush(EntryQueue *q, EntryQueue *requeue, bool crash);
public:
explicit Log(SubsystemMap *s);
- virtual ~Log();
+ ~Log() override;
void set_flush_on_exit();