Skip to content
Snippets Groups Projects
Commit e0bd4bc4 authored by Eric Cano's avatar Eric Cano
Browse files

Fixed outdated strings (old class name still used).

parent aa9708fa
Branches
Tags
No related merge requests found
...@@ -86,19 +86,19 @@ BackendRados::BackendRados(log::Logger & logger, const std::string & userId, con ...@@ -86,19 +86,19 @@ BackendRados::BackendRados(log::Logger & logger, const std::string & userId, con
m_user(userId), m_pool(pool), m_namespace(radosNameSpace), m_cluster(), m_radosCtxPool() { m_user(userId), m_pool(pool), m_namespace(radosNameSpace), m_cluster(), m_radosCtxPool() {
log::LogContext lc(logger); log::LogContext lc(logger);
cta::exception::Errnum::throwOnReturnedErrnoOrThrownStdException([&]() { return -m_cluster.init(userId.c_str());}, cta::exception::Errnum::throwOnReturnedErrnoOrThrownStdException([&]() { return -m_cluster.init(userId.c_str());},
"In ObjectStoreRados::ObjectStoreRados, failed to m_cluster.init"); "In BackendRados::BackendRados, failed to m_cluster.init");
try { try {
RadosTimeoutLogger rtl; RadosTimeoutLogger rtl;
cta::exception::Errnum::throwOnReturnedErrnoOrThrownStdException([&]() { return -m_cluster.conf_read_file(NULL);}, cta::exception::Errnum::throwOnReturnedErrnoOrThrownStdException([&]() { return -m_cluster.conf_read_file(NULL);},
"In ObjectStoreRados::ObjectStoreRados, failed to m_cluster.conf_read_file"); "In BackendRados::BackendRados, failed to m_cluster.conf_read_file");
rtl.logIfNeeded("In BackendRados::BackendRados(): m_cluster.conf_read_file()", "no object"); rtl.logIfNeeded("In BackendRados::BackendRados(): m_cluster.conf_read_file()", "no object");
rtl.reset(); rtl.reset();
cta::exception::Errnum::throwOnReturnedErrnoOrThrownStdException([&](){ return -m_cluster.conf_parse_env(NULL);}, cta::exception::Errnum::throwOnReturnedErrnoOrThrownStdException([&](){ return -m_cluster.conf_parse_env(NULL);},
"In ObjectStoreRados::ObjectStoreRados, failed to m_cluster.conf_parse_env"); "In BackendRados::BackendRados, failed to m_cluster.conf_parse_env");
rtl.logIfNeeded("In BackendRados::BackendRados(): m_cluster.conf_parse_env()", "no object"); rtl.logIfNeeded("In BackendRados::BackendRados(): m_cluster.conf_parse_env()", "no object");
rtl.reset(); rtl.reset();
cta::exception::Errnum::throwOnReturnedErrnoOrThrownStdException([&]() { return -m_cluster.connect();}, cta::exception::Errnum::throwOnReturnedErrnoOrThrownStdException([&]() { return -m_cluster.connect();},
"In ObjectStoreRados::ObjectStoreRados, failed to m_cluster.connect"); "In BackendRados::BackendRados, failed to m_cluster.connect");
rtl.logIfNeeded("In BackendRados::BackendRados(): m_cluster.connect()", "no object"); rtl.logIfNeeded("In BackendRados::BackendRados(): m_cluster.connect()", "no object");
// Create the connection pool. One per CPU hardware thread. // Create the connection pool. One per CPU hardware thread.
for (size_t i=0; i<std::thread::hardware_concurrency(); i++) { for (size_t i=0; i<std::thread::hardware_concurrency(); i++) {
...@@ -108,7 +108,7 @@ m_user(userId), m_pool(pool), m_namespace(radosNameSpace), m_cluster(), m_radosC ...@@ -108,7 +108,7 @@ m_user(userId), m_pool(pool), m_namespace(radosNameSpace), m_cluster(), m_radosC
lc.log(log::DEBUG, "BackendRados::BackendRados() about to create a new context"); lc.log(log::DEBUG, "BackendRados::BackendRados() about to create a new context");
rtl.reset(); rtl.reset();
cta::exception::Errnum::throwOnReturnedErrnoOrThrownStdException([&]() {return -m_cluster.ioctx_create(pool.c_str(), m_radosCtxPool.back());}, cta::exception::Errnum::throwOnReturnedErrnoOrThrownStdException([&]() {return -m_cluster.ioctx_create(pool.c_str(), m_radosCtxPool.back());},
"In ObjectStoreRados::ObjectStoreRados, failed to m_cluster.ioctx_create"); "In BackendRados::BackendRados, failed to m_cluster.ioctx_create");
rtl.logIfNeeded("In BackendRados::BackendRados(): m_cluster.ioctx_create()", "no object"); rtl.logIfNeeded("In BackendRados::BackendRados(): m_cluster.ioctx_create()", "no object");
lc.log(log::DEBUG, "BackendRados::BackendRados() context created. About to set namespace."); lc.log(log::DEBUG, "BackendRados::BackendRados() context created. About to set namespace.");
librados::bufferlist bl; librados::bufferlist bl;
...@@ -124,7 +124,7 @@ lc.log(log::DEBUG, "BackendRados::BackendRados() namespace set. About to test ac ...@@ -124,7 +124,7 @@ lc.log(log::DEBUG, "BackendRados::BackendRados() namespace set. About to test ac
auto rc=m_radosCtxPool.back().read("TestObjectThatDoesNotNeedToExist", bl, 1, 0); auto rc=m_radosCtxPool.back().read("TestObjectThatDoesNotNeedToExist", bl, 1, 0);
rtl.logIfNeeded("In BackendRados::BackendRados(): m_radosCtxPool.back().read()", "TestObjectThatDoesNotNeedToExist"); rtl.logIfNeeded("In BackendRados::BackendRados(): m_radosCtxPool.back().read()", "TestObjectThatDoesNotNeedToExist");
return (-rc==ENOENT?0:-rc);}, return (-rc==ENOENT?0:-rc);},
"In ObjectStoreRados::ObjectStoreRados, failed to m_radosCtxPool.back().read(), and error is not ENOENT as expected"); "In BackendRados::BackendRados, failed to m_radosCtxPool.back().read(), and error is not ENOENT as expected");
} }
{ {
log::ScopedParamContainer params(lc); log::ScopedParamContainer params(lc);
...@@ -196,7 +196,7 @@ void BackendRados::create(std::string name, std::string content) { ...@@ -196,7 +196,7 @@ void BackendRados::create(std::string name, std::string content) {
int ret = -getRadosCtx().operate(name, &wop); int ret = -getRadosCtx().operate(name, &wop);
return ret; return ret;
}, },
std::string("In ObjectStoreRados::create, failed to create exclusively or write: ") std::string("In BackendRados::create, failed to create exclusively or write: ")
+ name); + name);
} catch (cta::exception::Errnum & en) { } catch (cta::exception::Errnum & en) {
if (en.errorNumber() == EEXIST) { if (en.errorNumber() == EEXIST) {
...@@ -222,7 +222,7 @@ void BackendRados::atomicOverwrite(std::string name, std::string content) { ...@@ -222,7 +222,7 @@ void BackendRados::atomicOverwrite(std::string name, std::string content) {
wop.write_full(bl); wop.write_full(bl);
RadosTimeoutLogger rtl; RadosTimeoutLogger rtl;
cta::exception::Errnum::throwOnReturnedErrnoOrThrownStdException([&]() { return -getRadosCtx().operate(name, &wop); }, cta::exception::Errnum::throwOnReturnedErrnoOrThrownStdException([&]() { return -getRadosCtx().operate(name, &wop); },
std::string("In ObjectStoreRados::atomicOverwrite, failed to assert existence or write: ") std::string("In BackendRados::atomicOverwrite, failed to assert existence or write: ")
+ name); + name);
rtl.logIfNeeded("In BackendRados::atomicOverwrite(): m_radosCtx.operate(assert_exists+write_full)", name); rtl.logIfNeeded("In BackendRados::atomicOverwrite(): m_radosCtx.operate(assert_exists+write_full)", name);
} }
...@@ -236,7 +236,7 @@ std::string BackendRados::read(std::string name) { ...@@ -236,7 +236,7 @@ std::string BackendRados::read(std::string name) {
auto rc = getRadosCtx().read(name, bl, std::numeric_limits<int32_t>::max(), 0); auto rc = getRadosCtx().read(name, bl, std::numeric_limits<int32_t>::max(), 0);
return rc<0?rc:0; return rc<0?rc:0;
}, },
std::string("In ObjectStoreRados::read, failed to read: ") std::string("In BackendRados::read, failed to read: ")
+ name); + name);
} catch (cta::exception::Errnum & e) { } catch (cta::exception::Errnum & e) {
// If the object is not present, throw a more detailed exception. // If the object is not present, throw a more detailed exception.
...@@ -441,7 +441,7 @@ std::string BackendRados::createUniqueClientId() { ...@@ -441,7 +441,7 @@ std::string BackendRados::createUniqueClientId() {
// Build a unique client name: host:thread // Build a unique client name: host:thread
char buff[200]; char buff[200];
cta::exception::Errnum::throwOnMinusOne(gethostname(buff, sizeof (buff)), cta::exception::Errnum::throwOnMinusOne(gethostname(buff, sizeof (buff)),
"In ObjectStoreRados::lockExclusive: failed to gethostname"); "In BackendRados::lockExclusive: failed to gethostname");
pid_t tid = syscall(SYS_gettid); pid_t tid = syscall(SYS_gettid);
std::stringstream client; std::stringstream client;
client << buff << ":" << tid; client << buff << ":" << tid;
...@@ -533,7 +533,7 @@ void BackendRados::lockNotify(std::string name, uint64_t timeout_us, LockType lo ...@@ -533,7 +533,7 @@ void BackendRados::lockNotify(std::string name, uint64_t timeout_us, LockType lo
} }
} }
cta::exception::Errnum::throwOnReturnedErrno(-rc, cta::exception::Errnum::throwOnReturnedErrno(-rc,
std::string("In ObjectStoreRados::lock(), failed to librados::IoCtx::") + std::string("In BackendRados::lock(), failed to librados::IoCtx::") +
(lockType==LockType::Shared?"lock_shared: ":"lock_exclusive: ") + (lockType==LockType::Shared?"lock_shared: ":"lock_exclusive: ") +
name + "/" + "lock" + "/" + clientId + "//"); name + "/" + "lock" + "/" + clientId + "//");
// We could have created an empty object by trying to lock it. We can find this out: if the object is // We could have created an empty object by trying to lock it. We can find this out: if the object is
...@@ -542,12 +542,12 @@ void BackendRados::lockNotify(std::string name, uint64_t timeout_us, LockType lo ...@@ -542,12 +542,12 @@ void BackendRados::lockNotify(std::string name, uint64_t timeout_us, LockType lo
uint64_t size; uint64_t size;
time_t date; time_t date;
cta::exception::Errnum::throwOnReturnedErrnoOrThrownStdException ([&]() { return -radosCtx.stat(name, &size, &date); }, cta::exception::Errnum::throwOnReturnedErrnoOrThrownStdException ([&]() { return -radosCtx.stat(name, &size, &date); },
std::string("In ObjectStoreRados::lock, failed to librados::IoCtx::stat: ") + std::string("In BackendRados::lock, failed to librados::IoCtx::stat: ") +
name + "/" + "lock" + "/" + clientId + "//"); name + "/" + "lock" + "/" + clientId + "//");
if (!size) { if (!size) {
// The object has a zero size: we probably created it by attempting the locking. // The object has a zero size: we probably created it by attempting the locking.
cta::exception::Errnum::throwOnReturnedErrnoOrThrownStdException ([&]() { return -radosCtx.remove(name);}, cta::exception::Errnum::throwOnReturnedErrnoOrThrownStdException ([&]() { return -radosCtx.remove(name);},
std::string("In ObjectStoreRados::lock, failed to librados::IoCtx::remove: ") + std::string("In BackendRados::lock, failed to librados::IoCtx::remove: ") +
name + "//"); name + "//");
throw Backend::NoSuchObject(std::string("In BackendRados::lockWatch(): " throw Backend::NoSuchObject(std::string("In BackendRados::lockWatch(): "
"trying to lock a non-existing object: ") + name); "trying to lock a non-existing object: ") + name);
...@@ -734,7 +734,7 @@ void BackendRados::lockBackoff(std::string name, uint64_t timeout_us, LockType l ...@@ -734,7 +734,7 @@ void BackendRados::lockBackoff(std::string name, uint64_t timeout_us, LockType l
t.reset(); t.reset();
} }
cta::exception::Errnum::throwOnReturnedErrno(-rc, cta::exception::Errnum::throwOnReturnedErrno(-rc,
std::string("In ObjectStoreRados::lock(), failed to librados::IoCtx::") + std::string("In BackendRados::lock(), failed to librados::IoCtx::") +
(lockType==LockType::Shared?"lock_shared: ":"lock_exclusive: ") + (lockType==LockType::Shared?"lock_shared: ":"lock_exclusive: ") +
name + "/" + "lock" + "/" + clientId + "//"); name + "/" + "lock" + "/" + clientId + "//");
// We could have created an empty object by trying to lock it. We can find this out: if the object is // We could have created an empty object by trying to lock it. We can find this out: if the object is
...@@ -743,12 +743,12 @@ void BackendRados::lockBackoff(std::string name, uint64_t timeout_us, LockType l ...@@ -743,12 +743,12 @@ void BackendRados::lockBackoff(std::string name, uint64_t timeout_us, LockType l
uint64_t size; uint64_t size;
time_t date; time_t date;
cta::exception::Errnum::throwOnReturnedErrnoOrThrownStdException ([&]() { return -radosCtx.stat(name, &size, &date); }, cta::exception::Errnum::throwOnReturnedErrnoOrThrownStdException ([&]() { return -radosCtx.stat(name, &size, &date); },
std::string("In ObjectStoreRados::lockBackoff, failed to librados::IoCtx::stat: ") + std::string("In BackendRados::lockBackoff, failed to librados::IoCtx::stat: ") +
name + "/" + "lock" + "/" + clientId + "//"); name + "/" + "lock" + "/" + clientId + "//");
if (!size) { if (!size) {
// The object has a zero size: we probably created it by attempting the locking. // The object has a zero size: we probably created it by attempting the locking.
cta::exception::Errnum::throwOnReturnedErrnoOrThrownStdException ([&]() { return -radosCtx.remove(name); }, cta::exception::Errnum::throwOnReturnedErrnoOrThrownStdException ([&]() { return -radosCtx.remove(name); },
std::string("In ObjectStoreRados::lockBackoff, failed to librados::IoCtx::remove: ") + std::string("In BackendRados::lockBackoff, failed to librados::IoCtx::remove: ") +
name + "//"); name + "//");
throw Backend::NoSuchObject(std::string("In BackendRados::lockBackoff(): " throw Backend::NoSuchObject(std::string("In BackendRados::lockBackoff(): "
"trying to lock a non-existing object: ") + name); "trying to lock a non-existing object: ") + name);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment