From e0bd4bc446d72a6b82995b4086cb29fa9ae740af Mon Sep 17 00:00:00 2001 From: Eric Cano <Eric.Cano@cern.ch> Date: Wed, 23 Jan 2019 16:48:53 +0100 Subject: [PATCH] Fixed outdated strings (old class name still used). --- objectstore/BackendRados.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/objectstore/BackendRados.cpp b/objectstore/BackendRados.cpp index 6c297aafea..07444dce18 100644 --- a/objectstore/BackendRados.cpp +++ b/objectstore/BackendRados.cpp @@ -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() { log::LogContext lc(logger); 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 { RadosTimeoutLogger rtl; 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.reset(); 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.reset(); 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"); // Create the connection pool. One per CPU hardware thread. 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 lc.log(log::DEBUG, "BackendRados::BackendRados() about to create a new context"); rtl.reset(); 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"); lc.log(log::DEBUG, "BackendRados::BackendRados() context created. About to set namespace."); librados::bufferlist bl; @@ -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); rtl.logIfNeeded("In BackendRados::BackendRados(): m_radosCtxPool.back().read()", "TestObjectThatDoesNotNeedToExist"); 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); @@ -196,7 +196,7 @@ void BackendRados::create(std::string name, std::string content) { int ret = -getRadosCtx().operate(name, &wop); 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); } catch (cta::exception::Errnum & en) { if (en.errorNumber() == EEXIST) { @@ -222,7 +222,7 @@ void BackendRados::atomicOverwrite(std::string name, std::string content) { wop.write_full(bl); RadosTimeoutLogger rtl; 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); rtl.logIfNeeded("In BackendRados::atomicOverwrite(): m_radosCtx.operate(assert_exists+write_full)", 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); return rc<0?rc:0; }, - std::string("In ObjectStoreRados::read, failed to read: ") + std::string("In BackendRados::read, failed to read: ") + name); } catch (cta::exception::Errnum & e) { // If the object is not present, throw a more detailed exception. @@ -441,7 +441,7 @@ std::string BackendRados::createUniqueClientId() { // Build a unique client name: host:thread char buff[200]; 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); std::stringstream client; client << buff << ":" << tid; @@ -533,7 +533,7 @@ void BackendRados::lockNotify(std::string name, uint64_t timeout_us, LockType lo } } 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: ") + name + "/" + "lock" + "/" + clientId + "//"); // 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 uint64_t size; time_t 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 + "//"); if (!size) { // The object has a zero size: we probably created it by attempting the locking. 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 + "//"); throw Backend::NoSuchObject(std::string("In BackendRados::lockWatch(): " "trying to lock a non-existing object: ") + name); @@ -734,7 +734,7 @@ void BackendRados::lockBackoff(std::string name, uint64_t timeout_us, LockType l t.reset(); } 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: ") + name + "/" + "lock" + "/" + clientId + "//"); // 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 uint64_t size; time_t 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 + "//"); if (!size) { // The object has a zero size: we probably created it by attempting the locking. 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 + "//"); throw Backend::NoSuchObject(std::string("In BackendRados::lockBackoff(): " "trying to lock a non-existing object: ") + name); -- GitLab