class CryptoNoneKeyHandler : public CryptoKeyHandler {
public:
int encrypt(const bufferlist& in,
- bufferlist& out, std::string *error) const {
+ bufferlist& out, std::string *error) const override {
out = in;
return 0;
}
int decrypt(const bufferlist& in,
- bufferlist& out, std::string *error) const {
+ bufferlist& out, std::string *error) const override {
out = in;
return 0;
}
public:
CryptoNone() { }
~CryptoNone() {}
- int get_type() const {
+ int get_type() const override {
return CEPH_CRYPTO_NONE;
}
- int create(bufferptr& secret) {
+ int create(bufferptr& secret) override {
return 0;
}
- int validate_secret(const bufferptr& secret) {
+ int validate_secret(const bufferptr& secret) override {
return 0;
}
- CryptoKeyHandler *get_key_handler(const bufferptr& secret, string& error) {
+ CryptoKeyHandler *get_key_handler(const bufferptr& secret, string& error) override {
return new CryptoNoneKeyHandler;
}
};
public:
CryptoAES() { }
~CryptoAES() {}
- int get_type() const {
+ int get_type() const override {
return CEPH_CRYPTO_AES;
}
- int create(bufferptr& secret);
- int validate_secret(const bufferptr& secret);
- CryptoKeyHandler *get_key_handler(const bufferptr& secret, string& error);
+ int create(bufferptr& secret) override;
+ int validate_secret(const bufferptr& secret) override;
+ CryptoKeyHandler *get_key_handler(const bufferptr& secret, string& error) override;
};
#ifdef USE_CRYPTOPP
}
int encrypt(const bufferlist& in,
- bufferlist& out, std::string *error) const {
+ bufferlist& out, std::string *error) const override {
return nss_aes_operation(CKA_ENCRYPT, mechanism, key, param, in, out, error);
}
int decrypt(const bufferlist& in,
- bufferlist& out, std::string *error) const {
+ bufferlist& out, std::string *error) const override {
return nss_aes_operation(CKA_DECRYPT, mechanism, key, param, in, out, error);
}
};
cfuse = cf;
client = cl;
}
- virtual ~RemountTest() {}
- virtual void *entry() {
+ ~RemountTest() {}
+ void *entry() override {
#if defined(__linux__)
int ver = get_linux_version();
assert(ver != 0);
InodeRef inode;
public:
C_Client_FlushComplete(Client *c, Inode *in) : client(c), inode(in) { }
- void finish(int r) {
+ void finish(int r) override {
assert(client->client_lock.is_locked_by_me());
if (r != 0) {
client_t const whoami = client->whoami; // For the benefit of ldout prefix
else
ino = in->vino();
}
- void finish(int r) {
+ void finish(int r) override {
// _async_invalidate takes the lock when it needs to, call this back from outside of lock.
assert(!client->client_lock.is_locked_by_me());
client->_async_invalidate(ino, offset, length);
Client *client;
public:
explicit C_Client_Remount(Client *c) : client(c) {}
- void finish(int r) {
+ void finish(int r) override {
assert (r == 0);
r = client->remount_cb(client->callback_handle);
if (r != 0) {
if (!del)
ino.ino = inodeno_t();
}
- void finish(int r) {
+ void finish(int r) override {
// _async_dentry_invalidate is responsible for its own locking
assert(!client->client_lock.is_locked_by_me());
client->_async_dentry_invalidate(dirino, ino, name);
Client *client;
public:
explicit C_C_Tick(Client *c) : client(c) {}
- void finish(int r) {
+ void finish(int r) override {
// Called back via Timer, which takes client_lock for us
assert(client->client_lock.is_locked_by_me());
client->tick();
C_Client_RequestInterrupt(Client *c, MetaRequest *r) : client(c), req(r) {
req->get();
}
- void finish(int r) {
+ void finish(int r) override {
Mutex::Locker l(client->client_lock);
assert(req->head.op == CEPH_MDS_OP_SETFILELOCK);
client->_interrupt_filelock(req);
(*ref)++;
lock.Unlock();
}
- void finish(int) {
+ void finish(int) override {
lock.Lock();
(*ref)--;
cond.Signal();
protected:
std::string scrub_tag;
public:
- int init(bufferlist::iterator& params) {
+ int init(bufferlist::iterator& params) override {
try {
InodeTagFilterArgs args;
args.decode(params);
return 0;
}
- virtual ~PGLSCephFSFilter() {}
- virtual bool reject_empty_xattr() { return false; }
- virtual bool filter(const hobject_t &obj, bufferlist& xattr_data,
- bufferlist& outdata);
+ ~PGLSCephFSFilter() {}
+ bool reject_empty_xattr() override { return false; }
+ bool filter(const hobject_t &obj, bufferlist& xattr_data,
+ bufferlist& outdata) override;
};
bool PGLSCephFSFilter::filter(const hobject_t &obj,
class PGLSHelloFilter : public PGLSFilter {
string val;
public:
- int init(bufferlist::iterator& params) {
+ int init(bufferlist::iterator& params) override {
try {
::decode(xattr, params);
::decode(val, params);
return 0;
}
- virtual ~PGLSHelloFilter() {}
- virtual bool filter(const hobject_t &obj, bufferlist& xattr_data,
- bufferlist& outdata)
+ ~PGLSHelloFilter() {}
+ bool filter(const hobject_t &obj, bufferlist& xattr_data,
+ bufferlist& outdata) override
{
if (val.size() != xattr_data.length())
return false;
rados_completion->release();
}
- virtual void complete(int r) {
+ void complete(int r) override {
if (r < 0) {
finish(r);
return;
}
}
- virtual void finish(int r) {
+ void finish(int r) override {
on_finish->complete(r);
delete this;
}
rados_completion->release();
}
- virtual void finish(int r) {
+ void finish(int r) override {
if (r == 0) {
try {
bufferlist::iterator iter = outbl.begin();
rados_completion->release();
}
- virtual void finish(int r) {
+ void finish(int r) override {
if (r == 0) {
try {
bufferlist::iterator iter = outbl.begin();
public:
LogListCtx(list<cls_log_entry> *_entries, string *_marker, bool *_truncated) :
entries(_entries), marker(_marker), truncated(_truncated) {}
- void handle_completion(int r, bufferlist& outbl) {
+ void handle_completion(int r, bufferlist& outbl) override {
if (r >= 0) {
cls_log_list_ret ret;
try {
cls_log_header *header;
public:
explicit LogInfoCtx(cls_log_header *_header) : header(_header) {}
- void handle_completion(int r, bufferlist& outbl) {
+ void handle_completion(int r, bufferlist& outbl) override {
if (r >= 0) {
cls_log_info_ret ret;
try {
public:
StateLogListCtx(list<cls_statelog_entry> *_entries, string *_marker, bool *_truncated) :
entries(_entries), marker(_marker), truncated(_truncated) {}
- void handle_completion(int r, bufferlist& outbl) {
+ void handle_completion(int r, bufferlist& outbl) override {
if (r >= 0) {
cls_statelog_list_ret ret;
try {
bool *_truncated)
: entries(_entries), marker(_marker), truncated(_truncated) {}
- void handle_completion(int r, bufferlist& outbl) {
+ void handle_completion(int r, bufferlist& outbl) override {
if (r >= 0) {
cls_timeindex_list_ret ret;
try {
public:
ClsUserListCtx(list<cls_user_bucket_entry> *_entries, string *_marker, bool *_truncated, int *_pret) :
entries(_entries), marker(_marker), truncated(_truncated), pret(_pret) {}
- void handle_completion(int r, bufferlist& outbl) {
+ void handle_completion(int r, bufferlist& outbl) override {
if (r >= 0) {
cls_user_list_buckets_ret ret;
try {
ret_ctx->put();
}
}
- void handle_completion(int r, bufferlist& outbl) {
+ void handle_completion(int r, bufferlist& outbl) override {
if (r >= 0) {
cls_user_get_header_ret ret;
try {
obj_version *objv;
public:
explicit VersionReadCtx(obj_version *_objv) : objv(_objv) {}
- void handle_completion(int r, bufferlist& outbl) {
+ void handle_completion(int r, bufferlist& outbl) override {
if (r >= 0) {
cls_version_read_ret ret;
try {
SafeTimer *parent;
public:
explicit SafeTimerThread(SafeTimer *s) : parent(s) {}
- void *entry() {
+ void *entry() override {
parent->timer_thread();
return NULL;
}
class VersionHook : public AdminSocketHook {
public:
- virtual bool call(std::string command, cmdmap_t &cmdmap, std::string format,
- bufferlist& out) {
+ bool call(std::string command, cmdmap_t &cmdmap, std::string format,
+ bufferlist& out) override {
if (command == "0") {
out.append(CEPH_ADMIN_SOCK_VERSION);
} else {
AdminSocket *m_as;
public:
explicit HelpHook(AdminSocket *as) : m_as(as) {}
- bool call(string command, cmdmap_t &cmdmap, string format, bufferlist& out) {
+ bool call(string command, cmdmap_t &cmdmap, string format, bufferlist& out) override {
Formatter *f = Formatter::create(format, "json-pretty", "json-pretty");
f->open_object_section("help");
for (map<string,string>::iterator p = m_as->m_help.begin();
AdminSocket *m_as;
public:
explicit GetdescsHook(AdminSocket *as) : m_as(as) {}
- bool call(string command, cmdmap_t &cmdmap, string format, bufferlist& out) {
+ bool call(string command, cmdmap_t &cmdmap, string format, bufferlist& out) override {
int cmdnum = 0;
JSONFormatter jf(false);
jf.open_object_section("command_descriptions");
~raw_combined() {
dec_total_alloc(len);
}
- raw* clone_empty() {
+ raw* clone_empty() override {
return create(len, alignment);
}
dec_total_alloc(len);
bdout << "raw_malloc " << this << " free " << (void *)data << " " << buffer::get_total_alloc() << bendl;
}
- raw* clone_empty() {
+ raw* clone_empty() override {
return new raw_malloc(len);
}
};
dec_total_alloc(len);
bdout << "raw_mmap " << this << " free " << (void *)data << " " << buffer::get_total_alloc() << bendl;
}
- raw* clone_empty() {
+ raw* clone_empty() override {
return new raw_mmap_pages(len);
}
};
dec_total_alloc(len);
bdout << "raw_posix_aligned " << this << " free " << (void *)data << " " << buffer::get_total_alloc() << bendl;
}
- raw* clone_empty() {
+ raw* clone_empty() override {
return new raw_posix_aligned(len, align);
}
};
<< buffer::get_total_alloc() << bendl;
}
- bool can_zero_copy() const {
+ bool can_zero_copy() const override {
return true;
}
return 0;
}
- int zero_copy_to_fd(int fd, loff_t *offset) {
+ int zero_copy_to_fd(int fd, loff_t *offset) override {
assert(!source_consumed);
int flags = SPLICE_F_NONBLOCK;
ssize_t r = safe_splice_exact(pipefds[0], NULL, fd, offset, len, flags);
return 0;
}
- buffer::raw* clone_empty() {
+ buffer::raw* clone_empty() override {
// cloning doesn't make sense for pipe-based buffers,
// and is only used by unit tests for other types of buffers
return NULL;
}
- char *get_data() {
+ char *get_data() override {
if (data)
return data;
return copy_pipe(pipefds);
dec_total_alloc(len);
bdout << "raw_char " << this << " free " << (void *)data << " " << buffer::get_total_alloc() << bendl;
}
- raw* clone_empty() {
+ raw* clone_empty() override {
return new raw_char(len);
}
};
}
raw_unshareable(unsigned l, char *b) : raw(b, l) {
}
- raw* clone_empty() {
+ raw* clone_empty() override {
return new raw_char(len);
}
- bool is_shareable() {
+ bool is_shareable() override {
return false; // !shareable, will force make_shareable()
}
~raw_unshareable() {
raw_static(const char *d, unsigned l) : raw((char*)d, l) { }
~raw_static() {}
- raw* clone_empty() {
+ raw* clone_empty() override {
return new buffer::raw_char(len);
}
};
raw_claim_buffer(const char *b, unsigned l, deleter d)
: raw((char*)b, l), del(std::move(d)) { }
~raw_claim_buffer() {}
- raw* clone_empty() {
+ raw* clone_empty() override {
return new buffer::raw_char(len);
}
};
public:
explicit LockdepObs(CephContext *cct) : m_cct(cct), m_registered(false) {
}
- virtual ~LockdepObs() {
+ ~LockdepObs() {
if (m_registered) {
lockdep_unregister_ceph_context(m_cct);
}
}
- const char** get_tracked_conf_keys() const {
+ const char** get_tracked_conf_keys() const override {
static const char *KEYS[] = {"lockdep", NULL};
return KEYS;
}
void handle_conf_change(const md_config_t *conf,
- const std::set <std::string> &changed) {
+ const std::set <std::string> &changed) override {
if (conf->lockdep && !m_registered) {
lockdep_register_ceph_context(m_cct);
m_registered = true;
}
// md_config_obs_t
- const char** get_tracked_conf_keys() const {
+ const char** get_tracked_conf_keys() const override {
static const char *KEYS[] = {
"mempool_debug",
NULL
}
void handle_conf_change(const md_config_t *conf,
- const std::set <std::string> &changed) {
+ const std::set <std::string> &changed) override {
if (changed.count("mempool_debug")) {
mempool::set_debug_mode(cct->_conf->mempool_debug);
}
// AdminSocketHook
bool call(std::string command, cmdmap_t& cmdmap, std::string format,
- bufferlist& out) {
+ bufferlist& out) override {
if (command == "dump_mempools") {
std::unique_ptr<Formatter> f(Formatter::create(format));
f->open_object_section("mempools");
~CephContextServiceThread() {}
- void *entry()
+ void *entry() override
{
while (1) {
Mutex::Locker l(_lock);
public:
explicit LogObs(ceph::logging::Log *l) : log(l) {}
- const char** get_tracked_conf_keys() const {
+ const char** get_tracked_conf_keys() const override {
static const char *KEYS[] = {
"log_file",
"log_max_new",
}
void handle_conf_change(const md_config_t *conf,
- const std::set <std::string> &changed) {
+ const std::set <std::string> &changed) override {
// stderr
if (changed.count("log_to_stderr") || changed.count("err_to_stderr")) {
int l = conf->log_to_stderr ? 99 : (conf->err_to_stderr ? -1 : -2);
public:
explicit CephContextObs(CephContext *cct) : cct(cct) {}
- const char** get_tracked_conf_keys() const {
+ const char** get_tracked_conf_keys() const override {
static const char *KEYS[] = {
"enable_experimental_unrecoverable_data_corrupting_features",
"crush_location",
}
void handle_conf_change(const md_config_t *conf,
- const std::set <std::string> &changed) {
+ const std::set <std::string> &changed) override {
if (changed.count(
"enable_experimental_unrecoverable_data_corrupting_features")) {
ceph_spin_lock(&cct->_feature_lock);
explicit CephContextHook(CephContext *cct) : m_cct(cct) {}
bool call(std::string command, cmdmap_t& cmdmap, std::string format,
- bufferlist& out) {
+ bufferlist& out) override {
m_cct->do_command(command, cmdmap, format, &out);
return true;
}
keys[1] = NULL;
}
- const char** get_tracked_conf_keys() const {
+ const char** get_tracked_conf_keys() const override {
return (const char **)keys;
}
void handle_conf_change(const struct md_config_t *conf,
- const std::set <std::string> &changed) {
+ const std::set <std::string> &changed) override {
// do nothing.
}
};
public:
CrushWalker(const CrushWrapper *crush, unsigned max_id)
: Parent(crush), max_id(max_id) {}
- void dump_item(const CrushTreeDumper::Item &qi, DumbFormatter *) {
+ void dump_item(const CrushTreeDumper::Item &qi, DumbFormatter *) override {
int type = -1;
if (qi.is_bucket()) {
if (!crush->get_item_name(qi.id)) {
}
protected:
- virtual void dump_item(const CrushTreeDumper::Item &qi, ostream *out) {
+ void dump_item(const CrushTreeDumper::Item &qi, ostream *out) override {
*out << qi.id << "\t"
<< weightf_t(qi.weight) << "\t";
}
// thread entry point
- void *entry() {
+ void *entry() override {
while (!stop) {
// build fd list
struct pollfd fds[33];
client_id(client_id), client(client), on_finish(on_finish) {
async_op_tracker.start_op();
}
- virtual ~C_GetClient() {
+ ~C_GetClient() {
async_op_tracker.finish_op();
}
complete(r);
}
- virtual void finish(int r) override {
+ void finish(int r) override {
on_finish->complete(r);
}
};
async_op_tracker.start_op();
tag->data = data;
}
- virtual ~C_AllocateTag() {
+ ~C_AllocateTag() {
async_op_tracker.finish_op();
}
complete(r);
}
- virtual void finish(int r) override {
+ void finish(int r) override {
on_finish->complete(r);
}
};
tag_tid(tag_tid), tag(tag), on_finish(on_finish) {
async_op_tracker.start_op();
}
- virtual ~C_GetTag() {
+ ~C_GetTag() {
async_op_tracker.finish_op();
}
complete(r);
}
- virtual void finish(int r) override {
+ void finish(int r) override {
on_finish->complete(r);
}
};
tags(tags), on_finish(on_finish) {
async_op_tracker.start_op();
}
- virtual ~C_GetTags() {
+ ~C_GetTags() {
async_op_tracker.finish_op();
}
complete(r);
}
- virtual void finish(int r) override {
+ void finish(int r) override {
on_finish->complete(r);
}
};
C_FlushCommitPosition(Context *commit_position_ctx, Context *on_finish)
: commit_position_ctx(commit_position_ctx), on_finish(on_finish) {
}
- virtual void finish(int r) override {
+ void finish(int r) override {
if (commit_position_ctx != nullptr) {
commit_position_ctx->complete(r);
}
client_id(client_id), tag_tid(tag_tid), on_finish(on_finish) {
async_op_tracker.start_op();
}
- virtual ~C_AssertActiveTag() {
+ ~C_AssertActiveTag() {
async_op_tracker.finish_op();
}
complete(r);
}
- virtual void finish(int r) {
+ void finish(int r) override {
on_finish->complete(r);
}
};
: replay_handler(_replay_handler) {
replay_handler->get();
}
- virtual ~C_HandleComplete() {
+ ~C_HandleComplete() {
replay_handler->put();
}
- virtual void finish(int r) {
+ void finish(int r) override {
replay_handler->handle_complete(r);
}
};
: replay_handler(_replay_handler) {
replay_handler->get();
}
- virtual ~C_HandleEntriesAvailable() {
+ ~C_HandleEntriesAvailable() {
replay_handler->put();
}
- virtual void finish(int r) {
+ void finish(int r) override {
replay_handler->handle_entries_available();
}
};
pending_flushes(_pending_flushes), ret_val(0) {
}
- virtual void complete(int r) {
+ void complete(int r) override {
if (r < 0 && ret_val == 0) {
ret_val = r;
}
delete this;
}
}
- virtual void finish(int r) {
+ void finish(int r) override {
}
};
C_RemoveSet(JournalTrimmer *_journal_trimmer, uint64_t _object_set,
uint8_t _splay_width);
- virtual void complete(int r);
- virtual void finish(int r) {
+ void complete(int r) override;
+ void finish(int r) override {
journal_trimmer->handle_set_removed(r, object_set);
journal_trimmer->m_async_op_tracker.finish_op();
}
}
// Write an entry to the log file with the specified format.
- void Logv(const char* format, va_list ap) {
+ void Logv(const char* format, va_list ap) override {
dout(1);
char buf[65536];
vsnprintf(buf, sizeof(buf), format, ap);
class RocksDBStore::MergeOperatorRouter : public rocksdb::AssociativeMergeOperator {
RocksDBStore& store;
public:
- const char *Name() const {
+ const char *Name() const override {
// Construct a name that rocksDB will validate against. We want to
// do this in a way that doesn't constrain the ordering of calls
// to set_merge_operator, so sort the merge operators and then
MergeOperatorRouter(RocksDBStore &_store) : store(_store) {}
- virtual bool Merge(const rocksdb::Slice& key,
+ bool Merge(const rocksdb::Slice& key,
const rocksdb::Slice* existing_value,
const rocksdb::Slice& value,
std::string* new_value,
- rocksdb::Logger* logger) const {
+ rocksdb::Logger* logger) const override {
// Check each prefix
for (auto& p : store.merge_ops) {
if (p.first.compare(0, p.first.length(),
}
// Write an entry to the log file with the specified format.
- void Logv(const char* format, va_list ap) {
+ void Logv(const char* format, va_list ap) override {
Logv(rocksdb::INFO_LEVEL, format, ap);
}
// of *this (see @SetInfoLogLevel and @GetInfoLogLevel) will not be
// printed.
void Logv(const rocksdb::InfoLogLevel log_level, const char* format,
- va_list ap) {
+ va_list ap) override {
int v = rocksdb::NUM_INFO_LOG_LEVELS - log_level - 1;
dout(v);
char buf[65536];
public:
explicit C_time_wakeup(AsyncConnectionRef c): conn(c) {}
- void do_request(int fd_or_id) {
+ void do_request(int fd_or_id) override {
conn->wakeup_from(fd_or_id);
}
};
public:
explicit C_handle_read(AsyncConnectionRef c): conn(c) {}
- void do_request(int fd_or_id) {
+ void do_request(int fd_or_id) override {
conn->process();
}
};
public:
explicit C_handle_write(AsyncConnectionRef c): conn(c) {}
- void do_request(int fd) {
+ void do_request(int fd) override {
conn->handle_write();
}
};
AsyncConnectionRef conn;
public:
explicit C_clean_handler(AsyncConnectionRef c): conn(c) {}
- void do_request(int id) {
+ void do_request(int id) override {
conn->cleanup();
delete this;
}
public:
explicit C_tick_wakeup(AsyncConnectionRef c): conn(c) {}
- void do_request(int fd_or_id) {
+ void do_request(int fd_or_id) override {
conn->tick(fd_or_id);
}
};
public:
explicit C_processor_accept(Processor *p): pro(p) {}
- void do_request(int id) {
+ void do_request(int id) override {
pro->accept();
}
};
public:
explicit C_handle_reap(AsyncMessenger *m): msgr(m) {}
- void do_request(int id) {
+ void do_request(int id) override {
// judge whether is a time event
msgr->reap_dead();
}
public:
C_handle_notify(EventCenter *c, CephContext *cc): center(c), cct(cc) {}
- void do_request(int fd_or_id) {
+ void do_request(int fd_or_id) override {
char c[256];
int r = 0;
do {
explicit PosixConnectedSocketImpl(NetHandler &h, const entity_addr_t &sa, int f, bool connected)
: handler(h), _fd(f), sa(sa), connected(connected) {}
- virtual int is_connected() override {
+ int is_connected() override {
if (connected)
return 1;
}
}
- virtual ssize_t zero_copy_read(bufferptr&) override {
+ ssize_t zero_copy_read(bufferptr&) override {
return -EOPNOTSUPP;
}
- virtual ssize_t read(char *buf, size_t len) override {
+ ssize_t read(char *buf, size_t len) override {
ssize_t r = ::read(_fd, buf, len);
if (r < 0)
r = -errno;
return (ssize_t)sent;
}
- virtual ssize_t send(bufferlist &bl, bool more) {
+ ssize_t send(bufferlist &bl, bool more) override {
size_t sent_bytes = 0;
std::list<bufferptr>::const_iterator pb = bl.buffers().begin();
uint64_t left_pbrs = bl.buffers().size();
return static_cast<ssize_t>(sent_bytes);
}
- virtual void shutdown() {
+ void shutdown() override {
::shutdown(_fd, SHUT_RDWR);
}
- virtual void close() {
+ void close() override {
::close(_fd);
}
- virtual int fd() const override {
+ int fd() const override {
return _fd;
}
friend class PosixServerSocketImpl;
public:
explicit PosixServerSocketImpl(NetHandler &h, int f): handler(h), _fd(f) {}
- virtual int accept(ConnectedSocket *sock, const SocketOptions &opts, entity_addr_t *out, Worker *w) override;
- virtual void abort_accept() override {
+ int accept(ConnectedSocket *sock, const SocketOptions &opts, entity_addr_t *out, Worker *w) override;
+ void abort_accept() override {
::close(_fd);
}
- virtual int fd() const override {
+ int fd() const override {
return _fd;
}
};
explicit C_drain(size_t c)
: drain_lock("C_drain::drain_lock"),
drain_count(c) {}
- void do_request(int id) {
+ void do_request(int id) override {
Mutex::Locker l(drain_lock);
drain_count--;
if (drain_count == 0) drain_cond.Signal();
~DelayedDelivery() {
discard();
}
- void *entry();
+ void *entry() override;
void queue(utime_t release, Message *m) {
Mutex::Locker l(delay_lock);
delay_queue.push_back(make_pair(release, m));
public:
explicit WholeSpaceMemIterator(KeyValueDBMemory *db) : db(db), ready(false) { }
- virtual ~WholeSpaceMemIterator() { }
+ ~WholeSpaceMemIterator() { }
- int seek_to_first() {
+ int seek_to_first() override {
if (db->db.empty()) {
it = db->db.end();
ready = false;
return 0;
}
- int seek_to_first(const string &prefix) {
+ int seek_to_first(const string &prefix) override {
it = db->db.lower_bound(make_pair(prefix, ""));
if (db->db.empty() || (it == db->db.end())) {
it = db->db.end();
return 0;
}
- int seek_to_last() {
+ int seek_to_last() override {
it = db->db.end();
if (db->db.empty()) {
ready = false;
return 0;
}
- int seek_to_last(const string &prefix) {
+ int seek_to_last(const string &prefix) override {
string tmp(prefix);
tmp.append(1, (char) 0);
it = db->db.upper_bound(make_pair(tmp,""));
return 0;
}
- int lower_bound(const string &prefix, const string &to) {
+ int lower_bound(const string &prefix, const string &to) override {
it = db->db.lower_bound(make_pair(prefix,to));
if ((db->db.empty()) || (it == db->db.end())) {
it = db->db.end();
return 0;
}
- int upper_bound(const string &prefix, const string &after) {
+ int upper_bound(const string &prefix, const string &after) override {
it = db->db.upper_bound(make_pair(prefix,after));
if ((db->db.empty()) || (it == db->db.end())) {
it = db->db.end();
return 0;
}
- bool valid() {
+ bool valid() override {
return ready && (it != db->db.end());
}
return ready && (it == db->db.begin());
}
- int prev() {
+ int prev() override {
if (!begin() && ready)
--it;
else
return 0;
}
- int next() {
+ int next() override {
if (valid())
++it;
return 0;
}
- string key() {
+ string key() override {
if (valid())
return (*it).first.second;
else
return "";
}
- pair<string,string> raw_key() {
+ pair<string,string> raw_key() override {
if (valid())
return (*it).first;
else
return make_pair("", "");
}
- bool raw_key_is_prefixed(const string &prefix) {
+ bool raw_key_is_prefixed(const string &prefix) override {
return prefix == (*it).first.first;
}
- bufferlist value() {
+ bufferlist value() override {
if (valid())
return (*it).second;
else
return bufferlist();
}
- int status() {
+ int status() override {
return 0;
}
};
boost::scoped_ptr<KeyValueDB> db;
boost::scoped_ptr<KeyValueDBMemory> mock;
- virtual void SetUp() {
+ void SetUp() override {
assert(!store_path.empty());
KeyValueDB *db_ptr = KeyValueDB::create(g_ceph_context, "leveldb", store_path);
mock.reset(new KeyValueDBMemory());
}
- virtual void TearDown() { }
+ void TearDown() override { }
::testing::AssertionResult validate_db_clear(KeyValueDB *store) {
KeyValueDB::WholeSpaceIterator it = store->get_iterator();
db->submit_transaction_sync(tx);
}
- virtual void SetUp() {
+ void SetUp() override {
IteratorTest::SetUp();
prefix1 = "_PREFIX_1_";
ASSERT_TRUE(validate_db_match());
}
- virtual void TearDown() {
+ void TearDown() override {
IteratorTest::TearDown();
}
db->submit_transaction_sync(tx);
}
- virtual void SetUp() {
+ void SetUp() override {
IteratorTest::SetUp();
prefix1 = "_PREFIX_1_";
ASSERT_TRUE(validate_db_match());
}
- virtual void TearDown() {
+ void TearDown() override {
IteratorTest::TearDown();
}
store->submit_transaction_sync(tx);
}
- virtual void SetUp() {
+ void SetUp() override {
IteratorTest::SetUp();
prefix1 = "_PREFIX_1_";
ASSERT_TRUE(validate_db_match());
}
- virtual void TearDown() {
+ void TearDown() override {
IteratorTest::TearDown();
}
store->submit_transaction_sync(tx);
}
- virtual void SetUp() {
+ void SetUp() override {
IteratorTest::SetUp();
prefix0 = "_PREFIX_0_";
ASSERT_TRUE(validate_db_match());
}
- virtual void TearDown() {
+ void TearDown() override {
IteratorTest::TearDown();
}
store->submit_transaction_sync(tx);
}
- virtual void SetUp() {
+ void SetUp() override {
IteratorTest::SetUp();
prefix1 = "_PREFIX_1_";
ASSERT_TRUE(validate_db_match());
}
- virtual void TearDown() {
+ void TearDown() override {
IteratorTest::TearDown();
}
class EmptyStore : public IteratorTest
{
public:
- virtual void SetUp() {
+ void SetUp() override {
IteratorTest::SetUp();
clear(db.get());
public:
boost::scoped_ptr< ObjectMap > db;
ObjectMapTester tester;
- virtual void SetUp() {
+ void SetUp() override {
char *path = getenv("OBJECT_MAP_PATH");
if (!path) {
db.reset(new DBObjectMap(g_ceph_context, new KeyValueDBMemory()));
tester.db = db.get();
}
- virtual void TearDown() {
+ void TearDown() override {
std::cerr << "Checking..." << std::endl;
assert(db->check(std::cerr));
}
{
}
- virtual void finish(int r)
+ void finish(int r) override
{
array_lock.Lock();
cout << "TestContext " << num << std::endl;
array_lock.Unlock();
}
- virtual ~TestContext()
+ ~TestContext()
{
}
{
}
- virtual void finish(int r)
+ void finish(int r) override
{
array_lock.Lock();
cout << "StrictOrderTestContext " << num << std::endl;
array_lock.Unlock();
}
- virtual ~StrictOrderTestContext()
+ ~StrictOrderTestContext()
{
}
};
}
class MyTest : public AdminSocketHook {
- bool call(std::string command, cmdmap_t& cmdmap, std::string format, bufferlist& result) {
+ bool call(std::string command, cmdmap_t& cmdmap, std::string format, bufferlist& result) override {
std::vector<std::string> args;
cmd_getval(g_ceph_context, cmdmap, "args", args);
result.append(command);
}
class MyTest2 : public AdminSocketHook {
- bool call(std::string command, cmdmap_t& cmdmap, std::string format, bufferlist& result) {
+ bool call(std::string command, cmdmap_t& cmdmap, std::string format, bufferlist& result) override {
std::vector<std::string> args;
cmd_getval(g_ceph_context, cmdmap, "args", args);
result.append(command);
BlockingHook() : _lock("BlockingHook::_lock") {}
- bool call(std::string command, cmdmap_t& cmdmap, std::string format, bufferlist& result) {
+ bool call(std::string command, cmdmap_t& cmdmap, std::string format, bufferlist& result) override {
Mutex::Locker l(_lock);
_cond.Wait(_lock);
return true;
explicit C_Holder(
T obj)
: obj(obj) {}
- void finish(int r) {
+ void finish(int r) override {
return;
}
};
struct Cleanup : public Context {
Bencher *bench;
explicit Cleanup(Bencher *bench) : bench(bench) {}
- void finish(int r) {
+ void finish(int r) override {
bench->complete_op();
}
};
Bencher *bench, uint64_t seq,
ceph::shared_ptr<OnDelete> on_delete
) : bench(bench), seq(seq), on_delete(on_delete) {}
- void finish(int r) {
+ void finish(int r) override {
bench->stat_collector->write_applied(seq);
}
};
Bencher *bench, uint64_t seq,
ceph::shared_ptr<OnDelete> on_delete
) : bench(bench), seq(seq), on_delete(on_delete) {}
- void finish(int r) {
+ void finish(int r) override {
bench->stat_collector->write_committed(seq);
}
};
boost::scoped_ptr<bufferlist> bl;
OnReadComplete(Bencher *bench, uint64_t seq, bufferlist *bl) :
bench(bench), seq(seq), bl(bl) {}
- void finish(int r) {
+ void finish(int r) override {
bench->stat_collector->read_complete(seq);
bench->complete_op();
}
struct MorePrinting : public DetailedStatCollector::AdditionalPrinting {
CephContext *cct;
explicit MorePrinting(CephContext *cct) : cct(cct) {}
- void operator()(std::ostream *out) {
+ void operator()(std::ostream *out) override {
bufferlist bl;
Formatter *f = Formatter::create("json-pretty");
cct->get_perfcounters_collection()->dump_formatted(f, 0);
public:
Base(DetailedStatCollector *col,
Semaphore *sem) : col(col), sem(sem) {}
- void queue(unsigned *item) {
+ void queue(unsigned *item) override {
col->read_complete(*item);
sem->Put();
delete item;
}
- void start() {}
- void stop() {}
+ void start() override {}
+ void stop() override {}
};
class WQWrapper : public Queueable {
boost::scoped_ptr<ThreadPool::WorkQueue<unsigned> > wq;
public:
WQWrapper(ThreadPool::WorkQueue<unsigned> *wq, ThreadPool *tp):
wq(wq), tp(tp) {}
- void queue(unsigned *item) { wq->queue(item); }
- void start() { tp->start(); }
- void stop() { tp->stop(); }
+ void queue(unsigned *item) override { wq->queue(item); }
+ void start() override { tp->start(); }
+ void stop() override { tp->stop(); }
};
class FinisherWrapper : public Queueable {
class CB : public Context {
unsigned *item;
public:
CB(Queueable *next, unsigned *item) : next(next), item(item) {}
- void finish(int) {
+ void finish(int) override {
next->queue(item);
}
};
public:
FinisherWrapper(CephContext *cct, Queueable *next) :
f(cct), next(next) {}
- void queue(unsigned *item) {
+ void queue(unsigned *item) override {
f.queue(new CB(next, item));
}
- void start() { f.start(); }
- void stop() { f.stop(); }
+ void start() override { f.start(); }
+ void stop() override { f.stop(); }
};
class PassAlong : public ThreadPool::WorkQueue<unsigned> {
Queueable *next;
list<unsigned*> q;
- bool _enqueue(unsigned *item) {
+ bool _enqueue(unsigned *item) override {
q.push_back(item);
return true;
}
- void _dequeue(unsigned *item) { ceph_abort(); }
- unsigned *_dequeue() {
+ void _dequeue(unsigned *item) override { ceph_abort(); }
+ unsigned *_dequeue() override {
if (q.empty())
return 0;
unsigned *val = q.front();
void _process(unsigned *item, ThreadPool::TPHandle &) override {
next->queue(item);
}
- void _clear() { q.clear(); }
- bool _empty() { return q.empty(); }
+ void _clear() override { q.clear(); }
+ bool _empty() override { return q.empty(); }
public:
PassAlong(ThreadPool *tp, Queueable *_next) :
ThreadPool::WorkQueue<unsigned>("TestQueue", 100, 100, tp), next(_next) {}
mymap[10] = "bar";
}
- void *entry() {
+ void *entry() override {
while (num-- > 0)
generic_dout(0) << "this is a typical log line. set "
<< myset << " and map " << mymap << dendl;
#ifdef CEPH_HAVE_SPLICE
class TestRawPipe : public ::testing::Test {
protected:
- virtual void SetUp() {
+ void SetUp() override {
len = 4;
::unlink(FILENAME);
snprintf(cmd, sizeof(cmd), "echo ABC > %s", FILENAME);
fd = ::open(FILENAME, O_RDONLY);
assert(fd >= 0);
}
- virtual void TearDown() {
+ void TearDown() override {
::close(fd);
::unlink(FILENAME);
}
class CryptoEnvironment: public ::testing::Environment {
public:
- void SetUp() {
+ void SetUp() override {
ceph::crypto::init(g_ceph_context);
}
};
class ForkDeathTest : public ::testing::Test {
protected:
- virtual void SetUp() {
+ void SetUp() override {
// shutdown NSS so it can be reinitialized after the fork
ceph::crypto::shutdown();
}
- virtual void TearDown() {
+ void TearDown() override {
// undo the NSS shutdown we did in the parent process, after the
// test is done
ceph::crypto::init(g_ceph_context);
ASSERT_EQ(0, destroy_one_pool_pp(pool_name, rados));
}
- virtual void SetUp() {
+ void SetUp() override {
/* Grab test names to build unique objects */
const ::testing::TestInfo* const test_info =
::testing::UnitTest::GetInstance()->current_test_info();
oid = ss_oid.str();
}
- virtual void TearDown() {
+ void TearDown() override {
}
/*
list<pair<string, utime_t> > entries;
cls_replica_log_progress_marker progress;
- void SetUp() {
+ void SetUp() override {
pool_name = get_temp_pool_name();
ASSERT_EQ("", create_one_pool_pp(pool_name, rados));
ASSERT_EQ(0, rados.ioctx_create(pool_name.c_str(), ioctx));
{
}
- virtual void *entry() {
+ void *entry() override {
usleep(5);
waited = throttle.get(count);
throttle.put(count);
class DNSResolverTest : public ::testing::Test {
protected:
- virtual void SetUp() {
+ void SetUp() override {
g_ceph_context->_conf->subsys.set_log_level(dout_subsys, TEST_DEBUG);
}
- virtual void TearDown() {
+ void TearDown() override {
DNSResolver::get_instance(nullptr);
}
};
class AsyncCompressorTest : public ::testing::Test {
public:
AsyncCompressor *async_compressor;
- virtual void SetUp() {
+ void SetUp() override {
cerr << __func__ << " start set up " << std::endl;
async_compressor = new AsyncCompressor(g_ceph_context);
async_compressor->init();
}
- virtual void TearDown() {
+ void TearDown() override {
async_compressor->terminate();
delete async_compressor;
}
enum { item_size = 100, };
vector<Item> items;
- virtual void SetUp() {
+ void SetUp() override {
for (int i = 0; i < item_size; i++) {
items.push_back(Item(i));
}
std::random_shuffle(items.begin(), items.end());
}
- virtual void TearDown() {
+ void TearDown() override {
items.clear();
}
};
value(_value),
in_method(_in_method) { }
- virtual void * entry() {
+ void * entry() override {
switch (in_method) {
case LOWER_BOUND:
ptr = cache.lower_bound(key);
{
}
- virtual void *entry() {
+ void *entry() override {
switch(in_method) {
case LOOKUP_OR_CREATE:
if (value)
int value;
};
- virtual void SetUp() {
+ void SetUp() override {
died = UNDEFINED;
}
};
}
}
- virtual void SetUp() {
+ void SetUp() override {
srand(time(0));
}
- virtual void TearDown() {
+ void TearDown() override {
}
};
explicit CompressorPluginExample(CephContext* cct) : CompressionPlugin(cct)
{}
- virtual int factory(CompressorRef *cs,
- ostream *ss)
+ int factory(CompressorRef *cs,
+ ostream *ss) override
{
if (compressor == 0) {
CompressorExample *interface = new CompressorExample();
g_ceph_context->_conf->apply_changes(NULL);
}
- void SetUp() {
+ void SetUp() override {
compressor = Compressor::create(g_ceph_context, plugin);
ASSERT_TRUE(compressor);
}
- void TearDown() {
+ void TearDown() override {
compressor.reset();
}
};
class CryptoEnvironment: public ::testing::Environment {
public:
- void SetUp() {
+ void SetUp() override {
ceph::crypto::init(g_ceph_context);
}
};
delete m_object;
}
- string decode(bufferlist bl, uint64_t seek) {
+ string decode(bufferlist bl, uint64_t seek) override {
bufferlist::iterator p = bl.begin();
p.seek(seek);
try {
return string();
}
- virtual void encode(bufferlist& out, uint64_t features) = 0;
+ void encode(bufferlist& out, uint64_t features) override = 0;
- void dump(ceph::Formatter *f) {
+ void dump(ceph::Formatter *f) override {
m_object->dump(f);
}
- void generate() {
+ void generate() override {
T::generate_test_instances(m_list);
}
- int num_generated() {
+ int num_generated() override {
return m_list.size();
}
- string select_generated(unsigned i) {
+ string select_generated(unsigned i) override {
// allow 0- or 1-based (by wrapping)
if (i == 0)
i = m_list.size();
return string();
}
- bool is_deterministic() {
+ bool is_deterministic() override {
return !nondeterministic;
}
};
public:
DencoderImplNoFeatureNoCopy(bool stray_ok, bool nondeterministic)
: DencoderBase<T>(stray_ok, nondeterministic) {}
- virtual void encode(bufferlist& out, uint64_t features) {
+ void encode(bufferlist& out, uint64_t features) override {
out.clear();
::encode(*this->m_object, out);
}
public:
DencoderImplNoFeature(bool stray_ok, bool nondeterministic)
: DencoderImplNoFeatureNoCopy<T>(stray_ok, nondeterministic) {}
- void copy() {
+ void copy() override {
T *n = new T;
*n = *this->m_object;
delete this->m_object;
this->m_object = n;
}
- void copy_ctor() {
+ void copy_ctor() override {
T *n = new T(*this->m_object);
delete this->m_object;
this->m_object = n;
public:
DencoderImplFeaturefulNoCopy(bool stray_ok, bool nondeterministic)
: DencoderBase<T>(stray_ok, nondeterministic) {}
- virtual void encode(bufferlist& out, uint64_t features) {
+ void encode(bufferlist& out, uint64_t features) override {
out.clear();
::encode(*(this->m_object), out, features);
}
public:
DencoderImplFeatureful(bool stray_ok, bool nondeterministic)
: DencoderImplFeaturefulNoCopy<T>(stray_ok, nondeterministic) {}
- void copy() {
+ void copy() override {
T *n = new T;
*n = *this->m_object;
delete this->m_object;
this->m_object = n;
}
- void copy_ctor() {
+ void copy_ctor() override {
T *n = new T(*this->m_object);
delete this->m_object;
this->m_object = n;
m_object->put();
}
- string decode(bufferlist bl, uint64_t seek) {
+ string decode(bufferlist bl, uint64_t seek) override {
bufferlist::iterator p = bl.begin();
p.seek(seek);
try {
return string();
}
- void encode(bufferlist& out, uint64_t features) {
+ void encode(bufferlist& out, uint64_t features) override {
out.clear();
encode_message(m_object, features, out);
}
- void dump(ceph::Formatter *f) {
+ void dump(ceph::Formatter *f) override {
m_object->dump(f);
}
- void generate() {
+ void generate() override {
//T::generate_test_instances(m_list);
}
- int num_generated() {
+ int num_generated() override {
return m_list.size();
}
- string select_generated(unsigned i) {
+ string select_generated(unsigned i) override {
// allow 0- or 1-based (by wrapping)
if (i == 0)
i = m_list.size();
m_object = *p;
return string();
}
- bool is_deterministic() {
+ bool is_deterministic() override {
return true;
}
class ErasureCodePluginExample : 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
{
*erasure_code = ErasureCodeInterfaceRef(new ErasureCodeExample());
(*erasure_code)->init(profile, ss);
ErasureCodeTest(unsigned int _k, unsigned int _m, unsigned int _chunk_size) :
k(_k), m(_m), chunk_size(_chunk_size) {}
- virtual ~ErasureCodeTest() {}
+ ~ErasureCodeTest() {}
- virtual int init(ErasureCodeProfile &profile, ostream *ss) {
+ int init(ErasureCodeProfile &profile, ostream *ss) override {
return 0;
}
- virtual unsigned int get_chunk_count() const { return k + m; }
- virtual unsigned int get_data_chunk_count() const { return k; }
- virtual unsigned int get_chunk_size(unsigned int object_size) const {
+ unsigned int get_chunk_count() const override { return k + m; }
+ unsigned int get_data_chunk_count() const override { return k; }
+ unsigned int get_chunk_size(unsigned int object_size) const override {
return chunk_size;
}
- 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 {
encode_chunks_encoded = *encoded;
return 0;
}
- virtual int create_ruleset(const string &name,
+ int create_ruleset(const string &name,
CrushWrapper &crush,
- ostream *ss) const { return 0; }
+ ostream *ss) const override { return 0; }
};
instance.lock.Unlock();
}
- virtual void *entry() {
+ void *entry() override {
ErasureCodeProfile profile;
ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance();
ErasureCodeInterfaceRef erasure_code;
int *result;
C_Checker(bool* _finish_called, int *r) :
finish_called(_finish_called), result(r) {}
- void finish(int r) { *finish_called = true; *result = r; }
+ void finish(int r) override { *finish_called = true; *result = r; }
};
TEST(ContextGather, Constructor) {
uint64_t refs;
uint64_t flushes;
FlushHandler() : refs(0), flushes(0) {}
- virtual void get() {
+ void get() override {
++refs;
}
- virtual void put() {
+ void put() override {
assert(refs > 0);
--refs;
}
- virtual void flush(const journal::FutureImplPtr &future) {
+ void flush(const journal::FutureImplPtr &future) override {
++flushes;
}
};
class TestJournalMetadata : public RadosTestFixture {
public:
- virtual void TearDown() {
+ void TearDown() override {
for (MetadataList::iterator it = m_metadata_list.begin();
it != m_metadata_list.end(); ++it) {
(*it)->remove_listener(&m_listener);
: lock("lock"), entries_available(false), complete(false),
complete_result(0) {}
- virtual void get() {}
- virtual void put() {}
+ void get() override {}
+ void put() override {}
- virtual void handle_entries_available() {
+ void handle_entries_available() override {
Mutex::Locker locker(lock);
entries_available = true;
cond.Signal();
}
- virtual void handle_complete(int r) {
+ void handle_complete(int r) override {
Mutex::Locker locker(lock);
complete = true;
complete_result = r;
}
};
- virtual void TearDown() {
+ void TearDown() override {
for (JournalPlayers::iterator it = m_players.begin();
it != m_players.end(); ++it) {
delete *it;
class TestJournalRecorder : public RadosTestFixture {
public:
- virtual void TearDown() {
+ void TearDown() override {
for (std::list<journal::JournalRecorder*>::iterator it = m_recorders.begin();
it != m_recorders.end(); ++it) {
delete *it;
class TestJournalTrimmer : public RadosTestFixture {
public:
- virtual void TearDown() {
+ void TearDown() override {
for (MetadataList::iterator it = m_metadata_list.begin();
it != m_metadata_list.end(); ++it) {
(*it)->remove_listener(&m_listener);
return stringify(++_journal_id);
}
- virtual void SetUp() {
+ void SetUp() override {
RadosTestFixture::SetUp();
m_journal_id = get_temp_journal_id();
m_journaler = new journal::Journaler(m_work_queue, m_timer, &m_timer_lock,
m_ioctx, m_journal_id, CLIENT_ID, {});
}
- virtual void TearDown() {
+ void TearDown() override {
delete m_journaler;
RadosTestFixture::TearDown();
}
Handler() : lock("lock") {
}
- virtual void closed(journal::ObjectRecorder *object_recorder) {
+ void closed(journal::ObjectRecorder *object_recorder) override {
Mutex::Locker locker(lock);
is_closed = true;
cond.Signal();
}
- virtual void overflow(journal::ObjectRecorder *object_recorder) {
+ void overflow(journal::ObjectRecorder *object_recorder) override {
Mutex::Locker locker(lock);
journal::AppendBuffers append_buffers;
object_lock->Lock();
double m_flush_age;
Handler m_handler;
- void TearDown() {
+ void TearDown() override {
for (ObjectRecorders::iterator it = m_object_recorders.begin();
it != m_object_recorders.end(); ++it) {
C_SaferCond cond;
public:
ClientDispatcher(uint64_t delay, ClientThread *t): Dispatcher(g_ceph_context), think_time(delay), thread(t) {}
- bool ms_can_fast_dispatch_any() const { return true; }
- bool ms_can_fast_dispatch(Message *m) const {
+ bool ms_can_fast_dispatch_any() const override { return true; }
+ bool ms_can_fast_dispatch(Message *m) const override {
switch (m->get_type()) {
case CEPH_MSG_OSD_OPREPLY:
return true;
}
}
- void ms_handle_fast_connect(Connection *con) {}
- void ms_handle_fast_accept(Connection *con) {}
- bool ms_dispatch(Message *m) { return true; }
- void ms_fast_dispatch(Message *m);
- bool ms_handle_reset(Connection *con) { return true; }
- void ms_handle_remote_reset(Connection *con) {}
- bool ms_handle_refused(Connection *con) { return false; }
+ void ms_handle_fast_connect(Connection *con) override {}
+ void ms_handle_fast_accept(Connection *con) override {}
+ bool ms_dispatch(Message *m) override { return true; }
+ void ms_fast_dispatch(Message *m) override;
+ bool ms_handle_reset(Connection *con) override { return true; }
+ void ms_handle_remote_reset(Connection *con) override {}
+ bool ms_handle_refused(Connection *con) override { return false; }
bool ms_verify_authorizer(Connection *con, int peer_type, int protocol,
bufferlist& authorizer, bufferlist& authorizer_reply,
- bool& isvalid, CryptoKey& session_key) {
+ bool& isvalid, CryptoKey& session_key) override {
isvalid = true;
return true;
}
memset(ptr.c_str(), 0, msg_len);
data.append(ptr);
}
- void *entry() {
+ void *entry() override {
lock.Lock();
for (int i = 0; i < ops; ++i) {
if (inflight > uint64_t(concurrent)) {
OpWQ(time_t timeout, time_t suicide_timeout, ThreadPool *tp)
: ThreadPool::WorkQueue<Message>("ServerDispatcher::OpWQ", timeout, suicide_timeout, tp) {}
- bool _enqueue(Message *m) {
+ bool _enqueue(Message *m) override {
messages.push_back(m);
return true;
}
- void _dequeue(Message *m) {
+ void _dequeue(Message *m) override {
ceph_abort();
}
- bool _empty() {
+ bool _empty() override {
return messages.empty();
}
- Message *_dequeue() {
+ Message *_dequeue() override {
if (messages.empty())
return NULL;
Message *m = messages.front();
m->get_connection()->send_message(reply);
m->put();
}
- void _process_finish(Message *m) { }
- void _clear() {
+ void _process_finish(Message *m) override { }
+ void _clear() override {
assert(messages.empty());
}
} op_wq;
~ServerDispatcher() {
op_tp.stop();
}
- bool ms_can_fast_dispatch_any() const { return true; }
- bool ms_can_fast_dispatch(Message *m) const {
+ bool ms_can_fast_dispatch_any() const override { return true; }
+ bool ms_can_fast_dispatch(Message *m) const override {
switch (m->get_type()) {
case CEPH_MSG_OSD_OP:
return true;
}
}
- void ms_handle_fast_connect(Connection *con) {}
- void ms_handle_fast_accept(Connection *con) {}
- bool ms_dispatch(Message *m) { return true; }
- bool ms_handle_reset(Connection *con) { return true; }
- void ms_handle_remote_reset(Connection *con) {}
- bool ms_handle_refused(Connection *con) { return false; }
- void ms_fast_dispatch(Message *m) {
+ void ms_handle_fast_connect(Connection *con) override {}
+ void ms_handle_fast_accept(Connection *con) override {}
+ bool ms_dispatch(Message *m) override { return true; }
+ bool ms_handle_reset(Connection *con) override { return true; }
+ void ms_handle_remote_reset(Connection *con) override {}
+ bool ms_handle_refused(Connection *con) override { return false; }
+ void ms_fast_dispatch(Message *m) override {
usleep(think_time);
//cerr << __func__ << " reply message=" << m << std::endl;
op_wq.queue(m);
}
bool ms_verify_authorizer(Connection *con, int peer_type, int protocol,
bufferlist& authorizer, bufferlist& authorizer_reply,
- bool& isvalid, CryptoKey& session_key) {
+ bool& isvalid, CryptoKey& session_key) override {
isvalid = true;
return true;
}
EventDriver *driver;
EventDriverTest(): driver(0) {}
- virtual void SetUp() {
+ void SetUp() override {
cerr << __func__ << " start set up " << GetParam() << std::endl;
#ifdef HAVE_EPOLL
if (strcmp(GetParam(), "epoll"))
driver = new SelectDriver(g_ceph_context);
driver->init(NULL, 100);
}
- virtual void TearDown() {
+ void TearDown() override {
delete driver;
}
};
class FakeEvent : public EventCallback {
public:
- void do_request(int fd_or_id) {}
+ void do_request(int fd_or_id) override {}
};
TEST(EventCenterTest, FileEventExpansion) {
done = true;
center.wakeup();
}
- void* entry() {
+ void* entry() override {
center.set_owner();
while (!done)
center.process_events(1000000);
public:
CountEvent(atomic_t *atomic, Mutex *l, Cond *c): count(atomic), lock(l), cond(c) {}
- void do_request(int id) {
+ void do_request(int id) override {
lock->Lock();
count->dec();
cond->Signal();
string addr, port_addr;
NetworkWorkerTest() {}
- virtual void SetUp() {
+ void SetUp() override {
cerr << __func__ << " start set up " << GetParam() << std::endl;
if (strncmp(GetParam(), "dpdk", 4)) {
g_ceph_context->_conf->set_val("ms_type", "async+posix", false, false);
stack = NetworkStack::create(g_ceph_context, GetParam());
stack->start();
}
- virtual void TearDown() {
+ void TearDown() override {
stack->stop();
}
string get_addr() const {
std::atomic_bool done;
public:
C_dispatch(Worker *w, func &&_f): worker(w), f(std::move(_f)), done(false) {}
- void do_request(int id) {
+ void do_request(int id) override {
f(worker);
done = true;
}
public:
C_poll(EventCenter *c): center(c), woken(false) {}
- void do_request(int r) {
+ void do_request(int r) override {
woken = true;
}
bool poll(int milliseconds) {
T *ctxt;
public:
C_delete(T *c): ctxt(c) {}
- void do_request(int id) {
+ void do_request(int id) override {
delete ctxt;
delete this;
}
Client *c;
public:
Client_read_handle(Client *_c): c(_c) {}
- void do_request(int id) {
+ void do_request(int id) override {
c->do_read_request();
}
} read_ctxt;
Client *c;
public:
Client_write_handle(Client *_c): c(_c) {}
- void do_request(int id) {
+ void do_request(int id) override {
c->do_write_request();
}
} write_ctxt;
Server *s;
public:
Server_read_handle(Server *_s): s(_s) {}
- void do_request(int id) {
+ void do_request(int id) override {
s->do_read_request();
}
} read_ctxt;
Server *s;
public:
Server_write_handle(Server *_s): s(_s) {}
- void do_request(int id) {
+ void do_request(int id) override {
s->do_write_request();
}
} write_ctxt;
public:
C_accept(StressFactory *f, ServerSocket s, ThreadData *data, Worker *w)
: factory(f), bind_socket(std::move(s)), t_data(data), worker(w) {}
- void do_request(int id) {
+ void do_request(int id) override {
while (true) {
entity_addr_t cli_addr;
ConnectedSocket srv_socket;
Messenger *client_msgr;
MessengerTest(): server_msgr(NULL), client_msgr(NULL) {}
- virtual void SetUp() {
+ void SetUp() override {
lderr(g_ceph_context) << __func__ << " start set up " << GetParam() << dendl;
server_msgr = Messenger::create(g_ceph_context, string(GetParam()), entity_name_t::OSD(0), "server", getpid(), 0);
client_msgr = Messenger::create(g_ceph_context, string(GetParam()), entity_name_t::CLIENT(-1), "client", getpid(), 0);
server_msgr->set_default_policy(Messenger::Policy::stateless_server(0, 0));
client_msgr->set_default_policy(Messenger::Policy::lossy_client(0, 0));
}
- virtual void TearDown() {
+ void TearDown() override {
ASSERT_EQ(server_msgr->get_dispatch_queue_len(), 0);
ASSERT_EQ(client_msgr->get_dispatch_queue_len(), 0);
delete server_msgr;
explicit FakeDispatcher(bool s): Dispatcher(g_ceph_context), lock("FakeDispatcher::lock"),
is_server(s), got_new(false), got_remote_reset(false),
got_connect(false), loopback(false) {}
- bool ms_can_fast_dispatch_any() const { return true; }
- bool ms_can_fast_dispatch(Message *m) const {
+ bool ms_can_fast_dispatch_any() const override { return true; }
+ bool ms_can_fast_dispatch(Message *m) const override {
switch (m->get_type()) {
case CEPH_MSG_PING:
return true;
}
}
- void ms_handle_fast_connect(Connection *con) {
+ void ms_handle_fast_connect(Connection *con) override {
lock.Lock();
lderr(g_ceph_context) << __func__ << " " << con << dendl;
Session *s = static_cast<Session*>(con->get_priv());
cond.Signal();
lock.Unlock();
}
- void ms_handle_fast_accept(Connection *con) {
+ void ms_handle_fast_accept(Connection *con) override {
Session *s = static_cast<Session*>(con->get_priv());
if (!s) {
s = new Session(con);
}
s->put();
}
- bool ms_dispatch(Message *m) {
+ bool ms_dispatch(Message *m) override {
Session *s = static_cast<Session*>(m->get_connection()->get_priv());
if (!s) {
s = new Session(m->get_connection());
m->put();
return true;
}
- bool ms_handle_reset(Connection *con) {
+ bool ms_handle_reset(Connection *con) override {
Mutex::Locker l(lock);
lderr(g_ceph_context) << __func__ << " " << con << dendl;
Session *s = static_cast<Session*>(con->get_priv());
}
return true;
}
- void ms_handle_remote_reset(Connection *con) {
+ void ms_handle_remote_reset(Connection *con) override {
Mutex::Locker l(lock);
lderr(g_ceph_context) << __func__ << " " << con << dendl;
Session *s = static_cast<Session*>(con->get_priv());
got_remote_reset = true;
cond.Signal();
}
- bool ms_handle_refused(Connection *con) {
+ bool ms_handle_refused(Connection *con) override {
return false;
}
- void ms_fast_dispatch(Message *m) {
+ void ms_fast_dispatch(Message *m) override {
Session *s = static_cast<Session*>(m->get_connection()->get_priv());
if (!s) {
s = new Session(m->get_connection());
bool ms_verify_authorizer(Connection *con, int peer_type, int protocol,
bufferlist& authorizer, bufferlist& authorizer_reply,
- bool& isvalid, CryptoKey& session_key) {
+ bool& isvalid, CryptoKey& session_key) override {
isvalid = true;
return true;
}
SyntheticDispatcher(bool s, SyntheticWorkload *wl):
Dispatcher(g_ceph_context), lock("SyntheticDispatcher::lock"), is_server(s), got_new(false),
got_remote_reset(false), got_connect(false), index(0), workload(wl) {}
- bool ms_can_fast_dispatch_any() const { return true; }
- bool ms_can_fast_dispatch(Message *m) const {
+ bool ms_can_fast_dispatch_any() const override { return true; }
+ bool ms_can_fast_dispatch(Message *m) const override {
switch (m->get_type()) {
case CEPH_MSG_PING:
case MSG_COMMAND:
}
}
- void ms_handle_fast_connect(Connection *con) {
+ void ms_handle_fast_connect(Connection *con) override {
Mutex::Locker l(lock);
list<uint64_t> c = conn_sent[con];
for (list<uint64_t>::iterator it = c.begin();
got_connect = true;
cond.Signal();
}
- void ms_handle_fast_accept(Connection *con) {
+ void ms_handle_fast_accept(Connection *con) override {
Mutex::Locker l(lock);
list<uint64_t> c = conn_sent[con];
for (list<uint64_t>::iterator it = c.begin();
conn_sent.erase(con);
cond.Signal();
}
- bool ms_dispatch(Message *m) {
+ bool ms_dispatch(Message *m) override {
ceph_abort();
}
- bool ms_handle_reset(Connection *con);
- void ms_handle_remote_reset(Connection *con) {
+ bool ms_handle_reset(Connection *con) override;
+ void ms_handle_remote_reset(Connection *con) override {
Mutex::Locker l(lock);
list<uint64_t> c = conn_sent[con];
for (list<uint64_t>::iterator it = c.begin();
conn_sent.erase(con);
got_remote_reset = true;
}
- bool ms_handle_refused(Connection *con) {
+ bool ms_handle_refused(Connection *con) override {
return false;
}
- void ms_fast_dispatch(Message *m) {
+ void ms_fast_dispatch(Message *m) override {
// MSG_COMMAND is used to disorganize regular message flow
if (m->get_type() == MSG_COMMAND) {
m->put();
bool ms_verify_authorizer(Connection *con, int peer_type, int protocol,
bufferlist& authorizer, bufferlist& authorizer_reply,
- bool& isvalid, CryptoKey& session_key) {
+ bool& isvalid, CryptoKey& session_key) override {
isvalid = true;
return true;
}
atomic_t count;
explicit MarkdownDispatcher(bool s): Dispatcher(g_ceph_context), lock("MarkdownDispatcher::lock"),
last_mark(false), count(0) {}
- bool ms_can_fast_dispatch_any() const { return false; }
- bool ms_can_fast_dispatch(Message *m) const {
+ bool ms_can_fast_dispatch_any() const override { return false; }
+ bool ms_can_fast_dispatch(Message *m) const override {
switch (m->get_type()) {
case CEPH_MSG_PING:
return true;
}
}
- void ms_handle_fast_connect(Connection *con) {
+ void ms_handle_fast_connect(Connection *con) override {
lderr(g_ceph_context) << __func__ << " " << con << dendl;
Mutex::Locker l(lock);
conns.insert(con);
}
- void ms_handle_fast_accept(Connection *con) {
+ void ms_handle_fast_accept(Connection *con) override {
Mutex::Locker l(lock);
conns.insert(con);
}
- bool ms_dispatch(Message *m) {
+ bool ms_dispatch(Message *m) override {
lderr(g_ceph_context) << __func__ << " conn: " << m->get_connection() << dendl;
Mutex::Locker l(lock);
count.inc();
m->put();
return true;
}
- bool ms_handle_reset(Connection *con) {
+ bool ms_handle_reset(Connection *con) override {
lderr(g_ceph_context) << __func__ << " " << con << dendl;
Mutex::Locker l(lock);
conns.erase(con);
usleep(rand() % 500);
return true;
}
- void ms_handle_remote_reset(Connection *con) {
+ void ms_handle_remote_reset(Connection *con) override {
Mutex::Locker l(lock);
conns.erase(con);
lderr(g_ceph_context) << __func__ << " " << con << dendl;
}
- bool ms_handle_refused(Connection *con) {
+ bool ms_handle_refused(Connection *con) override {
return false;
}
- void ms_fast_dispatch(Message *m) {
+ void ms_fast_dispatch(Message *m) override {
ceph_abort();
}
bool ms_verify_authorizer(Connection *con, int peer_type, int protocol,
bufferlist& authorizer, bufferlist& authorizer_reply,
- bool& isvalid, CryptoKey& session_key) {
+ bool& isvalid, CryptoKey& session_key) override {
isvalid = true;
return true;
}
class WatchNotifyTestCtx : public WatchCtx
{
public:
- void notify(uint8_t opcode, uint64_t ver, bufferlist& bl)
+ void notify(uint8_t opcode, uint64_t ver, bufferlist& bl) override
{
sem_post(&sem);
}
public:
C_NotifyCond(std::mutex *mutex, std::condition_variable *cond, bool *done)
: mutex(mutex), cond(cond), done(done) {}
- void finish(int r) {
+ void finish(int r) override {
std::lock_guard<std::mutex> lock(*mutex);
*done = true;
cond->notify_one();
CondPingPong *p;
public:
explicit Consumer(CondPingPong *p): p(p) {}
- void* entry() {
+ void* entry() override {
p->consume();
return 0;
}
done = true;
center.wakeup();
}
- void* entry() {
+ void* entry() override {
center.set_owner();
bind_thread_to_cpu(2);
while (!done)
public:
explicit CountEvent(atomic_t *atomic): count(atomic) {}
- void do_request(int id) {
+ void do_request(int id) override {
count->dec();
}
};
// Helper for spawn_thread. This is the main function that the thread executes
// (intentionally empty).
class ThreadHelper : public Thread {
- void *entry() { return 0; }
+ void *entry() override { return 0; }
};
// Measure the cost of start and joining with a thread.
class FakeContext : public Context {
public:
- virtual void finish(int r) {}
+ void finish(int r) override {}
};
// Measure the cost of starting and stopping a Dispatch::Timer.
{
}
- int run(void)
+ int run(void) override
{
int ret_val = 0;
rados_t cl;
{
}
- int run(void)
+ int run(void) override
{
int ret_val = 0;
rados_t cl;
const char *num_objects = getenv("NUM_OBJECTS");
const std::string pool = get_temp_pool_name(argv[0]);
if (num_objects) {
- g_num_objects = atoi(num_objects);
+ g_num_objects = atoi(num_objects);
if (g_num_objects == 0)
return 100;
}
rados_connect(cl);
rados_pool_delete(cl, pool.c_str());
- printf("******* SUCCESS **********\n");
+ printf("******* SUCCESS **********\n");
return EXIT_SUCCESS;
}
{
}
- int run()
+ int run() override
{
rados_t cl;
RETURN1_IF_NONZERO(rados_create(&cl, NULL));
struct Remove : public _Op {
set<string> to_remove;
explicit Remove(const set<string> &to_remove) : to_remove(to_remove) {}
- void operate(map<string, bufferlist> *store) {
+ void operate(map<string, bufferlist> *store) override {
for (set<string>::iterator i = to_remove.begin();
i != to_remove.end();
++i) {
struct Insert : public _Op {
map<string, bufferlist> to_insert;
explicit Insert(const map<string, bufferlist> &to_insert) : to_insert(to_insert) {}
- void operate(map<string, bufferlist> *store) {
+ void operate(map<string, bufferlist> *store) override {
for (map<string, bufferlist>::iterator i = to_insert.begin();
i != to_insert.end();
++i) {
struct Callback : public _Op {
Context *context;
explicit Callback(Context *c) : context(c) {}
- void operate(map<string, bufferlist> *store) {
+ void operate(map<string, bufferlist> *store) override {
context->complete(0);
}
};
list<Op> ops;
list<Op> callbacks;
public:
- void set_keys(const map<string, bufferlist> &i) {
+ void set_keys(const map<string, bufferlist> &i) override {
ops.push_back(Op(new Insert(i)));
}
- void remove_keys(const set<string> &r) {
+ void remove_keys(const set<string> &r) override {
ops.push_back(Op(new Remove(r)));
}
- void add_callback(Context *c) {
+ void add_callback(Context *c) override {
callbacks.push_back(Op(new Callback(c)));
}
};
public:
explicit Doer(PausyAsyncMap *parent) :
parent(parent), lock("Doer lock"), stopping(0), paused(false) {}
- virtual void *entry() {
+ void *entry() override {
while (1) {
list<Op> ops;
{
}
int get_keys(
const set<string> &keys,
- map<string, bufferlist> *out) {
+ map<string, bufferlist> *out) override {
Mutex::Locker l(lock);
for (set<string>::const_iterator i = keys.begin();
i != keys.end();
}
int get_next(
const string &key,
- pair<string, bufferlist> *next) {
+ pair<string, bufferlist> *next) override {
Mutex::Locker l(lock);
map<string, bufferlist>::iterator j = store.upper_bound(key);
if (j != store.end()) {
public:
OnFinish(Mutex *lock, Cond *cond, bool *done)
: lock(lock), cond(cond), done(done) {}
- void finish(int) {
+ void finish(int) override {
Mutex::Locker l(*lock);
*done = true;
cond->Signal();
cur = next.first;
}
}
- virtual void SetUp() {
+ void SetUp() override {
driver.reset(new PausyAsyncMap());
cache.reset(new MapCacher::MapCacher<string, bufferlist>(driver.get()));
names.clear();
names.insert(random_string(1 + (random_size() % 10)));
}
}
- virtual void TearDown() {
+ void TearDown() override {
driver->stop();
cache.reset();
driver.reset();
map<pg_t, ceph::shared_ptr<MapperVerifier> > mappers;
uint32_t pgnum;
- virtual void SetUp() {
+ void SetUp() override {
driver.reset(new PausyAsyncMap());
pgnum = 0;
}
- virtual void TearDown() {
+ void TearDown() override {
driver->stop();
mappers.clear();
driver.reset();
class WatchNotifyTestCtx : public WatchCtx
{
public:
- void notify(uint8_t opcode, uint64_t ver, bufferlist& bl)
+ void notify(uint8_t opcode, uint64_t ver, bufferlist& bl) override
{
sem_post(sem);
}
string pool;
explicit WatcherUnwatcher(string& _pool) : pool(_pool) {}
- void *entry() {
+ void *entry() override {
Rados cluster;
connect_cluster_pp(cluster);
while (!stop_flag.read()) {
#define dout_prefix *_dout
struct Foo : public Thread {
- void *entry() {
+ void *entry() override {
dout(0) << "foo started" << dendl;
sleep(1);
dout(0) << "foo asserting 0" << dendl;
// for filling up an ItemList
Refs refs;
- virtual void SetUp() {
+ void SetUp() override {
for (int i = 0; i < 13; i++) {
items.push_back(new Item(i));
refs.push_back(&items.back()->xitem);
}
}
- virtual void TearDown() {
+ void TearDown() override {
for (Items::iterator i = items.begin(); i != items.end(); ++i) {
delete *i;
}
(*in_progress)++;
}
- void finish(int r) {
+ void finish(int r) override {
Mutex::Locker l(*lock);
(*in_progress)--;
cond->Signal();
lookup_ghobject(const string& name, const boost::optional<std::string>& nspace, bool need_snapset = false) : _name(name),
_namespace(nspace), _need_snapset(need_snapset) { }
- virtual int call(ObjectStore *store, coll_t coll, ghobject_t &ghobj, object_info_t &oi) {
+ int call(ObjectStore *store, coll_t coll, ghobject_t &ghobj, object_info_t &oi) override {
if (_need_snapset && !ghobj.hobj.has_snapset())
return 0;
if ((_name.length() == 0 || ghobj.hobj.oid.name == _name) &&
explicit do_fix_lost(ObjectStore::Sequencer *_osr) : osr(_osr) {}
- virtual int call(ObjectStore *store, coll_t coll,
- ghobject_t &ghobj, object_info_t &oi) {
+ int call(ObjectStore *store, coll_t coll,
+ ghobject_t &ghobj, object_info_t &oi) override {
if (oi.is_lost()) {
cout << coll << "/" << ghobj << " is lost";
if (!dry_run)
string name;
public:
RadosWatchCtx(IoCtx& io, const char *imgname) : ioctx(io), name(imgname) {}
- virtual ~RadosWatchCtx() {}
+ ~RadosWatchCtx() {}
void handle_notify(uint64_t notify_id,
uint64_t cookie,
uint64_t notifier_id,
- bufferlist& bl) {
+ bufferlist& bl) override {
cout << "NOTIFY"
<< " cookie " << cookie
<< " notify_id " << notify_id
bl.hexdump(cout);
ioctx.notify_ack(name, notify_id, cookie, bl);
}
- void handle_error(uint64_t cookie, int err) {
+ void handle_error(uint64_t cookie, int err) override {
cout << "ERROR"
<< " cookie " << cookie
<< " err " << cpp_strerror(err)
OpWriteDest write_destination;
protected:
- int completions_init(int concurrentios) {
+ int completions_init(int concurrentios) override {
completions = new librados::AioCompletion *[concurrentios];
return 0;
}
- void completions_done() {
+ void completions_done() override {
delete[] completions;
completions = NULL;
}
- int create_completion(int slot, void (*cb)(void *, void*), void *arg) {
+ int create_completion(int slot, void (*cb)(void *, void*), void *arg) override {
completions[slot] = rados.aio_create_completion((void *) arg, 0, cb);
if (!completions[slot])
return 0;
}
- void release_completion(int slot) {
+ void release_completion(int slot) override {
completions[slot]->release();
completions[slot] = 0;
}
int aio_read(const std::string& oid, int slot, bufferlist *pbl, size_t len,
- size_t offset) {
+ size_t offset) override {
return io_ctx.aio_read(oid, completions[slot], pbl, len, 0);
}
int aio_write(const std::string& oid, int slot, bufferlist& bl, size_t len,
- size_t offset) {
+ size_t offset) override {
librados::ObjectWriteOperation op;
if (write_destination & OP_WRITE_DEST_OBJ) {
return io_ctx.aio_operate(oid, completions[slot], &op);
}
- int aio_remove(const std::string& oid, int slot) {
+ int aio_remove(const std::string& oid, int slot) override {
return io_ctx.aio_remove(oid, completions[slot]);
}
- int sync_read(const std::string& oid, bufferlist& bl, size_t len) {
+ int sync_read(const std::string& oid, bufferlist& bl, size_t len) override {
return io_ctx.read(oid, bl, len, 0);
}
- int sync_write(const std::string& oid, bufferlist& bl, size_t len) {
+ int sync_write(const std::string& oid, bufferlist& bl, size_t len) override {
return io_ctx.write_full(oid, bl);
}
- int sync_remove(const std::string& oid) {
+ int sync_remove(const std::string& oid) override {
return io_ctx.remove(oid);
}
- bool completion_is_done(int slot) {
+ bool completion_is_done(int slot) override {
return completions[slot]->is_safe();
}
- int completion_wait(int slot) {
+ int completion_wait(int slot) override {
return completions[slot]->wait_for_safe_and_cb();
}
- int completion_ret(int slot) {
+ int completion_ret(int slot) override {
return completions[slot]->get_return_value();
}
- bool get_objects(std::list<Object>* objects, int num) {
+ bool get_objects(std::list<Object>* objects, int num) override {
int count = 0;
if (!iterator_valid) {
return true;
}
- void set_namespace( const std::string& ns) {
+ void set_namespace( const std::string& ns) override {
io_ctx.set_namespace(ns);
}
class C_Watch : public WatchCtx {
public:
C_Watch() {}
- void notify(uint8_t opcode, uint64_t ver, bufferlist& bl) {
+ void notify(uint8_t opcode, uint64_t ver, bufferlist& bl) override {
cout << "C_Watch::notify() opcode=" << (int)opcode << " ver=" << ver << std::endl;
}
};