diff --git a/common/exception/EndOfFile.hpp b/common/exception/EndOfFile.hpp index a4e1ee23ab2dc0f5a03fc034843877837721c36d..9f0621ba553c7c70171c2f706d3885aeea223dd9 100644 --- a/common/exception/EndOfFile.hpp +++ b/common/exception/EndOfFile.hpp @@ -25,7 +25,7 @@ namespace cta::exception { class EndOfFile: public cta::exception::Exception { public: explicit EndOfFile(const std::string& w) : cta::exception::Exception(w) {} - virtual ~EndOfFile() = default; + ~EndOfFile() final = default; }; } // namespace cta::exception diff --git a/common/exception/Errnum.hpp b/common/exception/Errnum.hpp index 16bffe5b2a198cbb35f8292b69ddccd7e1d05440..768f8f075f5e7957acbfa35606a50f747684198d 100644 --- a/common/exception/Errnum.hpp +++ b/common/exception/Errnum.hpp @@ -25,7 +25,7 @@ class Errnum : public Exception { public: explicit Errnum(std::string_view what = ""); Errnum(int err, std::string_view what = ""); - virtual ~Errnum() = default; + ~Errnum() final = default; int errorNumber() const { return m_errnum; } diff --git a/common/exception/Exception.hpp b/common/exception/Exception.hpp index edaa1f844edcd1288e6366523571dc4c978f8609..10ac798c727f72636c64b74a338a1a9f639fd070 100644 --- a/common/exception/Exception.hpp +++ b/common/exception/Exception.hpp @@ -104,7 +104,7 @@ public: * * @return pointer to m_what's contents */ - virtual const char* what() const noexcept; + const char* what() const noexcept override; private: /** diff --git a/common/exception/MemException.hpp b/common/exception/MemException.hpp index fa63eb64352348daa9696a3266cb7d1d8f7da66d..96bf0195a16ddf7b473ceff09ee6ffcdbdb2d36c 100644 --- a/common/exception/MemException.hpp +++ b/common/exception/MemException.hpp @@ -27,7 +27,7 @@ namespace cta::exception { class MemException : public Exception { public: explicit MemException(const std::string& what) : Exception(what) {} - virtual ~MemException() = default; + ~MemException() final = default; }; } // namespace cta::exception diff --git a/common/exception/NoPortInRange.hpp b/common/exception/NoPortInRange.hpp index 9150ef5479d33354dc40011dab67a0448e6666ca..2a1536d32232d0904bcc85b0adb1c056a4f080be 100644 --- a/common/exception/NoPortInRange.hpp +++ b/common/exception/NoPortInRange.hpp @@ -44,7 +44,7 @@ public: * Empty Destructor, explicitely non-throwing (needed for std::exception * inheritance) */ - virtual ~NoPortInRange() = default; + ~NoPortInRange() final = default; /** * Returns the inclusive low port of the port number range. diff --git a/common/json/object/JSONCObject.hpp b/common/json/object/JSONCObject.hpp index ec504f5b2d043255e5e05c32bbd28e027c5a8464..406385d20db8e44b1d3ea19b73604adb81abed4c 100644 --- a/common/json/object/JSONCObject.hpp +++ b/common/json/object/JSONCObject.hpp @@ -40,20 +40,21 @@ public: * @param json the json to build the object from * @throws JSONObjectException if the json provided does not allow to build this object */ - virtual void buildFromJSON(const std::string & json); + void buildFromJSON(const std::string & json) override; /** * Return the inherited object expected JSON structure allowing to set its attributes * via the buildFromJSON() method * @return an example of JSON allowing to build the object e.g {"freeSpace",42} */ - virtual std::string getExpectedJSONToBuildObject() const; + std::string getExpectedJSONToBuildObject() const override; /** * Returns the json representation of the inherited object * or null if the json cannot be generated from the inherited object attributes */ - virtual std::string getJSON(); + std::string getJSON() override; virtual std::string getJSONPretty(); - virtual ~JSONCObject(); + ~JSONCObject() override; + protected: json_object * m_jsonObject = nullptr; diff --git a/common/json/test/JSONCTestObject.hpp b/common/json/test/JSONCTestObject.hpp index 833a948458d2508e3a98b5c1eae8cafbea0bee92..9b38ea6f51600ed39731bc2fee403919ce2b5ae9 100644 --- a/common/json/test/JSONCTestObject.hpp +++ b/common/json/test/JSONCTestObject.hpp @@ -33,7 +33,7 @@ public: void buildFromJSON(const std::string & json) override; std::string getExpectedJSONToBuildObject() const override; std::string getJSON() override; - virtual ~JSONCTestObject() = default; + ~JSONCTestObject() final = default; }; } diff --git a/common/log/FileLogger.hpp b/common/log/FileLogger.hpp index 3f826a25fcc5c26b7f6a5dc849bb6e3f5dcf66f3..83106c7cff66328cb6723860aea0fb6daffb4e09 100644 --- a/common/log/FileLogger.hpp +++ b/common/log/FileLogger.hpp @@ -40,7 +40,7 @@ public: /** * Destructor */ - ~FileLogger(); + ~FileLogger() final; /** * Prepares the logger object for a call to fork(). diff --git a/disk/CMakeLists.txt b/disk/CMakeLists.txt index 095f774495f5dc87a566dfbc7ca2f93f12969f57..d8dcdd13c7b1cce219c9fe6b0665d119e2f04752 100644 --- a/disk/CMakeLists.txt +++ b/disk/CMakeLists.txt @@ -15,7 +15,6 @@ cmake_minimum_required (VERSION 3.17) -find_package (librados2 REQUIRED) find_package (xrootd REQUIRED) find_package (xrootdclient REQUIRED) @@ -26,14 +25,13 @@ add_library(ctadisk SHARED DiskReporterFactory.cpp EOSReporter.cpp DiskFile.cpp - RadosStriperPool.cpp DiskSystem.cpp JSONDiskSystem.cpp JSONFreeSpace.cpp XrdClException.cpp ) -target_link_libraries (ctadisk XrdCl radosstriper) +target_link_libraries (ctadisk XrdCl) set_property(TARGET ctadisk PROPERTY SOVERSION "${CTA_SOVERSION}") set_property(TARGET ctadisk PROPERTY VERSION "${CTA_LIBVERSION}") diff --git a/disk/DiskFile.cpp b/disk/DiskFile.cpp index 5f7bd7a567e579e63b8da5027a21ce76c7007c2e..9b94977d3c7a9a9b0de80bf9482a1e906b0a444d 100644 --- a/disk/DiskFile.cpp +++ b/disk/DiskFile.cpp @@ -18,24 +18,20 @@ #include #include "disk/DiskFileImplementations.hpp" -#include "disk/RadosStriperPool.hpp" #include "common/exception/Errnum.hpp" #include "common/threading/MutexLocker.hpp" #include "common/utils/utils.hpp" -#include #include #include #include namespace cta::disk { -DiskFileFactory::DiskFileFactory(uint16_t xrootTimeout, cta::disk::RadosStriperPool& striperPool) +DiskFileFactory::DiskFileFactory(uint16_t xrootTimeout) : m_NoURLLocalFile("^(localhost:|)(/.*)$"), m_URLLocalFile("^file://(.*)$"), m_URLXrootFile("^(root://.*)$"), - m_URLCephFile("^radosstriper:///([^:]+@[^:]+):(.*)$"), - m_xrootTimeout(xrootTimeout), - m_striperPool(striperPool) {} + m_xrootTimeout(xrootTimeout) {} ReadFile* DiskFileFactory::createReadFile(const std::string& path) { std::vector regexResult; @@ -50,11 +46,6 @@ ReadFile* DiskFileFactory::createReadFile(const std::string& path) { if (regexResult.size()) { return new XrootReadFile(regexResult[1], m_xrootTimeout); } - // radosStriper URL? - regexResult = m_URLCephFile.exec(path); - if (regexResult.size()) { - return new RadosStriperReadFile(regexResult[0], m_striperPool.throwingGetStriper(regexResult[1]), regexResult[2]); - } // No URL path parsing // Do we have a local file? regexResult = m_NoURLLocalFile.exec(path); @@ -77,11 +68,6 @@ WriteFile* DiskFileFactory::createWriteFile(const std::string& path) { if (regexResult.size()) { return new XrootWriteFile(regexResult[1], m_xrootTimeout); } - // radosStriper URL? - regexResult = m_URLCephFile.exec(path); - if (regexResult.size()) { - return new RadosStriperWriteFile(regexResult[0], m_striperPool.throwingGetStriper(regexResult[1]), regexResult[2]); - } // No URL path parsing // Do we have a local file? regexResult = m_NoURLLocalFile.exec(path); @@ -139,10 +125,6 @@ void LocalWriteFile::write(const void* data, const size_t size) { ::write(m_fd, (void*) data, size); } -void LocalWriteFile::setChecksum(uint32_t checksum) { - // Noop: this is only implemented for rados striper -} - void LocalWriteFile::close() { // Multiple close protection if (m_closeTried) { @@ -219,10 +201,6 @@ void XrootBaseWriteFile::write(const void* data, const size_t size) { m_writePosition += size; } -void XrootBaseWriteFile::setChecksum(uint32_t checksum) { - // Noop: this is only implemented for rados striper -} - void XrootBaseWriteFile::close() { // Multiple close protection if (m_closeTried) { @@ -241,97 +219,6 @@ XrootBaseWriteFile::~XrootBaseWriteFile() noexcept { } } -//============================================================================== -// RADOS STRIPER READ FILE -//============================================================================== -RadosStriperReadFile::RadosStriperReadFile(const std::string& fullURL, - libradosstriper::RadosStriper* striper, - const std::string& osd) - : m_striper(striper), - m_osd(osd), - m_readPosition(0) { - m_URL = fullURL; -} - -size_t RadosStriperReadFile::read(void* data, const size_t size) const { - ::ceph::bufferlist bl; - int rc = m_striper->read(m_osd, &bl, size, m_readPosition); - if (rc < 0) { - throw cta::exception::Errnum(-rc, "In RadosStriperReadFile::read(): failed to striper->read: "); - } - bl.begin().copy(rc, (char*) data); - m_readPosition += rc; - return rc; -} - -size_t RadosStriperReadFile::size() const { - uint64_t size; - time_t time; - cta::exception::Errnum::throwOnReturnedErrno(-m_striper->stat(m_osd, &size, &time), - "In RadosStriperReadFile::size(): failed to striper->stat(): "); - return size; -} - -//============================================================================== -// RADOS STRIPER WRITE FILE -//============================================================================== -RadosStriperWriteFile::RadosStriperWriteFile(const std::string& fullURL, - libradosstriper::RadosStriper* striper, - const std::string& osd) - : m_striper(striper), - m_osd(osd), - m_writePosition(0) { - m_URL = fullURL; - // Truncate the possibly existing file. If the file does not exist, it's fine. - int rc = m_striper->trunc(m_osd, 0); - if (rc < 0 && rc != -ENOENT) { - throw cta::exception::Errnum(-rc, - "In RadosStriperWriteFile::RadosStriperWriteFile(): " - "failed to striper->trunc(): "); - } -} - -void RadosStriperWriteFile::write(const void* data, const size_t size) { - ::ceph::bufferlist bl; - bl.append((char*) data, size); - int rc = m_striper->write(m_osd, bl, size, m_writePosition); - if (rc) { - throw cta::exception::Errnum(-rc, - "In RadosStriperWriteFile::write(): " - "failed to striper->write(): "); - } - m_writePosition += size; -} - -void RadosStriperWriteFile::setChecksum(uint32_t checksum) { - // Set the checksum type (hardcoded) - int rc; - std::string checksumType("ADLER32"); - ::ceph::bufferlist blType; - blType.append(checksumType.c_str(), checksumType.size()); - rc = m_striper->setxattr(m_osd, "user.castor.checksum.type", blType); - if (rc) { - throw cta::exception::Errnum(-rc, - "In RadosStriperWriteFile::setChecksum(): " - "failed to striper->setxattr(user.castor.checksum.type): "); - } - // Turn the numeric checksum into a string and set it as checksum value - std::stringstream checksumStr; - checksumStr << std::hex << std::nouppercase << checksum; - ::ceph::bufferlist blChecksum; - blChecksum.append(checksumStr.str().c_str(), checksumStr.str().size()); - rc = m_striper->setxattr(m_osd, "user.castor.checksum.value", blChecksum); - if (rc) { - throw cta::exception::Errnum(-rc, - "In RadosStriperWriteFile::setChecksum(): " - "failed to striper->setxattr(user.castor.checksum.value): "); - } -} - -void RadosStriperWriteFile::close() { - // Nothing to do as writes are synchronous -} - //============================================================================== // AsyncDiskFileRemover FACTORY //============================================================================== diff --git a/disk/DiskFile.hpp b/disk/DiskFile.hpp index deaab1f19be55ac6dde070b082e8d5a1ee5e8222..753ad3fe24593b473771362faef4d5c7b4530d9c 100644 --- a/disk/DiskFile.hpp +++ b/disk/DiskFile.hpp @@ -32,9 +32,6 @@ namespace cta::disk { - // Forward declaration of RadosStriperPool - class RadosStriperPool; - /** * Namespace managing the reading and writing of files to and from disk. */ @@ -51,16 +48,14 @@ namespace cta::disk { class DiskFileFactory { using Regex = cta::utils::Regex; public: - DiskFileFactory(uint16_t xrootTimeout, cta::disk::RadosStriperPool& striperPool); + DiskFileFactory(uint16_t xrootTimeout); ReadFile * createReadFile(const std::string & path); WriteFile * createWriteFile(const std::string & path); private: Regex m_NoURLLocalFile; Regex m_URLLocalFile; Regex m_URLXrootFile; - Regex m_URLCephFile; const uint16_t m_xrootTimeout; - cta::disk::RadosStriperPool & m_striperPool; }; class ReadFile { @@ -105,11 +100,6 @@ namespace cta::disk { */ virtual void write(const void *data, const size_t size) = 0; - /** - * Set the checksum as an extended attribute (only needed for Ceph storage). - */ - virtual void setChecksum(uint32_t checksum) = 0; - /** * Closes the corresponding file descriptor, which may throw an exception. */ diff --git a/disk/DiskFileImplementations.hpp b/disk/DiskFileImplementations.hpp index 638782f6fbe487cb5ec38583cf0dc9b600f3dc02..ca96df295681b0f6c4e02f1b680662442e44e048 100644 --- a/disk/DiskFileImplementations.hpp +++ b/disk/DiskFileImplementations.hpp @@ -23,7 +23,6 @@ #include "common/exception/Exception.hpp" #include "XrdClException.hpp" #include -#include namespace cta::disk { /** @@ -39,9 +38,9 @@ namespace cta::disk { class LocalReadFile: public ReadFile { public: explicit LocalReadFile(const std::string& path); - virtual size_t size() const; - virtual size_t read(void *data, const size_t size) const; - virtual ~LocalReadFile() noexcept; + size_t size() const final; + size_t read(void *data, const size_t size) const final; + ~LocalReadFile() noexcept final; private: int m_fd; }; @@ -49,10 +48,9 @@ namespace cta::disk { class LocalWriteFile: public WriteFile { public: explicit LocalWriteFile(const std::string& path); - virtual void write(const void *data, const size_t size); - virtual void setChecksum(uint32_t checksum); - virtual void close(); - virtual ~LocalWriteFile() noexcept; + void write(const void *data, const size_t size) final; + void close() final; + ~LocalWriteFile() noexcept final; private: int m_fd; bool m_closeTried; @@ -64,9 +62,9 @@ namespace cta::disk { class XrootBaseReadFile: public ReadFile { public: explicit XrootBaseReadFile(uint16_t timeout) : m_timeout(timeout) {} - virtual size_t size() const; - virtual size_t read(void *data, const size_t size) const; - virtual ~XrootBaseReadFile() noexcept; + size_t size() const final; + size_t read(void *data, const size_t size) const final; + ~XrootBaseReadFile() noexcept override; protected: // Access to parent's protected member... void setURL(const std::string & v) { m_URL = v; } @@ -84,10 +82,9 @@ namespace cta::disk { class XrootBaseWriteFile: public WriteFile { public: explicit XrootBaseWriteFile(uint16_t timeout) : m_writePosition(0), m_timeout(timeout), m_closeTried(false) {} - virtual void write(const void *data, const size_t size); - virtual void setChecksum(uint32_t checksum); - virtual void close(); - virtual ~XrootBaseWriteFile() noexcept; + void write(const void *data, const size_t size) final; + void close() final; + ~XrootBaseWriteFile() noexcept override; protected: // Access to parent's protected member... void setURL(const std::string & v) { m_URL = v; } @@ -102,41 +99,6 @@ namespace cta::disk { XrootWriteFile(const std::string &xrootUrl, uint16_t timeout = 0); }; - //============================================================================== - // RADOS STRIPER FILES - //============================================================================== - // The Rados striper URLs in CASTOR are in the form: - // radosstriper:///user@pool:filePath - // We will not expect the - class RadosStriperReadFile: public ReadFile { - public: - RadosStriperReadFile(const std::string &fullURL, - libradosstriper::RadosStriper * striper, - const std::string &osd); - virtual size_t size() const; - virtual size_t read(void *data, const size_t size) const; - ~RadosStriperReadFile() final = default; - private: - libradosstriper::RadosStriper * m_striper; - std::string m_osd; - mutable size_t m_readPosition; - }; - - class RadosStriperWriteFile: public WriteFile { - public: - RadosStriperWriteFile(const std::string &fullURL, - libradosstriper::RadosStriper * striper, - const std::string &osd); - virtual void write(const void *data, const size_t size); - virtual void setChecksum(uint32_t checksum); - virtual void close(); - ~RadosStriperWriteFile() final = default; - private: - libradosstriper::RadosStriper * m_striper; - std::string m_osd; - size_t m_writePosition; - }; - //============================================================================== // LocalDisk Removers //============================================================================== diff --git a/disk/JSONDiskSystem.hpp b/disk/JSONDiskSystem.hpp index d2340000557004007888dfa05e85ff05eecdee44..d9b6331c611114cbc4854303557f0a539ffe0c20 100644 --- a/disk/JSONDiskSystem.hpp +++ b/disk/JSONDiskSystem.hpp @@ -40,7 +40,7 @@ public: * Get the json string representation of the inherited DiskSystem object */ std::string getJSON() override; - virtual ~JSONDiskSystem() = default; + ~JSONDiskSystem() final = default; }; } // namespace cta::disk diff --git a/disk/RadosStriperPool.cpp b/disk/RadosStriperPool.cpp deleted file mode 100644 index 9e255151195c2ba4fc63d9ec9f900f9d25cbde6c..0000000000000000000000000000000000000000 --- a/disk/RadosStriperPool.cpp +++ /dev/null @@ -1,156 +0,0 @@ -/* - * @project The CERN Tape Archive (CTA) - * @copyright Copyright © 2021-2022 CERN - * @license This program is free software, distributed under the terms of the GNU General Public - * Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". You can - * redistribute it and/or modify it under the terms of the GPL Version 3, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * In applying this licence, CERN does not waive the privileges and immunities - * granted to it by virtue of its status as an Intergovernmental Organization or - * submit itself to any jurisdiction. - */ - -#include "RadosStriperPool.hpp" -#include "common/exception/Errnum.hpp" -#include "common/threading/MutexLocker.hpp" - -#include - -namespace { -//------------------------------------------------------------------------------ -// RAII decorator for librados::Rados for local usage -//------------------------------------------------------------------------------ -class ReleasingRados: public librados::Rados { -public: - ReleasingRados(): m_released(false) {}; - void release() { m_released = true; } - ~ReleasingRados() { if(!m_released) librados::Rados::shutdown(); } -private: - bool m_released; -}; -} - -namespace cta::disk { - -//------------------------------------------------------------------------------ -// Accessor to next striper pool index -// Note that this is not thread safe, but we do not care -// as we only want a rough load balancing -//------------------------------------------------------------------------------ -unsigned int RadosStriperPool::getStriperIdxAndIncrease() { - if (m_maxStriperIdx == 0) { - // initialization phase : - // - find out the number of objects in the ceph pool - // - allocate corresponding places in the vectors - char *value = nullptr; - m_maxStriperIdx = 3; - if ((value = getenv("CEPH_NBCONNECTIONS"))) { - // TODO: commited for CTA (value = getconfent("CEPH", "NbConnections", 1))) { - m_maxStriperIdx = atoi(value); - } - for (unsigned int i = 0; i < m_maxStriperIdx; i++) { - m_stripers.push_back(StriperDict()); - } - } - unsigned int res = m_striperIdx; - unsigned nextValue = m_striperIdx+1; - if (nextValue >= m_maxStriperIdx) { - nextValue = 0; - } - m_striperIdx = nextValue; - return res; -} - -//------------------------------------------------------------------------------ -// RadosStriperPool::throwingGetStriper -//------------------------------------------------------------------------------ -libradosstriper::RadosStriper* RadosStriperPool::throwingGetStriper(const std::string& userAtPool) { - cta::threading::MutexLocker locker{m_mutex}; - unsigned int striperIdx = getStriperIdxAndIncrease(); - try { - return m_stripers[striperIdx].at(userAtPool); - } catch (std::out_of_range &) { - // we need to create a new radosStriper, as the requested one is not there yet. - // First find the user id (if any given) in the pool string - // format is [@] - const char* userId = nullptr; - size_t pos = userAtPool.find('@'); - std::string user; - std::string pool; - if (pos != std::string::npos) { - user = userAtPool.substr(0, pos); - userId = user.c_str(); - pool = userAtPool.substr(pos + 1); - } else { - pool = userAtPool; - } - // Create the Rados object. It will shutdown automatically when being destructed. - ReleasingRados cluster; - cta::exception::Errnum::throwOnReturnedErrno(cluster.init(userId), - "In RadosStriperPool::throwingGetStriper(): failed to cluster.init(userId): "); - cta::exception::Errnum::throwOnReturnedErrno(cluster.conf_read_file(nullptr), - "In RadosStriperPool::throwingGetStriper(): failed to cluster.conf_read_file(nullptr): "); - cluster.conf_parse_env(nullptr); - cta::exception::Errnum::throwOnReturnedErrno(cluster.connect(), - "In RadosStriperPool::throwingGetStriper(): failed to cluster.connect(): "); - librados::IoCtx ioctx; - cta::exception::Errnum::throwOnReturnedErrno( - cluster.ioctx_create(pool.c_str(), ioctx), - "In RadosStriperPool::throwingGetStriper(): failed to " - "cluster.ioctx_create(pool.c_str(), ioctx): "); - std::unique_ptr newStriper( - new libradosstriper::RadosStriper); - cta::exception::Errnum::throwOnReturnedErrno( - libradosstriper::RadosStriper::striper_create(ioctx, newStriper.get()), - "In RadosStriperPool::throwingGetStriper(): failed to " - "libradosstriper::RadosStriper::striper_create(ioctx, newStriper.get()): "); - // Past that point we should not automatically release the cluster anymore. - cluster.release(); - // setup file layout - newStriper->set_object_layout_stripe_count(4); - newStriper->set_object_layout_stripe_unit(32 * 1024 * 1024); // 32 MB - newStriper->set_object_layout_object_size(32 * 1024 * 1024); // 32 MB - // insert into cache and return value - m_stripers[striperIdx][userAtPool] = newStriper.release(); - return m_stripers[striperIdx][userAtPool]; - } -} - -//------------------------------------------------------------------------------ -// RadosStriperPool::getStriper -//------------------------------------------------------------------------------ -libradosstriper::RadosStriper* RadosStriperPool::getStriper(const std::string& userAtPool) { - try { - return throwingGetStriper(userAtPool); - } catch (...) { - return nullptr; - } -} - -//------------------------------------------------------------------------------ -// RadosStriperPool::~RadosStriperPool -//------------------------------------------------------------------------------ -RadosStriperPool::~RadosStriperPool() { - disconnectAll(); -} - -//------------------------------------------------------------------------------ -// RadosStriperPool::disconnectAll -//------------------------------------------------------------------------------ -void RadosStriperPool::disconnectAll() { - cta::threading::MutexLocker locker{m_mutex}; - for (auto v = m_stripers.begin(); v != m_stripers.end(); v++) { - for (auto i = v->begin(); i != v->end(); i++) { - delete i->second; - } - v->clear(); - } - m_stripers.clear(); -} - -} // namespace cta::disk diff --git a/disk/RadosStriperPool.hpp b/disk/RadosStriperPool.hpp deleted file mode 100644 index 145673982fb3ae570a1f4c4d5efa5d0e0edb1a02..0000000000000000000000000000000000000000 --- a/disk/RadosStriperPool.hpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - * @project The CERN Tape Archive (CTA) - * @copyright Copyright © 2021-2022 CERN - * @license This program is free software, distributed under the terms of the GNU General Public - * Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". You can - * redistribute it and/or modify it under the terms of the GPL Version 3, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * In applying this licence, CERN does not waive the privileges and immunities - * granted to it by virtue of its status as an Intergovernmental Organization or - * submit itself to any jurisdiction. - */ - -#pragma once - -#include "common/threading/Mutex.hpp" - -#include -#include -#include - -namespace cta::disk { - -/** - * Utility singleton managing the rados stripers connections by name. - * The destructor will implicitly release the pool connections. - */ -class RadosStriperPool{ -public: - - /** constructor */ - RadosStriperPool() : m_maxStriperIdx(0), m_striperIdx(0) {}; - - /** - * Get pointer to a connection to the rados user (or one from the cache). - * This function throws exceptions in case of problem. - */ - libradosstriper::RadosStriper * throwingGetStriper(const std::string & userAtPool); - - /** - * Get pointer to a connection to the rados user (or one from the cache). - * This function returns nullptr in case of problem. - */ - libradosstriper::RadosStriper * getStriper(const std::string & userAtPool); - - /** - * Clear the map of all connections - */ - void disconnectAll(); - - /** Destructor that will delete the held objects (needed in SLC6, see - * m_stripers declaration. */ - virtual ~RadosStriperPool(); - -private: - - /// Accessor to next striper pool index - unsigned int getStriperIdxAndIncrease(); - -private: - - // We use a map of pointers instead of maps of unique_ptr who do not work in - // gcc 4.4 (in SLC 6) - using StriperDict = std::map; - /// striper pool - std::vector m_stripers; - /// mutex protecting the striper pool - cta::threading::Mutex m_mutex; - /// size of the Striper pool - unsigned int m_maxStriperIdx; - /// index of current striper pool to be used - unsigned int m_striperIdx; -}; - -} // namespace cta::disk diff --git a/disk/XrdClException.hpp b/disk/XrdClException.hpp index 0c2a4e7d02945bfde6e7d880584b4d7fed326fcd..c2052a30464428694cff236cc8be3d08a2dc79e2 100644 --- a/disk/XrdClException.hpp +++ b/disk/XrdClException.hpp @@ -28,7 +28,7 @@ namespace cta::exception { class XrdClException : public Exception { public: XrdClException(const XrdCl::XRootDStatus& status, std::string_view context); - virtual ~XrdClException() = default; + ~XrdClException() final = default; const XrdCl::XRootDStatus& xRootDStatus() const { return m_status; } static void throwOnError(const XrdCl::XRootDStatus& status, std::string_view context = ""); diff --git a/frontend/common/AdminCmd.hpp b/frontend/common/AdminCmd.hpp index fcd08ccf341a91426a3e9df985a1167fcb488646..cc49390bcdc989beb4f075767df8710f7ffeb9f1 100644 --- a/frontend/common/AdminCmd.hpp +++ b/frontend/common/AdminCmd.hpp @@ -33,7 +33,7 @@ public: const admin::AdminCmd& adminCmd, const bool bypassAdminCheck = false); - ~AdminCmd() = default; + ~AdminCmd() override = default; /*! * Process the admin command diff --git a/frontend/grpc/FrontendGrpcService.hpp b/frontend/grpc/FrontendGrpcService.hpp index 3790ceb9f2c1251bf1bd240175b706e1ee720e6f..996ac15ecca8c2362c872bf574813f5e67a1e3f3 100644 --- a/frontend/grpc/FrontendGrpcService.hpp +++ b/frontend/grpc/FrontendGrpcService.hpp @@ -44,13 +44,13 @@ public: std::shared_ptr getPubkeyCache() const { return m_pubkeyCache; } // Archive/Retrieve interface - Status Create(::grpc::ServerContext* context, const cta::xrd::Request* request, cta::xrd::Response* response); - Status Archive(::grpc::ServerContext* context, const cta::xrd::Request* request, cta::xrd::Response* response); - Status Retrieve(::grpc::ServerContext* context, const cta::xrd::Request* request, cta::xrd::Response* response); - Status CancelRetrieve(::grpc::ServerContext* context, const cta::xrd::Request* request, cta::xrd::Response* response); - Status Delete(::grpc::ServerContext* context, const cta::xrd::Request* request, cta::xrd::Response* response); + Status Create(::grpc::ServerContext* context, const cta::xrd::Request* request, cta::xrd::Response* response) final; + Status Archive(::grpc::ServerContext* context, const cta::xrd::Request* request, cta::xrd::Response* response) final; + Status Retrieve(::grpc::ServerContext* context, const cta::xrd::Request* request, cta::xrd::Response* response) final; + Status CancelRetrieve(::grpc::ServerContext* context, const cta::xrd::Request* request, cta::xrd::Response* response) final; + Status Delete(::grpc::ServerContext* context, const cta::xrd::Request* request, cta::xrd::Response* response) final; // Non-streaming cta-admin commands interface - Status Admin(::grpc::ServerContext* context, const cta::xrd::Request* request, cta::xrd::Response* response); + Status Admin(::grpc::ServerContext* context, const cta::xrd::Request* request, cta::xrd::Response* response) final; private: Status processGrpcRequest(const cta::xrd::Request* request, cta::xrd::Response* response, cta::log::LogContext &lc, const cta::common::dataStructures::SecurityIdentity& clientIdentity) const; diff --git a/frontend/grpc/RequestMessage.hpp b/frontend/grpc/RequestMessage.hpp index 9c569684603b3b6b55eb3fba3b90ceb311081a84..87b4b9be40521d0a0b0d156dbedd617d73c9733e 100644 --- a/frontend/grpc/RequestMessage.hpp +++ b/frontend/grpc/RequestMessage.hpp @@ -29,7 +29,7 @@ namespace cta::frontend::grpc::request { class RequestMessage : public cta::frontend::AdminCmdOptions { public: explicit RequestMessage(const cta::xrd::Request& request); - ~RequestMessage() = default; + ~RequestMessage() final = default; /*! * Get a required option diff --git a/frontend/grpc/callback_api/CtaAdminClientReadReactor.hpp b/frontend/grpc/callback_api/CtaAdminClientReadReactor.hpp index 013e73a4ad63be74f2cfb78198a0855405e2c878..484e955d8d2c301ed7b7b49aa970c18481252165 100644 --- a/frontend/grpc/callback_api/CtaAdminClientReadReactor.hpp +++ b/frontend/grpc/callback_api/CtaAdminClientReadReactor.hpp @@ -55,7 +55,7 @@ static std::string DumpProtobuf(const google::protobuf::Message* message) { // This is a virtual (maybe not all of its methods) class, each command implementation will inherit from this class CtaAdminClientReadReactor : public grpc::ClientReadReactor { public: - void OnDone(const ::grpc::Status& s) override { + void OnDone(const ::grpc::Status& s) final { std::unique_lock l(mu_); status_ = s; done_ = true; @@ -68,7 +68,7 @@ public: return std::move(status_); } - virtual void OnReadDone(bool ok) override { + void OnReadDone(bool ok) final { if (ok) { if (m_response.has_header() && !m_isJson) { switch (m_response.header().type()) { diff --git a/frontend/grpc/callback_api/CtaAdminServer.hpp b/frontend/grpc/callback_api/CtaAdminServer.hpp index b6edad3abc63d3be9165aa3078f92f4188f18373..6cd9ff975588cbc999f52f16f1834e008e8f1e3a 100644 --- a/frontend/grpc/callback_api/CtaAdminServer.hpp +++ b/frontend/grpc/callback_api/CtaAdminServer.hpp @@ -94,9 +94,11 @@ public: m_missingFileCopiesMinAgeSecs(missingFileCopiesMinAgeSecs), m_enableCtaAdminCommands(enableCtaAdminCommands) {} - /* gRPC expects the return type of an RPC implemented using the callback API to be a pointer to ::grpc::ServerWriteReactor */ + /* gRPC expects the return type of an RPC implemented using the callback API to be + * a pointer to ::grpc::ServerWriteReactor + */ ::grpc::ServerWriteReactor* GenericAdminStream(::grpc::CallbackServerContext* context, - const cta::xrd::Request* request); + const cta::xrd::Request* request) final; private: cta::log::LogContext m_lc; // m_locksCount++; } - void setObjectUnlocked(ObjectOpsBase* objectOps) override final { + void setObjectUnlocked(ObjectOpsBase* objectOps) final { objectOps->m_locksCount--; } diff --git a/objectstore/ObjectStoreFixture.hpp b/objectstore/ObjectStoreFixture.hpp index 8af16f65d8b3974ec45bb99297472ed9b2c0e7a2..dcf47832ef3b6dac824bc86e15f42aed2c17cf55 100644 --- a/objectstore/ObjectStoreFixture.hpp +++ b/objectstore/ObjectStoreFixture.hpp @@ -24,7 +24,7 @@ namespace unitTests { class ObjectStore : public ::testing::Test { protected: - virtual void SetUp() override; + void SetUp() override; }; -} \ No newline at end of file +} diff --git a/objectstore/Sorter.hpp b/objectstore/Sorter.hpp index 0e52111f4ff9282db83fce8a65fab74f75729f7a..c74c79515c957cb6e774ef6d1e8504e10d598782 100644 --- a/objectstore/Sorter.hpp +++ b/objectstore/Sorter.hpp @@ -265,14 +265,14 @@ class RetrieveRequestInfosAccessorInterface{ class OStoreRetrieveRequestAccessor: public RetrieveRequestInfosAccessorInterface{ public: explicit OStoreRetrieveRequestAccessor(std::shared_ptr retrieveRequest); - ~OStoreRetrieveRequestAccessor() = default; - std::list getJobs(); - common::dataStructures::ArchiveFile getArchiveFile(); + ~OStoreRetrieveRequestAccessor() final = default; + std::list getJobs() final; + common::dataStructures::ArchiveFile getArchiveFile() final; Sorter::RetrieveJob createRetrieveJob(const cta::common::dataStructures::ArchiveFile& archiveFile, - const uint32_t copyNb, const uint64_t fSeq, AgentReferenceInterface* previousOwner); - serializers::RetrieveJobStatus getJobStatus(const uint32_t copyNb); - std::string getRepackAddress(); - bool getIsRepack(); + const uint32_t copyNb, const uint64_t fSeq, AgentReferenceInterface* previousOwner) final; + serializers::RetrieveJobStatus getJobStatus(const uint32_t copyNb) final; + std::string getRepackAddress() final; + bool getIsRepack() final; private: std::shared_ptr m_retrieveRequest; }; @@ -280,14 +280,14 @@ class OStoreRetrieveRequestAccessor: public RetrieveRequestInfosAccessorInterfac class SorterRetrieveRequestAccessor: public RetrieveRequestInfosAccessorInterface{ public: explicit SorterRetrieveRequestAccessor(Sorter::SorterRetrieveRequest& request); - ~SorterRetrieveRequestAccessor() = default; - std::list getJobs(); - common::dataStructures::ArchiveFile getArchiveFile(); + ~SorterRetrieveRequestAccessor() final = default; + std::list getJobs() final; + common::dataStructures::ArchiveFile getArchiveFile() final; Sorter::RetrieveJob createRetrieveJob(const cta::common::dataStructures::ArchiveFile& archiveFile, - const uint32_t copyNb, const uint64_t fSeq, AgentReferenceInterface* previousOwner); - serializers::RetrieveJobStatus getJobStatus(const uint32_t copyNb); - std::string getRepackAddress(); - bool getIsRepack(); + const uint32_t copyNb, const uint64_t fSeq, AgentReferenceInterface* previousOwner) final; + serializers::RetrieveJobStatus getJobStatus(const uint32_t copyNb) final; + std::string getRepackAddress() final; + bool getIsRepack() final; private: Sorter::SorterRetrieveRequest& m_retrieveRequest; }; diff --git a/rdbms/wrapper/PostgresRset.hpp b/rdbms/wrapper/PostgresRset.hpp index c8c910296cd8dc1b68801d5fa471f8214ca7e1ea..3ba3f325e21a5271eb034626b05ca8124c580341 100644 --- a/rdbms/wrapper/PostgresRset.hpp +++ b/rdbms/wrapper/PostgresRset.hpp @@ -103,9 +103,9 @@ public: return *this; } - const unsigned char* data() const { return m_data; } + const unsigned char* data() const final { return m_data; } - std::size_t size() const { return m_size; } + std::size_t size() const final { return m_size; } private: const unsigned char* m_data; diff --git a/rdbms/wrapper/SqliteRset.hpp b/rdbms/wrapper/SqliteRset.hpp index 432ae3a4ff62a20d40177c07decddd6a3a5f0887..ee5c6197ace0aa3781cbe8279316e3d72d2dcf34 100644 --- a/rdbms/wrapper/SqliteRset.hpp +++ b/rdbms/wrapper/SqliteRset.hpp @@ -61,9 +61,9 @@ public: public: BlobView(const unsigned char* data, std::size_t size) : m_data(data), m_size(size) {} - const unsigned char* data() const { return m_data; } + const unsigned char* data() const final { return m_data; } - std::size_t size() const { return m_size; } + std::size_t size() const final { return m_size; } private: const unsigned char* m_data; diff --git a/scheduler/LabelMount.hpp b/scheduler/LabelMount.hpp index 56b7c223575763f30f6b2c0cbafca2cdbe2aa6a5..52e8799e556c0ccb0e1cd6f88321e2dd511c7830 100644 --- a/scheduler/LabelMount.hpp +++ b/scheduler/LabelMount.hpp @@ -117,7 +117,7 @@ public: * * @return The tape pool of the tape to be mounted. */ - virtual std::string getPoolName() const; + virtual std::string getPoolName() const final; /** * Returns the mount transaction id. diff --git a/scheduler/OStoreDB/OStoreDB.hpp b/scheduler/OStoreDB/OStoreDB.hpp index 6040b74d9309f7cf37d3ce1090aa798ce541ba4c..f0938af589f0593a39effd2448c46183dc80bf95 100644 --- a/scheduler/OStoreDB/OStoreDB.hpp +++ b/scheduler/OStoreDB/OStoreDB.hpp @@ -63,7 +63,7 @@ class OStoreDB : public SchedulerDatabase { public: OStoreDB(objectstore::Backend& be, catalogue::Catalogue& catalogue, log::Logger& logger); - virtual ~OStoreDB() noexcept; + virtual ~OStoreDB() noexcept override; /* === Object store and agent handling ==================================== */ void setAgentReference(objectstore::AgentReference* agentReference); @@ -477,9 +477,9 @@ public: * @param address, the address of the ArchiveRequest * @param archiveFileID the archiveFileID of the file to delete. */ - virtual void cancelArchive(const common::dataStructures::DeleteArchiveRequest& request, log::LogContext& lc) override; + void cancelArchive(const common::dataStructures::DeleteArchiveRequest& request, log::LogContext& lc) override; - virtual void deleteFailed(const std::string& objectId, log::LogContext& lc) override; + void deleteFailed(const std::string& objectId, log::LogContext& lc) override; std::list getRetrieveJobs(const std::string& vid) const override; @@ -584,7 +584,7 @@ public: public: PromotionToToExpandResult promotePendingRequestsForExpansion(size_t requestCount, log::LogContext& lc) override; - virtual ~RepackRequestPromotionStatistics() = default; + ~RepackRequestPromotionStatistics() final = default; private: RepackRequestPromotionStatistics(objectstore::Backend& backend, objectstore::AgentReference& agentReference); @@ -602,7 +602,7 @@ public: throw SchedulingLockNotHeld("In RepackRequestPromotionStatisticsNoLock::promotePendingRequestsForExpansion"); } - virtual ~RepackRequestPromotionStatisticsNoLock() = default; + virtual ~RepackRequestPromotionStatisticsNoLock() final = default; }; private: @@ -707,7 +707,7 @@ public: RepackArchiveReportBatch(objectstore::Backend& backend, OStoreDB& oStoreDb) : RepackReportBatch(backend, oStoreDb) {} - void report(log::LogContext& lc); + void report(log::LogContext& lc) override; private: objectstore::RepackRequest::SubrequestStatistics::List prepareReport(); @@ -756,10 +756,10 @@ public: std::list> getRepackReportBatches(log::LogContext& lc) override; - std::unique_ptr getNextSuccessfulRetrieveRepackReportBatch(log::LogContext& lc); - std::unique_ptr getNextFailedRetrieveRepackReportBatch(log::LogContext& lc); - std::unique_ptr getNextSuccessfulArchiveRepackReportBatch(log::LogContext& lc); - std::unique_ptr getNextFailedArchiveRepackReportBatch(log::LogContext& lc); + std::unique_ptr getNextSuccessfulRetrieveRepackReportBatch(log::LogContext& lc) final; + std::unique_ptr getNextFailedRetrieveRepackReportBatch(log::LogContext& lc) final; + std::unique_ptr getNextSuccessfulArchiveRepackReportBatch(log::LogContext& lc) final; + std::unique_ptr getNextFailedArchiveRepackReportBatch(log::LogContext& lc) final; private: const size_t c_repackArchiveReportBatchSize = 10000; diff --git a/scheduler/RepackReportThread.hpp b/scheduler/RepackReportThread.hpp index 5b7bb186c60673076df4371e7af6fbc03d3f7076..510b875d5a369697245a6fe29ff8a05c1a9a335c 100644 --- a/scheduler/RepackReportThread.hpp +++ b/scheduler/RepackReportThread.hpp @@ -24,8 +24,8 @@ namespace cta { class RepackReportThread: public cta::threading::Thread { public: RepackReportThread(Scheduler& scheduler, log::LogContext &lc):m_scheduler(scheduler),m_lc(lc){} - virtual ~RepackReportThread() = default; - void run(); + ~RepackReportThread() override = default; + void run() final; protected: virtual cta::Scheduler::RepackReportBatch getNextRepackReportBatch(log::LogContext &lc) = 0; virtual std::string getReportingType() = 0; @@ -38,32 +38,32 @@ class RetrieveSuccessesRepackReportThread: public RepackReportThread{ public: RetrieveSuccessesRepackReportThread(Scheduler& scheduler,log::LogContext& lc):RepackReportThread(scheduler,lc) {} private: - virtual cta::Scheduler::RepackReportBatch getNextRepackReportBatch(log::LogContext &lc); - virtual std::string getReportingType(){ return "RetrieveSuccesses"; } + virtual cta::Scheduler::RepackReportBatch getNextRepackReportBatch(log::LogContext &lc) final; + virtual std::string getReportingType() final { return "RetrieveSuccesses"; } }; class ArchiveSuccessesRepackReportThread: public RepackReportThread{ public: ArchiveSuccessesRepackReportThread(Scheduler& scheduler,log::LogContext& lc):RepackReportThread(scheduler,lc) {} private: - virtual cta::Scheduler::RepackReportBatch getNextRepackReportBatch(log::LogContext &lc); - virtual std::string getReportingType(){ return "ArchiveSuccesses"; } + virtual cta::Scheduler::RepackReportBatch getNextRepackReportBatch(log::LogContext &lc) final; + virtual std::string getReportingType() final { return "ArchiveSuccesses"; } }; class RetrieveFailedRepackReportThread: public RepackReportThread{ public: RetrieveFailedRepackReportThread(Scheduler& scheduler,log::LogContext& lc):RepackReportThread(scheduler,lc) {} private: - virtual cta::Scheduler::RepackReportBatch getNextRepackReportBatch(log::LogContext &lc); - virtual std::string getReportingType(){ return "RetrieveFailed"; } + virtual cta::Scheduler::RepackReportBatch getNextRepackReportBatch(log::LogContext &lc) final; + virtual std::string getReportingType() final { return "RetrieveFailed"; } }; class ArchiveFailedRepackReportThread: public RepackReportThread{ public: ArchiveFailedRepackReportThread(Scheduler& scheduler,log::LogContext& lc):RepackReportThread(scheduler,lc) {} private: - virtual cta::Scheduler::RepackReportBatch getNextRepackReportBatch(log::LogContext &lc); - virtual std::string getReportingType(){ return "ArchiveFailed"; } + virtual cta::Scheduler::RepackReportBatch getNextRepackReportBatch(log::LogContext &lc) final; + virtual std::string getReportingType() final { return "ArchiveFailed"; } }; -} +} // namespace cta diff --git a/scheduler/Scheduler.cpp b/scheduler/Scheduler.cpp index b63e813ab437698ebd9d606bf0dd33b2db052ea5..888de3a90308164229ac24a1cbdbadb5b25bc963 100644 --- a/scheduler/Scheduler.cpp +++ b/scheduler/Scheduler.cpp @@ -49,7 +49,6 @@ #include "common/Timer.hpp" #include "common/utils/utils.hpp" #include "disk/DiskFileImplementations.hpp" -#include "disk/RadosStriperPool.hpp" #include "scheduler/ArchiveMount.hpp" #include "scheduler/DiskReportRunner.hpp" #include "scheduler/RetrieveMount.hpp" @@ -813,8 +812,7 @@ void Scheduler::expandRepackRequest(const std::unique_ptr& repack fileName << std::setw(9) << std::setfill('0') << retrieveSubRequest.fSeq; bool createArchiveSubrequest = false; if (filesInDirectory.count(fileName.str())) { - cta::disk::RadosStriperPool radosStriperPool; - cta::disk::DiskFileFactory fileFactory(0, radosStriperPool); + cta::disk::DiskFileFactory fileFactory(0); cta::disk::ReadFile* fileReader = fileFactory.createReadFile(dirBufferURL.str() + fileName.str()); if (fileReader->size() == archiveFile.fileSize) { createArchiveSubrequest = true; diff --git a/tapeserver/castor/tape/tapeserver/RAO/EnterpriseRAOAlgorithm.hpp b/tapeserver/castor/tape/tapeserver/RAO/EnterpriseRAOAlgorithm.hpp index a7e83f72a7c87ff3c57a68caa67309653a88daf7..44a7aba7069203af9460294c68df4ca563cf2039 100644 --- a/tapeserver/castor/tape/tapeserver/RAO/EnterpriseRAOAlgorithm.hpp +++ b/tapeserver/castor/tape/tapeserver/RAO/EnterpriseRAOAlgorithm.hpp @@ -32,7 +32,7 @@ class EnterpriseRAOAlgorithm : public RAOAlgorithm { public: friend EnterpriseRAOAlgorithmFactory; - virtual ~EnterpriseRAOAlgorithm() = default; + ~EnterpriseRAOAlgorithm() final = default; /** * Asks the Enteprise drive to perform a RAO query in order to get the RAO of the diff --git a/tapeserver/castor/tape/tapeserver/RAO/InterpolationFilePositionEstimator.hpp b/tapeserver/castor/tape/tapeserver/RAO/InterpolationFilePositionEstimator.hpp index 61328498fe4803440a7fbd2f86e5e428df2d1c5b..c423543229b7bd6e8f0e9d1ed93c7aebd441e19e 100644 --- a/tapeserver/castor/tape/tapeserver/RAO/InterpolationFilePositionEstimator.hpp +++ b/tapeserver/castor/tape/tapeserver/RAO/InterpolationFilePositionEstimator.hpp @@ -35,7 +35,7 @@ class InterpolationFilePositionEstimator : public FilePositionEstimator{ public: InterpolationFilePositionEstimator(const std::vector & endOfWrapPositions, const cta::catalogue::MediaType & mediaType); FilePositionInfos getFilePosition(const cta::RetrieveJob& job) const override; - virtual ~InterpolationFilePositionEstimator() = default; + ~InterpolationFilePositionEstimator() final = default; static const uint64_t c_blockSize = 256 * 1024; diff --git a/tapeserver/castor/tape/tapeserver/daemon/CleanerSession.hpp b/tapeserver/castor/tape/tapeserver/daemon/CleanerSession.hpp index c0649c7d106127dac0fb9ffb82728d4123c0b291..d7b28a279c62c4ce3f519895c2d0aabd8f116cb6 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/CleanerSession.hpp +++ b/tapeserver/castor/tape/tapeserver/daemon/CleanerSession.hpp @@ -77,7 +77,7 @@ public: * @return Returns the type of action to be performed after the session has * completed. */ - EndOfSessionAction execute() noexcept; + EndOfSessionAction execute() noexcept final; private: /** diff --git a/tapeserver/castor/tape/tapeserver/daemon/DiskReadTaskTest.cpp b/tapeserver/castor/tape/tapeserver/daemon/DiskReadTaskTest.cpp index 2e75b436aa86f507d5b1383eddcde89adaa6e560..b83a646aabe95326fae58e2c86d038e090ec53b3 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/DiskReadTaskTest.cpp +++ b/tapeserver/castor/tape/tapeserver/daemon/DiskReadTaskTest.cpp @@ -19,7 +19,6 @@ #include "castor/tape/tapeserver/daemon/MigrationMemoryManager.hpp" #include "castor/tape/tapeserver/daemon/MigrationReportPacker.hpp" #include "castor/tape/tapeserver/daemon/MemBlock.hpp" -#include "disk/RadosStriperPool.hpp" #include "common/log/LogContext.hpp" #include "common/log/StringLogger.hpp" #include "castor/tape/tapeserver/daemon/TapeserverProxyMock.hpp" @@ -131,8 +130,7 @@ namespace unitTests{ FakeTapeWriteTask ftwt; ftwt.pushDataBlock(new MemBlock(1,blockSize)); castor::tape::tapeserver::daemon::DiskReadTask drt(ftwt,&file,blockNeeded,flag); - cta::disk::RadosStriperPool striperPool; - DiskFileFactory fileFactory(0, striperPool); + DiskFileFactory fileFactory(0); ::testing::NiceMock tspd; cta::TapeMountDummy tmd; diff --git a/tapeserver/castor/tape/tapeserver/daemon/DiskReadThreadPool.hpp b/tapeserver/castor/tape/tapeserver/daemon/DiskReadThreadPool.hpp index d29f7ac6e5d944e36da4cde19b8365e433fcf512..3690c4885d2665003f6153bf41c0430d725d7a88 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/DiskReadThreadPool.hpp +++ b/tapeserver/castor/tape/tapeserver/daemon/DiskReadThreadPool.hpp @@ -19,7 +19,6 @@ #include "castor/tape/tapeserver/daemon/DiskReadTask.hpp" #include "castor/tape/tapeserver/daemon/TaskWatchDog.hpp" -#include "disk/RadosStriperPool.hpp" #include "common/threading/BlockingQueue.hpp" #include "common/threading/Thread.hpp" #include "common/log/LogContext.hpp" @@ -135,7 +134,7 @@ private: class DiskReadWorkerThread: private cta::threading::Thread { public: explicit DiskReadWorkerThread(DiskReadThreadPool& parent) : - m_parent(parent),m_threadID(parent.m_nbActiveThread++),m_lc(parent.m_lc), m_diskFileFactory(parent.m_xrootTimeout, parent.m_striperPool) { + m_parent(parent),m_threadID(parent.m_nbActiveThread++),m_lc(parent.m_lc), m_diskFileFactory(parent.m_xrootTimeout) { cta::log::LogContext::ScopedParam param(m_lc, cta::log::Param("threadID", m_threadID)); m_lc.log(cta::log::INFO, "DiskReadThread created"); } @@ -163,7 +162,7 @@ private: /** The execution thread: pops and executes tasks (potentially asking for more) and calls task injector's finish() on exit of the last thread. */ - virtual void run(); + void run() final; /** * A disk file factory, that will create the proper type of file access class, @@ -184,11 +183,6 @@ private: */ uint16_t m_xrootTimeout; - /** - * A pool of rados striper connections, to be shared by all threads - */ - cta::disk::RadosStriperPool m_striperPool; - /** * Reference to the watchdog, for error reporting. */ diff --git a/tapeserver/castor/tape/tapeserver/daemon/DiskWriteTask.cpp b/tapeserver/castor/tape/tapeserver/daemon/DiskWriteTask.cpp index 08b75da0bfede730cc2ad91f2c81defd6f92b69c..e11a6f61fbf93aba42d0e6d375294b3ac46b11e2 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/DiskWriteTask.cpp +++ b/tapeserver/castor/tape/tapeserver/daemon/DiskWriteTask.cpp @@ -119,9 +119,6 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter, cta::log::LogContext& //A close is done in WriteFile's destructor, but it may lead to some //silent data loss currentErrorToCount = "Error_diskCloseAfterWrite"; - // Set the checksum on the server (actually needed only for Rados striper - // noop in other cases). - writeFile->setChecksum(checksum); writeFile->close(); m_stats.closingTime +=localTime.secs(cta::utils::Timer::resetCounter); m_stats.filesCount++; diff --git a/tapeserver/castor/tape/tapeserver/daemon/DiskWriteTask.hpp b/tapeserver/castor/tape/tapeserver/daemon/DiskWriteTask.hpp index 74e7ed5031a9e0f0a50bd286184b68246be8b2ac..d2a59a3eb556ce66feb1ffa8299619a382298c3d 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/DiskWriteTask.hpp +++ b/tapeserver/castor/tape/tapeserver/daemon/DiskWriteTask.hpp @@ -55,18 +55,18 @@ public: * Allows client code to return a reusable memory block. Should not been called * @return the pointer to the memory block that can be reused */ - virtual MemBlock *getFreeBlock() ; + MemBlock *getFreeBlock() final; /** * Function used to enqueue a new memory block holding data to be written to disk * @param mb: corresponding memory block */ - virtual void pushDataBlock(MemBlock *mb); + void pushDataBlock(MemBlock* mb) final; /** * Destructor (also waiting for the end of the write operation) */ - virtual ~DiskWriteTask(); + ~DiskWriteTask() final; /** * Return the stats of the tasks. Should be call after execute diff --git a/tapeserver/castor/tape/tapeserver/daemon/DiskWriteTaskTest.cpp b/tapeserver/castor/tape/tapeserver/daemon/DiskWriteTaskTest.cpp index 4217c3219fe30875309d66779511c24f4ffd7ec0..510fa64b890a6d387330ba583db9a7183b8f906e 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/DiskWriteTaskTest.cpp +++ b/tapeserver/castor/tape/tapeserver/daemon/DiskWriteTaskTest.cpp @@ -135,8 +135,7 @@ namespace unitTests{ TestingRetrieveMount trm(*catalogue, std::move(dbrm)); MockRecallReportPacker report(&trm,lc); RecallMemoryManager mm(10,100,lc); - cta::disk::RadosStriperPool striperPool; - DiskFileFactory fileFactory(0, striperPool); + DiskFileFactory fileFactory(0); cta::MockRetrieveMount mrm(*catalogue); std::unique_ptr fileToRecall(new TestingRetrieveJob(mrm)); diff --git a/tapeserver/castor/tape/tapeserver/daemon/DiskWriteThreadPool.hpp b/tapeserver/castor/tape/tapeserver/daemon/DiskWriteThreadPool.hpp index 682ea7b2544db73ddee16575f9d3f59171f8c251..c1302d32ef2e53e915196eb8be0c62a0c17b6493 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/DiskWriteThreadPool.hpp +++ b/tapeserver/castor/tape/tapeserver/daemon/DiskWriteThreadPool.hpp @@ -26,7 +26,6 @@ #include "castor/tape/tapeserver/daemon/DiskWriteTask.hpp" #include "castor/tape/tapeserver/daemon/DiskStats.hpp" #include "castor/tape/tapeserver/daemon/TaskWatchDog.hpp" -#include "disk/RadosStriperPool.hpp" #include "common/Timer.hpp" #include @@ -103,7 +102,7 @@ private: m_threadID(manager.m_nbActiveThread++), m_parentThreadPool(manager), m_lc(m_parentThreadPool.m_lc), - m_diskFileFactory(manager.m_xrootTimeout, manager.m_striperPool) { + m_diskFileFactory(manager.m_xrootTimeout) { // This thread id will remain for the rest of the thread's lifetime // (and also context's lifetime), so no need for a scoper m_lc.pushOrReplace(cta::log::Param("threadID", m_threadID)); @@ -141,7 +140,7 @@ private: */ cta::disk::DiskFileFactory m_diskFileFactory; - virtual void run(); + void run() final; }; /** @@ -179,11 +178,6 @@ protected: */ uint16_t m_xrootTimeout; - /** - * A pool of rados striper connections, to be shared by all threads - */ - cta::disk::RadosStriperPool m_striperPool; - private: /** * Aggregate all threads' stats diff --git a/tapeserver/castor/tape/tapeserver/daemon/ErrorFlag.hpp b/tapeserver/castor/tape/tapeserver/daemon/ErrorFlag.hpp index 6f77839fd31483cc6e7eabafe726fa543be4086c..15e3f010ba70c874431f96c3cb12ddd596f8dc14 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/ErrorFlag.hpp +++ b/tapeserver/castor/tape/tapeserver/daemon/ErrorFlag.hpp @@ -27,7 +27,7 @@ namespace castor::tape::tapeserver::daemon { class ErrorFlag : public cta::exception::Exception { public: ErrorFlag() : cta::exception::Exception("Internal exception, should not be seen") {} - virtual ~ErrorFlag() = default; + ~ErrorFlag() final = default; }; } // namespace castor::tape::tapeserver::daemon diff --git a/tapeserver/castor/tape/tapeserver/daemon/MigrationReportPacker.hpp b/tapeserver/castor/tape/tapeserver/daemon/MigrationReportPacker.hpp index 89d5a130f8a3f87098dc7835e246a03594e04ad5..4d6197bd48054684998ce33457127f1bc5c76afd 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/MigrationReportPacker.hpp +++ b/tapeserver/castor/tape/tapeserver/daemon/MigrationReportPacker.hpp @@ -38,7 +38,7 @@ public: */ MigrationReportPacker(cta::ArchiveMount* archiveMount, const cta::log::LogContext& lc); - ~MigrationReportPacker(); + ~MigrationReportPacker() override; /** * Create into the MigrationReportPacker a report for the successful migration of migratedFile diff --git a/tapeserver/castor/tape/tapeserver/daemon/MigrationTaskInjector.hpp b/tapeserver/castor/tape/tapeserver/daemon/MigrationTaskInjector.hpp index 91f402240960449e7a62ce0ca93ee4b4fcaf8ade..0fe3271a7f95af6688e1e45eab72e4ab8a02c0e4 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/MigrationTaskInjector.hpp +++ b/tapeserver/castor/tape/tapeserver/daemon/MigrationTaskInjector.hpp @@ -164,7 +164,7 @@ private: class WorkerThread : public cta::threading::Thread { public: explicit WorkerThread(MigrationTaskInjector& rji) : m_parent(rji) {} - virtual void run(); + void run() final; private: MigrationTaskInjector & m_parent; } m_thread; diff --git a/tapeserver/castor/tape/tapeserver/daemon/RecallTaskInjector.hpp b/tapeserver/castor/tape/tapeserver/daemon/RecallTaskInjector.hpp index e7ee7b44853ee5830f81ad95c9fdddcec7381594..c16ebce5d8b9c63efa04a8513afb0ed41671a03a 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/RecallTaskInjector.hpp +++ b/tapeserver/castor/tape/tapeserver/daemon/RecallTaskInjector.hpp @@ -215,7 +215,7 @@ private: class WorkerThread: public cta::threading::Thread { public: explicit WorkerThread(RecallTaskInjector& rji) : m_parent(rji) {} - virtual void run(); + void run() final; private: RecallTaskInjector & m_parent; void popRecalls(); diff --git a/tapeserver/castor/tape/tapeserver/daemon/TaskWatchDog.hpp b/tapeserver/castor/tape/tapeserver/daemon/TaskWatchDog.hpp index fa3d28333591964e98aa02a5db5a30c17b26e605..af4fddcb70409bb0253669dc1a14bec06fb33ef1 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/TaskWatchDog.hpp +++ b/tapeserver/castor/tape/tapeserver/daemon/TaskWatchDog.hpp @@ -260,7 +260,7 @@ protected: /** * Thread's loop */ - void run(){ + void run() override { // reset timers as we don't know how long it took before the thread started m_reportTimer.reset(); m_blockMovementReportTimer.reset(); diff --git a/tapeserver/castor/tape/tapeserver/drive/FakeDrive.hpp b/tapeserver/castor/tape/tapeserver/drive/FakeDrive.hpp index 6c8c7f720bfd7c127c9baac40bdba1918ed00ce4..1e0c781f498538496caa3bf1c6ba9989ef39c5b2 100644 --- a/tapeserver/castor/tape/tapeserver/drive/FakeDrive.hpp +++ b/tapeserver/castor/tape/tapeserver/drive/FakeDrive.hpp @@ -57,69 +57,67 @@ class FakeDrive : public DriveInterface { enum FailureMoment failureMoment = OnWrite, bool failOnMount = false) noexcept; explicit FakeDrive(bool failOnMount) noexcept; - virtual ~FakeDrive() = default; - virtual compressionStats getCompression(); - virtual void clearCompressionStats(); - virtual std::map getTapeWriteErrors(); - virtual std::map getTapeReadErrors(); - virtual std::map getTapeNonMediumErrors(); - virtual std::map getQualityStats(); - virtual std::map getDriveStats(); - virtual std::map getVolumeStats(); - virtual std::string getDriveFirmwareVersion(); - virtual deviceInfo getDeviceInfo(); - virtual std::string getGenericSCSIPath(); - virtual std::string getSerialNumber(); - virtual void positionToLogicalObject(uint32_t blockId); - virtual positionInfo getPositionInfo(); - virtual physicalPositionInfo getPhysicalPositionInfo(); - virtual std::vector getEndOfWrapPositions(); - virtual std::vector getTapeAlertCodes(); - virtual std::vector getTapeAlerts(const std::vector&); - virtual std::vector getTapeAlertsCompact(const std::vector&); - virtual bool tapeAlertsCriticalForWrite(const std::vector & codes); - virtual void setDensityAndCompression(bool compression = true, - unsigned char densityCode = 0); - virtual void enableCRC32CLogicalBlockProtectionReadOnly(); - virtual void enableCRC32CLogicalBlockProtectionReadWrite(); - virtual void disableLogicalBlockProtection(); - virtual drive::LBPInfo getLBPInfo(); - virtual void setLogicalBlockProtection(const unsigned char method, - unsigned char methodLength, const bool enableLPBforRead, - const bool enableLBBforWrite); - virtual void setEncryptionKey(const std::string &encryption_key); - virtual bool clearEncryptionKey(); - virtual bool isEncryptionCapEnabled(); - virtual driveStatus getDriveStatus(); - virtual void setSTBufferWrite(bool bufWrite); - virtual void fastSpaceToEOM(void); - virtual void rewind(void); - virtual void spaceToEOM(void); - virtual void spaceFileMarksBackwards(size_t count); - virtual void spaceFileMarksForward(size_t count); - virtual void unloadTape(void); - virtual void flush(void); - virtual void writeSyncFileMarks(size_t count); - virtual void writeImmediateFileMarks(size_t count); - virtual void writeBlock(const void * data, size_t count); - virtual ssize_t readBlock(void * data, size_t count); - virtual void readExactBlock(void * data, size_t count, const std::string& context); - virtual void readFileMark(const std::string& context); - virtual void waitUntilReady(const uint32_t timeoutSecond); - virtual bool isWriteProtected(); - virtual bool isAtBOT(); - virtual bool isAtEOD(); - virtual bool isTapeBlank(); - virtual lbpToUse getLbpToUse(); - virtual bool hasTapeInPlace(); - virtual castor::tape::SCSI::Structures::RAO::udsLimits getLimitUDS(); - virtual void queryRAO(std::list &files, int maxSupported); + ~FakeDrive() override = default; + compressionStats getCompression() final; + void clearCompressionStats() final; + std::map getTapeWriteErrors() final; + std::map getTapeReadErrors() final; + std::map getTapeNonMediumErrors() final; + std::map getQualityStats() final; + std::map getDriveStats() final; + std::map getVolumeStats() final; + std::string getDriveFirmwareVersion() final; + deviceInfo getDeviceInfo() final; + std::string getGenericSCSIPath() final; + std::string getSerialNumber() final; + void positionToLogicalObject(uint32_t blockId) final; + positionInfo getPositionInfo() final; + physicalPositionInfo getPhysicalPositionInfo() final; + std::vector getEndOfWrapPositions() final; + std::vector getTapeAlertCodes() final; + std::vector getTapeAlerts(const std::vector&) final; + std::vector getTapeAlertsCompact(const std::vector&) final; + bool tapeAlertsCriticalForWrite(const std::vector & codes) final; + void setDensityAndCompression(bool compression = true, unsigned char densityCode = 0) final; + void enableCRC32CLogicalBlockProtectionReadOnly() final; + void enableCRC32CLogicalBlockProtectionReadWrite() final; + void disableLogicalBlockProtection() final; + drive::LBPInfo getLBPInfo() final; + void setLogicalBlockProtection(const unsigned char method, unsigned char methodLength, + const bool enableLPBforRead, const bool enableLBBforWrite) final; + void setEncryptionKey(const std::string &encryption_key) final; + bool clearEncryptionKey() final; + bool isEncryptionCapEnabled() final; + driveStatus getDriveStatus() final; + void setSTBufferWrite(bool bufWrite) final; + void fastSpaceToEOM(void) final; + void rewind(void) final; + void spaceToEOM(void) final; + void spaceFileMarksBackwards(size_t count) final; + void spaceFileMarksForward(size_t count) final; + void unloadTape(void) final; + void flush(void) final; + void writeSyncFileMarks(size_t count) final; + void writeImmediateFileMarks(size_t count) final; + void writeBlock(const void * data, size_t count) final; + ssize_t readBlock(void * data, size_t count) final; + void readExactBlock(void * data, size_t count, const std::string& context) final; + void readFileMark(const std::string& context) final; + void waitUntilReady(const uint32_t timeoutSecond) final; + bool isWriteProtected() final; + bool isAtBOT() final; + bool isAtEOD() final; + bool isTapeBlank() final; + lbpToUse getLbpToUse() final; + bool hasTapeInPlace() final; + castor::tape::SCSI::Structures::RAO::udsLimits getLimitUDS() override; + void queryRAO(std::list &files, int maxSupported) final; }; class FakeNonRAODrive : public FakeDrive{ public: FakeNonRAODrive(); - virtual castor::tape::SCSI::Structures::RAO::udsLimits getLimitUDS(); + castor::tape::SCSI::Structures::RAO::udsLimits getLimitUDS() final; }; } // namespace castor::tape::tapeserver::drive diff --git a/tapeserver/castor/tape/tapeserver/file/FileTest.cpp b/tapeserver/castor/tape/tapeserver/file/FileTest.cpp index 9f46d68c0f24f8701ffaa19b9ef0ba26c82648fd..2b256b586e939dd1a00631cfca817e78da891b05 100644 --- a/tapeserver/castor/tape/tapeserver/file/FileTest.cpp +++ b/tapeserver/castor/tape/tapeserver/file/FileTest.cpp @@ -35,7 +35,6 @@ #include "common/exception/Exception.hpp" #include "disk/DiskFile.hpp" #include "disk/DiskFileImplementations.hpp" -#include "disk/RadosStriperPool.hpp" #include "scheduler/ArchiveJob.hpp" #include "scheduler/RetrieveJob.hpp" #include "tests/TempFile.hpp" @@ -257,8 +256,7 @@ TEST(castorTapeDiskFile, canWriteAndReadDisk) { const uint32_t block_size = 1024; char *data1 = new char[block_size]; char *data2 = new char[block_size]; - cta::disk::RadosStriperPool striperPool; - cta::disk::DiskFileFactory fileFactory(0, striperPool); + cta::disk::DiskFileFactory fileFactory(0); TempFile sourceFile; sourceFile.randomFill(1000); TempFile destinationFile(sourceFile.path() + "_dst"); diff --git a/tapeserver/castor/tape/tapeserver/file/OSMFileTest.cpp b/tapeserver/castor/tape/tapeserver/file/OSMFileTest.cpp index 9d92b4b83f91a7a24cf109fc4f300e4e9473efc3..4a8aef17218262cb0eb0dd8e965ecc1e16d438ad 100644 --- a/tapeserver/castor/tape/tapeserver/file/OSMFileTest.cpp +++ b/tapeserver/castor/tape/tapeserver/file/OSMFileTest.cpp @@ -21,7 +21,6 @@ #include "common/exception/Exception.hpp" #include "disk/DiskFile.hpp" #include "disk/DiskFileImplementations.hpp" -#include "disk/RadosStriperPool.hpp" #include "scheduler/ArchiveJob.hpp" #include "scheduler/RetrieveJob.hpp" diff --git a/tapeserver/daemon/MaintenanceHandler.hpp b/tapeserver/daemon/MaintenanceHandler.hpp index 2f662a40f08ad1080b299169f264de6a87d20268..fc3928bfaac303adbddd7538d543c916692d4d63 100644 --- a/tapeserver/daemon/MaintenanceHandler.hpp +++ b/tapeserver/daemon/MaintenanceHandler.hpp @@ -31,7 +31,7 @@ namespace cta::tape::daemon { class MaintenanceHandler: public SubprocessHandler { public: MaintenanceHandler(const common::TapedConfiguration & tapedConfig, ProcessManager & pm); - virtual ~MaintenanceHandler(); + ~MaintenanceHandler() final; ProcessingStatus getInitialStatus() override; ProcessingStatus fork() override; void postForkCleanup() override; diff --git a/tapeserver/daemon/TapeDaemon.hpp b/tapeserver/daemon/TapeDaemon.hpp index eae29e9b33291caf8e2e6053180e2edb0d59e181..fc5e1f5038ea85b0ead751232d47327f7b429d6b 100644 --- a/tapeserver/daemon/TapeDaemon.hpp +++ b/tapeserver/daemon/TapeDaemon.hpp @@ -41,7 +41,7 @@ public: cta::log::Logger &log, const common::TapedConfiguration &globalConfig); - virtual ~TapeDaemon(); + ~TapeDaemon() final; /** The main entry function of the daemon. * @return The return code of the process. */ diff --git a/tapeserver/readtp/ReadtpCmd.cpp b/tapeserver/readtp/ReadtpCmd.cpp index 8a9a8eaa231089ac59a53684804833043002d6d9..86438cc23ea016bc69c216332d78c654a6d267e3 100644 --- a/tapeserver/readtp/ReadtpCmd.cpp +++ b/tapeserver/readtp/ReadtpCmd.cpp @@ -25,7 +25,6 @@ #include "common/exception/EncryptionException.hpp" #include "common/log/DummyLogger.hpp" #include "disk/DiskFile.hpp" -#include "disk/RadosStriperPool.hpp" #include "mediachanger/LibrarySlotParser.hpp" #include "rdbms/Login.hpp" #include "scheduler/RetrieveJob.hpp" @@ -328,8 +327,7 @@ std::string ReadtpCmd::getNextDestinationUrl() { //------------------------------------------------------------------------------ void ReadtpCmd::readTapeFiles( castor::tape::tapeserver::drive::DriveInterface &drive) { - cta::disk::RadosStriperPool striperPool; - cta::disk::DiskFileFactory fileFactory(0, striperPool); + cta::disk::DiskFileFactory fileFactory(0); catalogue::TapeSearchCriteria searchCriteria; searchCriteria.vid = m_vid; diff --git a/xroot_plugins/AdminCmdStream.hpp b/xroot_plugins/AdminCmdStream.hpp index 5f0864efc4d58fce4acc1063291c74dbee07cc99..1efc0e9ccfccbc296ab53db91f728bd439882c63 100644 --- a/xroot_plugins/AdminCmdStream.hpp +++ b/xroot_plugins/AdminCmdStream.hpp @@ -34,7 +34,7 @@ public: const admin::AdminCmd& adminCmd, XrdSsiStream*& stream); - ~AdminCmdStream() = default; + ~AdminCmdStream() final = default; /*! * Process the admin command diff --git a/xroot_plugins/XrdCtaStream.hpp b/xroot_plugins/XrdCtaStream.hpp index 5a66805aa50c7766df4a2b4dda5d9fa0e1318fbc..5d2e495613a7e681cd8cda861d4a37dab078721b 100644 --- a/xroot_plugins/XrdCtaStream.hpp +++ b/xroot_plugins/XrdCtaStream.hpp @@ -40,7 +40,7 @@ public: XrdSsiPb::Log::Msg(XrdSsiPb::Log::DEBUG, LOG_SUFFIX, "XrdCtaStream() constructor"); } - virtual ~XrdCtaStream() { + ~XrdCtaStream() override { XrdSsiPb::Log::Msg(XrdSsiPb::Log::DEBUG, LOG_SUFFIX, "~XrdCtaStream() destructor"); } @@ -63,7 +63,7 @@ public: * last = true: No more data remains. * last = false: A fatal error occurred, eRef has the reason. */ - virtual Buffer *GetBuff(XrdSsiErrInfo &eInfo, int &dlen, bool &last) override { + Buffer *GetBuff(XrdSsiErrInfo &eInfo, int &dlen, bool &last) override { XrdSsiPb::Log::Msg(XrdSsiPb::Log::DEBUG, LOG_SUFFIX, "GetBuff(): XrdSsi buffer fill request (", dlen, " bytes)"); std::unique_ptr> streambuf; diff --git a/xroot_plugins/XrdCtaVersion.hpp b/xroot_plugins/XrdCtaVersion.hpp index 9c2250654ed1b681595f4566332ec4b48fe9a3bb..4b7c616ae6f2446df20d3ccbd6c947b4f4c7097f 100644 --- a/xroot_plugins/XrdCtaVersion.hpp +++ b/xroot_plugins/XrdCtaVersion.hpp @@ -57,12 +57,12 @@ private: /*! * Fill the buffer */ - virtual int fillBuffer(XrdSsiPb::OStreamBuffer* streambuf); + int fillBuffer(XrdSsiPb::OStreamBuffer* streambuf) final; /*! * Only one item is sent so isDone = true */ - virtual bool isDone() const { return m_is_done; } + bool isDone() const final { return m_is_done; } }; inline VersionStream::VersionStream(const frontend::AdminCmdStream& requestMsg, diff --git a/xroot_plugins/XrdSsiCtaServiceProvider.hpp b/xroot_plugins/XrdSsiCtaServiceProvider.hpp index 390df6819961ec452d4aaa9119c4e52c51d68b3c..495d4d8af2de736da8d44253672fe8874b5772b2 100644 --- a/xroot_plugins/XrdSsiCtaServiceProvider.hpp +++ b/xroot_plugins/XrdSsiCtaServiceProvider.hpp @@ -46,7 +46,7 @@ public: XrdSsiPb::Log::Msg(XrdSsiPb::Log::DEBUG, LOG_SUFFIX, "XrdSsiCtaServiceProvider() constructor"); } - virtual ~XrdSsiCtaServiceProvider() { + ~XrdSsiCtaServiceProvider() final { XrdSsiPb::Log::Msg(XrdSsiPb::Log::DEBUG, LOG_SUFFIX, "~XrdSsiCtaServiceProvider() destructor"); }