diff --git a/cmdline/CtaAdminTextFormatter.cpp b/cmdline/CtaAdminTextFormatter.cpp index ce99dd84a269dbc1092f6924c01974b7d54a3c94..83e4719d2b609a925cfda43e0c6a37610c10252f 100644 --- a/cmdline/CtaAdminTextFormatter.cpp +++ b/cmdline/CtaAdminTextFormatter.cpp @@ -278,8 +278,6 @@ void TextFormatter::printDriveLsHeader() { } void TextFormatter::print(const DriveLsItem& drls_item) { - //using namespace cta::common::dataStructures; - std::string driveStatusSince; std::string driveSchedulerBackendName = drls_item.scheduler_backend_name(); std::string instanceName = drls_item.instance_name(); diff --git a/cmdline/CtaAdminXrdCmd.hpp b/cmdline/CtaAdminXrdCmd.hpp index aaffdcde35c27f0cb9613d8e00140ab76eac413a..3802c51b30d514e95bda9f0bc5254c9426870f2c 100644 --- a/cmdline/CtaAdminXrdCmd.hpp +++ b/cmdline/CtaAdminXrdCmd.hpp @@ -29,12 +29,9 @@ public: void send(const CtaAdminParsedCmd& parsedCmd) const; private: - // Member variables - const std::string StreamBufferSize = "1024"; //!< Buffer size for Data/Stream Responses const std::string DefaultRequestTimeout = "10"; //!< Default Request Timeout. Can be overridden by //!< XRD_REQUESTTIMEOUT environment variable. - // CtaAdminParsedCmd parsedCmd; static constexpr const char* const LOG_SUFFIX = "CtaAdminXrdCmd"; //!< Identifier for log messages }; diff --git a/common/dataStructures/FileRecycleLog.hpp b/common/dataStructures/FileRecycleLog.hpp index cea2dbb65c702b86cd518c5d47503f6e7719edc3..81ef2093c553f517ee147812c3e0421bc163efb1 100644 --- a/common/dataStructures/FileRecycleLog.hpp +++ b/common/dataStructures/FileRecycleLog.hpp @@ -28,12 +28,6 @@ struct FileRecycleLog { std::string vid; uint64_t fSeq; uint64_t blockId; - /** - * The TAPE_FILE.LOGICAL_SIZE_IN_BYTES column contains the same information as the ARCHIVE_FILE. - * https://gitlab.cern.ch/cta/CTA/-/issues/412 - * Therefore, we don't have to save it in the FileRecycleLog - */ - /*uint64_t logicalSizeInBytes;*/ uint8_t copyNb; time_t tapeFileCreationTime; uint64_t archiveFileId; diff --git a/common/dataStructures/RepackInfo.hpp b/common/dataStructures/RepackInfo.hpp index 6b6a737216e89d3cec5caefeb2efdccb1fe700ce..0640e2db6101cbd98bf0f7f2652a26df57734c3a 100644 --- a/common/dataStructures/RepackInfo.hpp +++ b/common/dataStructures/RepackInfo.hpp @@ -27,10 +27,9 @@ namespace cta::common::dataStructures { /** - * This is the repack information for a given tape + * Repack information for a given tape */ struct RepackInfo { - struct RepackDestinationInfo { std::string vid; uint64_t files = 0; @@ -47,7 +46,7 @@ struct RepackInfo { Undefined } type; enum class Status { - // Those values are matching the cta.proto values + // Values matching the cta.proto values Pending = 1, ToExpand = 2, Starting = 3, @@ -81,18 +80,8 @@ struct RepackInfo { time_t repackFinishedTime = 0; RepackDestinationInfo::List destinationInfos; std::string mountPolicy; -// std::string tag; -// uint64_t totalFiles; -// uint64_t totalSize; -// uint64_t filesToRetrieve; -// uint64_t filesToArchive; -// uint64_t filesFailed; -// uint64_t filesArchived; -// RepackType repackType; -// std::string repackStatus; -// std::map errors; -// EntryLog creationLog; -RepackQueueType getQueueType(); + + RepackQueueType getQueueType(); }; // struct RepackInfo std::string toString(RepackInfo::Type type); diff --git a/common/dataStructures/TapeDrive.cpp b/common/dataStructures/TapeDrive.cpp index b867adb7b25b54b2a698b19f5f37bdc5e447ad67..def82a11db059c3ce4198c7188d77b0c89077a7c 100644 --- a/common/dataStructures/TapeDrive.cpp +++ b/common/dataStructures/TapeDrive.cpp @@ -114,17 +114,6 @@ bool TapeDrive::operator==(const TapeDrive &rhs) const { && checkOptionalString(physicalLibraryName) == checkOptionalString(rhs.physicalLibraryName) && reservedBytes == rhs.reservedBytes && reservationSessionId == rhs.reservationSessionId - - // - // && devFileName==rhs.devFileName - // && rawLibrarySlot==rhs.rawLibrarySlot - // - // && currentVo==rhs.currentVo - // && nextVo==rhs.nextVo - // - // && userComment==rhs.userComment - // && creationLog==rhs.creationLog - // && lastModificationLog==rhs.lastModificationLog ; } diff --git a/common/utils/utils.cpp b/common/utils/utils.cpp index 9833086576f22806347c937f0817785ea0dd08c7..169e1f44a1e492bd45efd7a65f7c372cf020735f 100644 --- a/common/utils/utils.cpp +++ b/common/utils/utils.cpp @@ -143,7 +143,6 @@ void assertAbsolutePathSyntax(const std::string& path) { try { assertPathStartsWithASlash(path); assertPathContainsValidChars(path); - //assertPathDoesContainConsecutiveSlashes(path); } catch (std::exception& ex) { std::ostringstream message; message << "Absolute path \"" << path << "\" contains a syntax error: " << ex.what(); diff --git a/frontend/common/DriveLsResponseStream.cpp b/frontend/common/DriveLsResponseStream.cpp index f98e094f10ea946adec5d1e15ad5521b508c7c57..3a4c7fb93eb34b0e9f90684f8f57f47378d014d5 100644 --- a/frontend/common/DriveLsResponseStream.cpp +++ b/frontend/common/DriveLsResponseStream.cpp @@ -148,7 +148,6 @@ cta::xrd::Data DriveLsResponseStream::next() { cta::xrd::Data data; auto driveItem = data.mutable_drls_item(); - // fillDriveItem(dr, driveItem, m_instanceName, driveSchedulerBackendName, driveConfigs); driveItem->set_instance_name(m_instanceName); driveItem->set_cta_version(dr.ctaVersion.value_or("")); driveItem->set_logical_library(dr.logicalLibrary); diff --git a/frontend/grpc/ClientNegotiationRequestHandler.cpp b/frontend/grpc/ClientNegotiationRequestHandler.cpp index 055a33fd11cd2f039912189493a238219b7935d2..d5551c1e46e527fc73ac3ca9de8fb9d46b2fd40a 100644 --- a/frontend/grpc/ClientNegotiationRequestHandler.cpp +++ b/frontend/grpc/ClientNegotiationRequestHandler.cpp @@ -122,7 +122,6 @@ bool cta::frontend::grpc::client::NegotiationRequestHandler::next(const bool bOk } m_streamState = StreamState::FINISH; m_uprwNegotiation->Finish(&m_grpcStatus, m_tag); - // return bNext; return true; } // else everything is OK diff --git a/frontend/grpc/Main.cpp b/frontend/grpc/Main.cpp index 13c8531cbdc1ccd0bbec82bb0376aa0336f1f1fc..e2cc41e11cb90d0e59b6171554f5a5130dfdf88d 100644 --- a/frontend/grpc/Main.cpp +++ b/frontend/grpc/Main.cpp @@ -41,7 +41,6 @@ #include "NegotiationService.hpp" #include "common/utils/utils.hpp" -// #include #include #include diff --git a/frontend/grpc/NegotiationService.hpp b/frontend/grpc/NegotiationService.hpp index 142e8e3d84bdd6f684b0461ca455b57f9188d30a..353dc411dabe93b88c43f481fd11fd74ea380547 100644 --- a/frontend/grpc/NegotiationService.hpp +++ b/frontend/grpc/NegotiationService.hpp @@ -53,35 +53,6 @@ public: NegotiationService(NegotiationService&&) = delete; NegotiationService& operator=(NegotiationService&&) = delete; - // /** - // * Register handler - // * can throw - // */ - // template cta::frontend::grpc::request::IHandler& registerHandler(ARGS&... args) { - // std::lock_guard lck(m_mtxLockHandler); - // std::unique_ptr upHandler = std::make_unique(m_log, *this, args...); - // // Handler initialisation - // upHandler->init();// can throw - // // Store address - // uintptr_t tag = reinterpret_cast(upHandler.get()); - // // Move ownership & store under the Tag - // m_umapHandlers[upHandler.get()] = std::move(upHandler); - // // Retrun IHandler - // return *m_umapHandlers[reinterpret_cast(tag)]; - // } - // /** - // * Register handler - // * can throw - // */ - // template void registerHandler(ARGS&... args) { - // std::lock_guard lck(m_mtxLockHandler); - // std::unique_ptr upHandler = std::make_unique(m_log, *this, service(), args...); - // // Handler initialisation - // upHandler->init();// can throw - // // Move ownership & store under the Tag - // m_umapHandlers[upHandler.get()] = std::move(upHandler); - // } - NegotiationRequestHandler& registerHandler() { m_lc.log(cta::log::INFO, "In NegotiationService::registerHandler"); std::lock_guard lck(m_mtxLockHandler); diff --git a/frontend/grpc/ServerNegotiationRequestHandler.cpp b/frontend/grpc/ServerNegotiationRequestHandler.cpp index b6cefc111df850b6517d70919997cde86cc75263..2ca365ef7e5572158f8a3ce0fa2f7c346b877303 100644 --- a/frontend/grpc/ServerNegotiationRequestHandler.cpp +++ b/frontend/grpc/ServerNegotiationRequestHandler.cpp @@ -285,7 +285,6 @@ bool cta::frontend::grpc::server::NegotiationRequestHandler::next(const bool bOk logGSSErrors("In grpc::server::NegotiationRequestHandler::next(): gss_delete_sec_context() minor status", gssMinStat, GSS_C_GSS_CODE); } } - // gss_release_buffer(&gssMinStat, &gssSendToken); bNext = false; break; default: diff --git a/frontend/grpc/callback_api/CtaAdminServer.hpp b/frontend/grpc/callback_api/CtaAdminServer.hpp index f7a6e08a3e948c9419b701714e16dc52d8adf123..ce4efe89aedb5f77883e9079bee8c85f1389de62 100644 --- a/frontend/grpc/callback_api/CtaAdminServer.hpp +++ b/frontend/grpc/callback_api/CtaAdminServer.hpp @@ -76,7 +76,6 @@ class CtaRpcStreamImpl : public cta::xrd::CtaRpcStream::CallbackService { public: cta::log::LogContext getLogContext() const { return m_lc; } - // CtaRpcStreamImpl() = delete; CtaRpcStreamImpl(cta::catalogue::Catalogue& catalogue, cta::Scheduler& scheduler, cta::SchedulerDB_t& schedDB, diff --git a/frontend/grpc/callback_api/ServerVersion.hpp b/frontend/grpc/callback_api/ServerVersion.hpp index 2f84bb4275b0b5f85347901b2a7235c8ea9a0d15..578193113e89509fa5c4816320e1c9c0b42b30d6 100644 --- a/frontend/grpc/callback_api/ServerVersion.hpp +++ b/frontend/grpc/callback_api/ServerVersion.hpp @@ -1,4 +1,3 @@ -// #include "CtaAdminServer.hpp" // need this for the class CtaAdminServerWriteReactor, nothing else #include #include diff --git a/mediachanger/rmcd/rmc_procreq.cpp b/mediachanger/rmcd/rmc_procreq.cpp index 65e9155eef5d37f62c55de95d275ec85d58ad41c..209d9707cdf92834a94ffdbc22286d75232bbc21 100644 --- a/mediachanger/rmcd/rmc_procreq.cpp +++ b/mediachanger/rmcd/rmc_procreq.cpp @@ -37,10 +37,9 @@ #include "rmc_marshall_element.hpp" #include "rmc_procreq.hpp" -/* set in rmc_serv.c */ +// set in rmc_serv.c extern struct extended_robot_info g_extended_robot_info; -/* rmc_srv_export - export/eject a cartridge from the robot */ int rmc_srv_export(const struct rmc_srv_rqst_context* const rqst_context) { int c; gid_t gid; @@ -55,7 +54,7 @@ int rmc_srv_export(const struct rmc_srv_rqst_context* const rqst_context) { unmarshall_LONG(rbp, uid); unmarshall_LONG(rbp, gid); rmc_logit(func, RMC92, "export", uid, gid, rqst_context->clienthost); - /* Unmarshall and ignore the loader field as it is no longer used */ + // Unmarshall and ignore the loader field as it is no longer used { char smc_ldr[CA_MAXRBTNAMELEN + 1]; if (unmarshall_STRINGN(&rbp, req_data_end, smc_ldr, CA_MAXRBTNAMELEN + 1)) { @@ -84,8 +83,6 @@ int rmc_srv_export(const struct rmc_srv_rqst_context* const rqst_context) { return c; } -/* rmc_srv_findcart - find cartridge(s) */ - int rmc_srv_findcart(const struct rmc_srv_rqst_context* const rqst_context) { int c; struct smc_element_info* element_info; @@ -110,7 +107,7 @@ int rmc_srv_findcart(const struct rmc_srv_rqst_context* const rqst_context) { unmarshall_LONG(rbp, uid); unmarshall_LONG(rbp, gid); rmc_logit(func, RMC92, "findcart", uid, gid, rqst_context->clienthost); - /* Unmarshall and ignore the loader fiel as it is no longer used */ + // Unmarshall and ignore the loader fiel as it is no longer used { char smc_ldr[CA_MAXRBTNAMELEN + 1]; if (unmarshall_STRINGN(&rbp, req_data_end, smc_ldr, CA_MAXRBTNAMELEN + 1)) { @@ -174,8 +171,6 @@ int rmc_srv_findcart(const struct rmc_srv_rqst_context* const rqst_context) { return 0; } -/* rmc_srv_getgeom - get the robot geometry */ - int rmc_srv_getgeom(const struct rmc_srv_rqst_context* const rqst_context) { gid_t gid; char logbuf[8]; @@ -190,7 +185,7 @@ int rmc_srv_getgeom(const struct rmc_srv_rqst_context* const rqst_context) { unmarshall_LONG(rbp, uid); unmarshall_LONG(rbp, gid); rmc_logit(func, RMC92, "getgeom", uid, gid, rqst_context->clienthost); - /* Unmarshall and ignore the loader field as it is no longer used */ + // Unmarshall and ignore the loader field as it is no longer used { char smc_ldr[CA_MAXRBTNAMELEN + 1]; if (unmarshall_STRINGN(&rbp, req_data_end, smc_ldr, CA_MAXRBTNAMELEN + 1)) { @@ -217,8 +212,6 @@ int rmc_srv_getgeom(const struct rmc_srv_rqst_context* const rqst_context) { return 0; } -/* rmc_srv_import - import/inject a cartridge into the robot */ - int rmc_srv_import(const struct rmc_srv_rqst_context* const rqst_context) { int c; gid_t gid; @@ -233,7 +226,7 @@ int rmc_srv_import(const struct rmc_srv_rqst_context* const rqst_context) { unmarshall_LONG(rbp, uid); unmarshall_LONG(rbp, gid); rmc_logit(func, RMC92, "import", uid, gid, rqst_context->clienthost); - /* Unmarshall and ignore the loader field as it is no longer used */ + // Unmarshall and ignore the loader field as it is no longer used { char smc_ldr[CA_MAXRBTNAMELEN + 1]; if (unmarshall_STRINGN(&rbp, req_data_end, smc_ldr, CA_MAXRBTNAMELEN + 1)) { @@ -262,8 +255,6 @@ int rmc_srv_import(const struct rmc_srv_rqst_context* const rqst_context) { return c; } -/* rmc_srv_mount - mount a cartridge on a drive */ - int rmc_srv_mount(const struct rmc_srv_rqst_context* const rqst_context) { int c; int drvord; @@ -280,7 +271,7 @@ int rmc_srv_mount(const struct rmc_srv_rqst_context* const rqst_context) { unmarshall_LONG(rbp, uid); unmarshall_LONG(rbp, gid); rmc_logit(func, RMC92, "mount", uid, gid, rqst_context->clienthost); - /* Unmarshall and ignore the loader field as it is no longer used */ + // Unmarshall and ignore the loader field as it is no longer used { char smc_ldr[CA_MAXRBTNAMELEN + 1]; if (unmarshall_STRINGN(&rbp, req_data_end, smc_ldr, CA_MAXRBTNAMELEN + 1)) { @@ -313,8 +304,6 @@ int rmc_srv_mount(const struct rmc_srv_rqst_context* const rqst_context) { return c; } -/* rmc_srv_readelem - read element status */ - int rmc_srv_readelem(const struct rmc_srv_rqst_context* const rqst_context) { int c; struct smc_element_info* element_info; @@ -338,7 +327,7 @@ int rmc_srv_readelem(const struct rmc_srv_rqst_context* const rqst_context) { unmarshall_LONG(rbp, uid); unmarshall_LONG(rbp, gid); rmc_logit(func, RMC92, "readelem", uid, gid, rqst_context->clienthost); - /* Unmarshall and ignore the loader field as it is no longer used */ + // Unmarshall and ignore the loader field as it is no longer used { char smc_ldr[CA_MAXRBTNAMELEN + 1]; if (unmarshall_STRINGN(&rbp, req_data_end, smc_ldr, CA_MAXRBTNAMELEN + 1)) { @@ -399,8 +388,6 @@ int rmc_srv_readelem(const struct rmc_srv_rqst_context* const rqst_context) { return 0; } -/* rmc_srv_unmount - dismount a cartridge from a drive */ - int rmc_srv_unmount(const struct rmc_srv_rqst_context* const rqst_context) { int c; int drvord; @@ -417,7 +404,7 @@ int rmc_srv_unmount(const struct rmc_srv_rqst_context* const rqst_context) { unmarshall_LONG(rbp, uid); unmarshall_LONG(rbp, gid); rmc_logit(func, RMC92, "unmount", uid, gid, rqst_context->clienthost); - /* Unmarshall and ignore the loader field as it is no longer used */ + // Unmarshall and ignore the loader field as it is no longer used { char smc_ldr[CA_MAXRBTNAMELEN + 1]; if (unmarshall_STRINGN(&rbp, req_data_end, smc_ldr, CA_MAXRBTNAMELEN + 1)) { diff --git a/mediachanger/rmcd/rmc_procreq.hpp b/mediachanger/rmcd/rmc_procreq.hpp index 662b7ebb52f83f063d2851d60ffff33c2ef0b19d..d6bb6d9a176ca265d74fd02076d3cbe369e8c740 100644 --- a/mediachanger/rmcd/rmc_procreq.hpp +++ b/mediachanger/rmcd/rmc_procreq.hpp @@ -24,10 +24,23 @@ struct rmc_srv_rqst_context { const char* clienthost; }; +//! Export/eject a cartridge from the robot int rmc_srv_export(const struct rmc_srv_rqst_context* const rqst_context); + +//! Find cartridge(s) int rmc_srv_findcart(const struct rmc_srv_rqst_context* const rqst_context); + +//! Get the robot geometry int rmc_srv_getgeom(const struct rmc_srv_rqst_context* const rqst_context); + +//! Import/inject a cartridge into the robot int rmc_srv_import(const struct rmc_srv_rqst_context* const rqst_context); + +//! Mount a cartridge into a drive int rmc_srv_mount(const struct rmc_srv_rqst_context* const rqst_context); + +//! Read element status int rmc_srv_readelem(const struct rmc_srv_rqst_context* const rqst_context); + +//! Dismount a cartridge from a drive int rmc_srv_unmount(const struct rmc_srv_rqst_context* const rqst_context); diff --git a/objectstore/Agent.cpp b/objectstore/Agent.cpp index 66e3f20ded6af620d3b719728653aa6ec1e04fcd..ae70af346ee9f387f8b0cb6109d1707a7a81482c 100644 --- a/objectstore/Agent.cpp +++ b/objectstore/Agent.cpp @@ -185,21 +185,6 @@ void cta::objectstore::Agent::garbageCollect(const std::string& presumedOwner, A } } - - -/*void cta::objectstore::Agent::create() { - if (!m_setupDone) - throw SetupNotDone("In Agent::create(): setup() not yet done"); - RootEntry re(m_objectStore); - AgentRegister ar(re.allocateOrGetAgentRegister(*this), m_objectStore); - ar.addIntendedElement(selfName(), *this); - serializers::Agent as; - as.set_heartbeat(0); - writeChild(selfName(), as); - ar.upgradeIntendedElementToActual(selfName(), *this); - m_creationDone = true; -}*/ - void cta::objectstore::Agent::addToOwnership(const std::string& name) { checkPayloadWritable(); std::string * owned = m_payload.mutable_ownedobjects()->Add(); diff --git a/objectstore/ArchiveQueueAlgorithms.hpp b/objectstore/ArchiveQueueAlgorithms.hpp index 5228520762284a34ca3a659435b1aba1c3132673..2c6cc5b4cf7bd3683ede98333d913ffed005e268 100644 --- a/objectstore/ArchiveQueueAlgorithms.hpp +++ b/objectstore/ArchiveQueueAlgorithms.hpp @@ -241,7 +241,6 @@ trimContainerIfNeeded(Container& cont, ScopedExclusiveLock & contLock, tl.addToLog(params); lc.log(log::INFO, "In ContainerTraits::trimContainerIfNeeded(): could not delete a presumably empty queue"); } - //queueRemovalTime += localQueueRemovalTime = t.secs(utils::Timer::resetCounter); return true; } @@ -277,7 +276,6 @@ getLockedAndFetchedNoCreate(Container& cont, ScopedExclusiveLock& contLock, cons if (!aqAddress.size()) throw NoSuchContainer("In ContainerTraits::getLockedAndFetchedNoCreate(): no such archive queue"); // try and lock the archive queue. Any failure from here on means the end of the getting jobs. cont.setAddress(aqAddress); - //findQueueTime += localFindQueueTime = t.secs(utils::Timer::resetCounter); try { if (contLock.isLocked()) { contLock.release(); @@ -288,7 +286,6 @@ getLockedAndFetchedNoCreate(Container& cont, ScopedExclusiveLock& contLock, cons tl.insertAndReset("queueLockTime",t); cont.fetch(); tl.insertAndReset("queueFetchTime",t); - //lockFetchQueueTime += localLockFetchQueueTime = t.secs(utils::Timer::resetCounter); } catch (cta::exception::Exception&) { // The queue is now absent. We can remove its reference in the root entry. // A new queue could have been added in the mean time, and be non-empty. @@ -320,7 +317,6 @@ getLockedAndFetchedNoCreate(Container& cont, ScopedExclusiveLock& contLock, cons tl.addToLog(params); lc.log(log::DEBUG, "In ContainerTraits::getLockedAndFetchedNoCreate(): could not de-referenced missing queue from root entry: already done."); } - //emptyQueueCleanupTime += localEmptyCleanupQueueTime = t.secs(utils::Timer::resetCounter); attemptCount++; // Unlock and reset the address so we can reuse the in-memory object with potentially ane address. if (contLock.isLocked()) contLock.release(); diff --git a/objectstore/GarbageCollector.hpp b/objectstore/GarbageCollector.hpp index 033701a9ad3850d3d95c09dd7d0a035f488731db..47464eb5ab8ddcbd2b8bbad00ebf620cd0eaab6f 100644 --- a/objectstore/GarbageCollector.hpp +++ b/objectstore/GarbageCollector.hpp @@ -60,7 +60,6 @@ public: //tuple[0] = containerIdentifier (vid or Repack Request's address), tuple[1]=jobQueueType, tuple[2]=vidOfTheJob std::map, std::list>> retrieveQueuesAndRequests; std::list> otherObjects; - //Sorter m_sorter; /// Fill up the fetchedObjects with objects of interest. void fetchOwnedObjects(Agent & agent, std::list> & fetchedObjects, Backend & objectStore, log::LogContext & lc); @@ -71,10 +70,9 @@ public: void lockFetchAndUpdateArchiveJobs(Agent & agent, AgentReference & agentReference, Backend & objectStore, log::LogContext & lc); /// Lock, fetch and update retrieve jobs void lockFetchAndUpdateRetrieveJobs(Agent & agent, AgentReference & agentReference, Backend & objectStore, log::LogContext & lc); - // Lock, fetch and update other objects + /// Lock, fetch and update other objects void lockFetchAndUpdateOtherObjects(Agent & agent, AgentReference & agentReference, Backend & objectStore, cta::catalogue::Catalogue & catalogue, log::LogContext & lc); - //Sorter& getSorter(); private: std::string dispatchArchiveAlgorithms(std::list> &jobs,const common::dataStructures::JobQueueType& jobQueueType, const std::string& containerIdentifier, diff --git a/objectstore/ProtocolBuffersAlgorithms.cpp b/objectstore/ProtocolBuffersAlgorithms.cpp index c20de22dc07c74ba558d97fdcc16d66203767ac2..d0c93fe54cd2f3c8975a2a78a0663dca5eb790bf 100644 --- a/objectstore/ProtocolBuffersAlgorithms.cpp +++ b/objectstore/ProtocolBuffersAlgorithms.cpp @@ -19,18 +19,6 @@ void cta::objectstore::serializers::removeString(::google::protobuf::RepeatedPtrField< ::std::string>* field, const std::string & value) { -// bool found; -// do { -// found = false; -// for (size_t i=0; i<(size_t)field->size(); i++) { -// if (value == field->Get(i)) { -// found = true; -// field->SwapElements(i, field->size()-1); -// field->RemoveLast(); -// break; -// } -// } -// } while (found); removeOccurences(field, value); } @@ -54,4 +42,4 @@ size_t cta::objectstore::serializers::findStringFrom( } } throw NotFound("In cta::objectstore::serializers::findString: string not found"); -} \ No newline at end of file +} diff --git a/objectstore/RepackQueueAlgorithms.hpp b/objectstore/RepackQueueAlgorithms.hpp index f62c6e1726fef13843e1511f2e1d4335c74b9e28..928faa1730db4e16a194d5058459546fb647a83d 100644 --- a/objectstore/RepackQueueAlgorithms.hpp +++ b/objectstore/RepackQueueAlgorithms.hpp @@ -255,12 +255,10 @@ getLockedAndFetchedNoCreate(Container& cont, ScopedExclusiveLock& contLock, cons } // try and lock the repack queue. Any failure from here on means the end of the getting jobs. cont.setAddress(rpkQAddress); - //findQueueTime += localFindQueueTime = t.secs(utils::Timer::resetCounter); try { if (contLock.isLocked()) contLock.release(); contLock.lock(cont); cont.fetch(); - //lockFetchQueueTime += localLockFetchQueueTime = t.secs(utils::Timer::resetCounter); } catch (cta::exception::NoSuchObject&) { // The queue is now absent. We can remove its reference in the root entry. // A new queue could have been added in the mean time, and be non-empty. @@ -286,7 +284,6 @@ getLockedAndFetchedNoCreate(Container& cont, ScopedExclusiveLock& contLock, cons lc.log(log::DEBUG, "In ContainerTraits::getLockedAndFetchedNoCreate(): could not de-referenced missing queue from root entry: already done."); } - //emptyQueueCleanupTime += localEmptyCleanupQueueTime = t.secs(utils::Timer::resetCounter); attemptCount++; // Unlock and reset the address so we can reuse the in-memory object with potentially ane address. if (contLock.isLocked()) contLock.release(); diff --git a/objectstore/RetrieveRequest.cpp b/objectstore/RetrieveRequest.cpp index ba77479ce3b01ce0c9ae489be554831c7ade4b0d..5bc481e24ffc00bec1894b98e5eef664cce9822f 100644 --- a/objectstore/RetrieveRequest.cpp +++ b/objectstore/RetrieveRequest.cpp @@ -1302,7 +1302,6 @@ std::string RetrieveRequest::asyncReportSucceedForRepackCallback(const std::stri throw cta::exception::Exception(std::string("In RetrieveRequest::asyncReportSucceedForRepackCallback: could not parse payload: ")+ payload.InitializationErrorString()); } - //payload.set_status(osdbJob->selectedCopyNb,serializers::RetrieveJobStatus::RJS_Succeeded); auto retrieveJobs = payload.mutable_jobs(); for(auto& job : *retrieveJobs){ if(job.copynb() == ui32CopyNb) diff --git a/rdbms/Conn.cpp b/rdbms/Conn.cpp index 8c848a6c74368ac61d5fb30b427deb99edcc92cd..22895356b8c384de8d835b3d9eaafed604dbef69 100644 --- a/rdbms/Conn.cpp +++ b/rdbms/Conn.cpp @@ -116,11 +116,6 @@ Stmt Conn::createStmt(const std::string &sql) { //------------------------------------------------------------------------------ void Conn::executeNonQuery(const std::string &sql) { if(nullptr != m_connAndStmts && nullptr != m_connAndStmts->conn) { -// if(std::string::npos != sql.find(";")) { -// UnexpectedSemicolon ex; -// ex.getMessage() << "Encountered unexpected semicolon in " << getSqlForException(sql); -// throw ex; -// } m_connAndStmts->conn->executeNonQuery(sql); } else { throw exception::Exception("Conn does not contain a connection"); diff --git a/scheduler/LabelMount.cpp b/scheduler/LabelMount.cpp index 0d33a7824422355fd7af406485f1721e157abb0f..d5c48720ef2283d6dbc5be0a1dfdeed9330df92f 100644 --- a/scheduler/LabelMount.cpp +++ b/scheduler/LabelMount.cpp @@ -16,64 +16,53 @@ */ #include "LabelMount.hpp" +#include "common/exception/NotImplementedException.hpp" namespace cta { LabelMount::LabelMount(catalogue::Catalogue& catalogue): m_catalogue(catalogue) { - throw 0; - // TODO + throw exception::NotImplementedException(); } void LabelMount::complete() { - throw 0; - // TODO + throw exception::NotImplementedException(); } std::string LabelMount::getMountTransactionId() const { - throw 0; - // TODO + throw exception::NotImplementedException(); } -cta::common::dataStructures::MountType LabelMount::getMountType() const { - throw 0; - // TODO +common::dataStructures::MountType LabelMount::getMountType() const { + throw exception::NotImplementedException(); } uint32_t LabelMount::getNbFiles() const { - throw 0; - // TODO + throw exception::NotImplementedException(); } std::string LabelMount::getPoolName() const { - throw 0; - // TODO + throw exception::NotImplementedException(); } std::string LabelMount::getVid() const { - throw 0; - // TODO + throw exception::NotImplementedException(); } -void LabelMount::setDriveStatus(cta::common::dataStructures::DriveStatus status, const std::optional & reason) { - throw 0; - // TODO +void LabelMount::setDriveStatus(common::dataStructures::DriveStatus status, const std::optional & reason) { + throw exception::NotImplementedException(); } void LabelMount::setTapeSessionStats(const castor::tape::tapeserver::daemon::TapeSessionStats &stats) { - throw 0; - // TODO + throw exception::NotImplementedException(); } void LabelMount::setTapeMounted(log::LogContext &logContext) const { - throw 0; - // TODO + throw exception::NotImplementedException(); } LabelMount::LabelMount(catalogue::Catalogue& catalogue, - [[maybe_unused]] std::unique_ptr dbMount) - : m_catalogue(catalogue) { - throw 0; - // TODO; + [[maybe_unused]] std::unique_ptr dbMount) : m_catalogue(catalogue) { + throw exception::NotImplementedException(); } } // namespace cta diff --git a/scheduler/OStoreDB/OStoreDB.cpp b/scheduler/OStoreDB/OStoreDB.cpp index 4b9af0ce5beae0106009e7eec7ffa97bda5bb86a..bc3369171de67117af3e9e1d9e37d6f2315115ee 100644 --- a/scheduler/OStoreDB/OStoreDB.cpp +++ b/scheduler/OStoreDB/OStoreDB.cpp @@ -1459,41 +1459,6 @@ std::list OStoreDB::getRetrieveRequestsByRequester(const st //------------------------------------------------------------------------------ std::map> OStoreDB::getRetrieveRequests() const { throw exception::NotImplementedException(); - // std::map > ret; - // // Get list of tape pools and then tapes - // objectstore::RootEntry re(m_objectStore); - // objectstore::ScopedSharedLock rel(re); - // re.fetch(); - // auto tpl=re.dumpTapePools(); - // rel.release(); - // for (auto tpp = tpl.begin(); tpp != tpl.end(); tpp++) { - // // Get the list of tapes for the tape pool - // objectstore::TapePool tp(tpp->address, m_objectStore); - // objectstore::ScopedSharedLock tplock(tp); - // tp.fetch(); - // auto tl = tp.dumpTapes(); - // for (auto tptr = tl.begin(); tptr!= tl.end(); tptr++) { - // // Get the list of retrieve requests for the tape. - // objectstore::Tape t(tptr->address, m_objectStore); - // objectstore::ScopedSharedLock tlock(t); - // t.fetch(); - // auto jobs = t.dumpAndFetchRetrieveRequests(); - // // If the list is not empty, add to the map. - // if (jobs.size()) { - // cta::Tape tkey; - // // TODO tkey.capacityInBytes; - // tkey.creationLog = t.getCreationLog(); - // // TODO tkey.dataOnTapeInBytes; - // tkey.logicalLibraryName = t.getLogicalLibrary(); - // tkey.nbFiles = t.getLastFseq(); - // // TODO tkey.status - // tkey.tapePoolName = tp.getName(); - // tkey.vid = t.getVid(); - // ret[tkey] = std::move(jobs); - // } - // } - // } - // return ret; } //------------------------------------------------------------------------------ @@ -4678,7 +4643,6 @@ void OStoreDB::ArchiveJob::failReport(const std::string& failureReason, log::Log //------------------------------------------------------------------------------ void OStoreDB::ArchiveJob::bumpUpTapeFileCount(uint64_t newFileCount) { throw exception::NotImplementedException(); - // m_archiveMount.setTapeMaxFileCount(newFileCount); } //------------------------------------------------------------------------------ diff --git a/scheduler/OStoreDB/OStoreDB.hpp b/scheduler/OStoreDB/OStoreDB.hpp index 88b9c0327cf594917b95ccc7e61f29da47d27b17..cfb25282b91f410de6d998f2a647fa81c1f13f0c 100644 --- a/scheduler/OStoreDB/OStoreDB.hpp +++ b/scheduler/OStoreDB/OStoreDB.hpp @@ -273,7 +273,6 @@ public: std::unique_ptr m_requestDeleter; }; - // friend class ArchiveJob; static ArchiveJob* castFromSchedDBJob(SchedulerDatabase::ArchiveJob* job); /* === Retrieve Mount handling ============================================ */ @@ -482,8 +481,6 @@ public: std::map, std::less<>> getRetrieveJobs() const override; - // using RetrieveQueueItor_t = QueueItor; - class RetrieveJobQueueItor : public IRetrieveJobQueueItor { public: RetrieveJobQueueItor(objectstore::Backend* objectStore, @@ -504,9 +501,6 @@ public: std::unique_ptr getRetrieveJobQueueItor(const std::string& vid, common::dataStructures::JobQueueType queueType) const override; - // RetrieveQueueItor_t* getRetrieveJobItorPtr(const std::string& vid, - // common::dataStructures::JobQueueType queueType = common::dataStructures::JobQueueType::JobsToTransferForUser) const; - std::list> getNextRetrieveJobsToTransferBatch(const std::string& vid, uint64_t filesRequested, diff --git a/scheduler/RetrieveJob.hpp b/scheduler/RetrieveJob.hpp index a61326080cedf0b77b633b88cbe07cbbd34c1910..57e60a451bceccead2bd94ed69e1336ea1853696 100644 --- a/scheduler/RetrieveJob.hpp +++ b/scheduler/RetrieveJob.hpp @@ -145,11 +145,6 @@ public: */ const common::dataStructures::TapeFile & selectedTapeFile() const; - /** - * The mount to which the job belongs. - */ - //RetrieveMount &mount; - /** * The NS archive file information */ diff --git a/scheduler/Scheduler.cpp b/scheduler/Scheduler.cpp index 77379bd24a980af71a8ce1b16475145f59cfa580..939e0917ced696841340fcac8145e51dec5c16e7 100644 --- a/scheduler/Scheduler.cpp +++ b/scheduler/Scheduler.cpp @@ -959,9 +959,7 @@ Scheduler::RepackReportBatch Scheduler::getNextFailedArchiveRepackReportBatch(lo // Scheduler::RepackReportBatch::report //------------------------------------------------------------------------------ void Scheduler::RepackReportBatch::report(log::LogContext& lc) { - if (nullptr == m_DbBatch) { - // lc.log(log::DEBUG, "In Scheduler::RepackReportBatch::report(): empty batch."); - } else { + if (m_DbBatch != nullptr) { m_DbBatch->report(lc); } } @@ -2586,8 +2584,6 @@ std::list Scheduler::getQueuesAndM if (em.currentMount) { summary->currentMounts++; } - /*else - summary->nextMounts++;*/ summary->currentBytes += em.bytesTransferred; summary->currentFiles += em.filesTransferred; summary->averageBandwidth = em.averageBandwidth; diff --git a/scheduler/rdbms/RelationalDB.cpp b/scheduler/rdbms/RelationalDB.cpp index 58d3d60eca1a3fec4b2f33328a8575d37cb812de..a9e1cd342b0de1fdeb9b376c28dca111eb9a3a4a 100644 --- a/scheduler/rdbms/RelationalDB.cpp +++ b/scheduler/rdbms/RelationalDB.cpp @@ -721,7 +721,6 @@ auto RelationalDB::getRepackStatisticsNoLock() lc.log(log::INFO, "RelationalDB::getRepackStatisticsNoLock(): calling populateRepackRequestsStatistics() select call to the DB."); - //auto typedRet = std::make_unique(); auto ret = std::make_unique(*this); populateRepackRequestsStatistics(*ret); return ret; @@ -951,7 +950,6 @@ RelationalDB::getNextSuccessfulArchiveRepackReportBatch(log::LogContext& lc) { log::TimingList timings; std::unique_ptr ret; schedulerdb::Transaction txn(m_connPool); - //txn.takeNamedLock("getNextSuccessfulArchiveRepackReportBatch"); std::vector jobIDs; std::unordered_set jobSrcUrls; try { @@ -1049,7 +1047,6 @@ RelationalDB::getNextSuccessfulArchiveRepackReportBatch(log::LogContext& lc) { for(auto& bufferURL: repackBufferUrlsToDelete){ //Repack Request is complete, delete the directory in the buffer cta::disk::DirectoryFactory directoryFactory; - // std::string directoryPath = cta::utils::getEnclosingPath(bufferURL); std::unique_ptr directory; try { directory.reset(directoryFactory.createDirectory(bufferURL)); diff --git a/scheduler/rdbms/RepackRequest.cpp b/scheduler/rdbms/RepackRequest.cpp index f0cccb1ee02cf54eeb6536178cefa1ba01993683..099f297a8e14001149bd0e0c304740ab52b1be43 100644 --- a/scheduler/rdbms/RepackRequest.cpp +++ b/scheduler/rdbms/RepackRequest.cpp @@ -133,7 +133,6 @@ namespace cta::schedulerdb { .log(log::DEBUG, "In RepackRequest::addSubrequestsAndUpdateStats(): diskFileInfo.path ?"); schedReq.diskFileInfo = rsr.archiveFile.diskFileInfo; rr.setSchedulerRequest(schedReq); - // rr.setIsVerifyOnly(rsr.isVerifyOnly); // rsr.isVerifyOnly does not exist // Disk system try { @@ -552,10 +551,6 @@ namespace cta::schedulerdb { m_maxFilesToSelect = maxFilesToSelect; } -//void RepackRequest::update() const { -// throw cta::exception::NotImplementedException(); -//} - void RepackRequest::insert() { log::ScopedParamContainer params(m_lc); diff --git a/scheduler/rdbms/RepackRequest.hpp b/scheduler/rdbms/RepackRequest.hpp index 66a82043cf35ea451479de2bd98e04e836dba19b..46d6ab87059a3ba573d8fd681fdd4a7e4d249614 100644 --- a/scheduler/rdbms/RepackRequest.hpp +++ b/scheduler/rdbms/RepackRequest.hpp @@ -81,16 +81,13 @@ public: void setTotalStats(const cta::SchedulerDatabase::RepackRequest::TotalStatsFiles& totalStatsFiles); - void - reportRetrieveCreationFailures(const uint64_t failedToRetrieveFiles, - const uint64_t failedToRetrieveBytes, - const uint64_t failedArchiveReq); + void reportRetrieveCreationFailures(const uint64_t failedToRetrieveFiles, const uint64_t failedToRetrieveBytes, + const uint64_t failedArchiveReq); - //void commit(); void insert(); - //void update() const; void assignJobStatusToRepackInfoStatus(const RepackJobStatus& dbStatus); + RepackJobStatus mapRepackInfoStatusToJobStatus(const common::dataStructures::RepackInfo::Status& infoStatus); common::dataStructures::MountPolicy m_mountPolicy; diff --git a/scheduler/rdbms/RetrieveRdbJob.hpp b/scheduler/rdbms/RetrieveRdbJob.hpp index e3365109d5825fa728fce8ec415c811d4d0f4c67..dc404881108fb9c2dd52afecfba6c92aec4b5ff0 100644 --- a/scheduler/rdbms/RetrieveRdbJob.hpp +++ b/scheduler/rdbms/RetrieveRdbJob.hpp @@ -133,7 +133,6 @@ public: uint64_t m_mountId = 0; std::string m_tapePool=""; rdbms::ConnPool& m_connPool; - //std::shared_ptr m_conn; void abort(const std::string& abortReason, log::LogContext& lc) override; void asyncSetSuccessful() override; diff --git a/scheduler/rdbms/postgres/ArchiveJobQueue.cpp b/scheduler/rdbms/postgres/ArchiveJobQueue.cpp index c3fdc76f09b2de47f73c3c8e23465bba792ac2bf..50139095545e7f1351c5f15f84cb9d0b131ec230 100644 --- a/scheduler/rdbms/postgres/ArchiveJobQueue.cpp +++ b/scheduler/rdbms/postgres/ArchiveJobQueue.cpp @@ -206,14 +206,6 @@ ArchiveJobQueueRow::updateJobStatus(Transaction& txn, ArchiveJobStatus newStatus return stmt2.getNbAffectedRows(); } } - /* the following is here for debugging purposes (row deletion gets disabled) - * if (status == ArchiveJobStatus::AJS_Complete) { - * status = ArchiveJobStatus::ReadyForDeletion; - * } else if (status == ArchiveJobStatus::AJS_Failed) { - * status = ArchiveJobStatus::ReadyForDeletion; - * ArchiveJobQueueRow::copyToFailedJobTable(txn, jobIDs); - * } - */ std::string table_name = repack_table_name_prefix + "ARCHIVE_ACTIVE_QUEUE"; std::string sql = ""; if (!isRepack || (isRepack && newStatus != ArchiveJobStatus::AJS_ToReportToRepackForSuccess)){ @@ -295,7 +287,6 @@ rdbms::Rset ArchiveJobQueueRow::getNextSuccessfulArchiveRepackReportBatch(Transa auto stmt = txn.getConn().createStmt(sql); stmt.bindString(":STATUS", to_string(ArchiveJobStatus::ReadyForDeletion)); - // to_string(ArchiveJobStatus::AJS_ToReportToRepackForSuccess)); stmt.bindUint32(":LIMIT", static_cast(limit)); auto rset = stmt.executeQuery(); return rset; diff --git a/scheduler/rdbms/postgres/ArchiveJobQueue.hpp b/scheduler/rdbms/postgres/ArchiveJobQueue.hpp index c6b4f132474b72d46a1e9e06d3a9a8c48c96d86e..9d327d3bb05702d4c5139b3e78c9a81f5d6e076b 100644 --- a/scheduler/rdbms/postgres/ArchiveJobQueue.hpp +++ b/scheduler/rdbms/postgres/ArchiveJobQueue.hpp @@ -83,9 +83,6 @@ struct ArchiveJobQueueRow { std::string host = ""; std::string mount_type = ""; std::string logical_library = ""; - - //common::dataStructures::ArchiveFile archiveFile; - uint64_t archiveFileID = 0; std::string diskFileId = ""; std::string diskInstance = ""; @@ -651,4 +648,4 @@ public: static rdbms::Rset deleteSuccessfulRepackArchiveJobBatch(Transaction &txn, std::vector& jobIDs); }; -}; // namespace cta::schedulerdb::postgres \ No newline at end of file +}; // namespace cta::schedulerdb::postgres diff --git a/scheduler/rdbms/postgres/Enums.hpp b/scheduler/rdbms/postgres/Enums.hpp index fc4c81ce83ae4d75e37e79600092ac9522ba7b25..853e5944573cc34ca4b7f6b4823e7509edd62e21 100644 --- a/scheduler/rdbms/postgres/Enums.hpp +++ b/scheduler/rdbms/postgres/Enums.hpp @@ -57,26 +57,6 @@ StringsArchiveJobStatus = {"AJS_ToTransferForUser", "ReadyForDeletion", "Cancelled"}; -// ================================ Job Queue Type ============================= - -//enum class JobQueueType : uint8_t { -// JobsToTransferForUser, -// FailedJobs, -// JobsToReportToUser, -// JobsToReportToRepackForSuccess, -// JobsToReportToRepackForFailure, -// JobsToTransferForRepack -//}; - -//constexpr const char* const StringsJobQueueType[] = { -// "JobsToTransfer", -// "FailedJobs", -// "JobsToReportToUser", -// "JobsToReportToRepackForSuccess", -// "JobsToReportToRepackForFailure", -// "JobsToTransferForRepack" -//}; - // ================================ Retrieve Job Status ======================== enum class RetrieveJobStatus : uint8_t { diff --git a/scheduler/rdbms/postgres/RetrieveJobQueue.hpp b/scheduler/rdbms/postgres/RetrieveJobQueue.hpp index cac0a6d4dd1662b11f18f440c5c8c9b7be6607aa..733f544d40ddff351eca90cb8b54f446df54e336 100644 --- a/scheduler/rdbms/postgres/RetrieveJobQueue.hpp +++ b/scheduler/rdbms/postgres/RetrieveJobQueue.hpp @@ -447,9 +447,6 @@ public: stmt.bindBool(":IS_REPORTING", isReporting); stmt.bindString(":VID", vid); stmt.bindString(":ALTERNATE_VIDS", alternateVids); - // stmt.bindString(":DRIVE", drive); - // stmt.bindString(":HOST", host); - // stmt.bindString(":LOGICAL_LIBRARY", logical_library); stmt.bindString(":SRR_USERNAME", srrUsername); stmt.bindString(":SRR_HOST", srrHost); stmt.bindUint64(":SRR_TIME", srrTime); @@ -460,7 +457,6 @@ public: if (diskSystemName.has_value()) { stmt.bindString(":DISK_SYSTEM_NAME", diskSystemName.value()); } - //stmt.bindBool(":IS_FAILED", isFailed); if (!retrieveReportURL.empty()) { stmt.bindString(":RETRIEVE_REPORT_URL", retrieveReportURL); } else { @@ -524,18 +520,15 @@ public: params.add("retrieveErrorReportURL", retrieveErrorReportURL); params.add("failureLogs", failureLogs.value_or("")); - //params.add("isRepack", isRepack); - //params.add("repackReqId", repackReqId); /* Columns to be replaced by other DB columns than protobuf filled columns - * params.add("retrieveJobsProtoBuf", retrieveJobsProtoBuf); - * params.add("repackInfoProtoBuf", repackInfoProtoBuf); - */ + * params.add("retrieveJobsProtoBuf", retrieveJobsProtoBuf); + * params.add("repackInfoProtoBuf", repackInfoProtoBuf); + */ params.add("lifecycleTimings.creation_time", lifecycleTimings_creation_time); params.add("lifecycleTimings.first_selected_time", lifecycleTimings_first_selected_time); params.add("lifecycleTimings.completed_time", lifecycleTimings_completed_time); params.add("diskSystemName", diskSystemName.value_or("")); - //params.add("isFailed", isFailed); } static void insertBatch(rdbms::Conn &conn, diff --git a/scheduler/rdbms/postgres/RetrieveJobSummary.hpp b/scheduler/rdbms/postgres/RetrieveJobSummary.hpp index 34f784931f8429c6dcfaa974073afb351bd3cc0e..cc44d95a824a1eef339c069903a7c221251abb33 100644 --- a/scheduler/rdbms/postgres/RetrieveJobSummary.hpp +++ b/scheduler/rdbms/postgres/RetrieveJobSummary.hpp @@ -31,7 +31,6 @@ struct RetrieveJobSummaryRow { std::string vid; std::optional activity; uint64_t priority; - //schedulerdb::RetrieveJobStatus status; std::string mountPolicy; uint64_t minRetrieveRequestAge; std::optional diskSystemName; @@ -47,7 +46,6 @@ struct RetrieveJobSummaryRow { RetrieveJobSummaryRow& operator=(const rdbms::Rset& rset) { vid = rset.columnString("VID"); - //status = from_string(rset.columnString("STATUS")); activity = rset.columnOptionalString("ACTIVITY"); diskSystemName = rset.columnOptionalString("DISK_SYSTEM_NAME"); jobsCount = rset.columnUint64("JOBS_COUNT"); @@ -97,35 +95,9 @@ struct RetrieveJobSummaryRow { FROM RETRIEVE_QUEUE_SUMMARY WHERE VID = :VID )SQL"; - /* - std::string statusStr; - switch (type) { - case common::dataStructures::JobQueueType::JobsToTransferForUser: - statusStr = to_string(schedulerdb::RetrieveJobStatus::RJS_ToTransfer); - break; - case common::dataStructures::JobQueueType::JobsToReportToUser: - statusStr = to_string(schedulerdb::RetrieveJobStatus::RJS_ToReportToUserForFailure); - break; - case common::dataStructures::JobQueueType::JobsToReportToRepackForSuccess: - statusStr = to_string(schedulerdb::RetrieveJobStatus::RJS_ToReportToRepackForSuccess); - break; - case common::dataStructures::JobQueueType::JobsToReportToRepackForFailure: - statusStr = to_string(schedulerdb::RetrieveJobStatus::RJS_ToReportToRepackForFailure); - break; - case common::dataStructures::JobQueueType::JobsToTransferForRepack: - // not used for Retrieve - throw cta::exception::Exception( - "Did not expect queue type JobsToTransferForRepack in RetrieveJobSummaryRow::selectVid"); - break; - case common::dataStructures::JobQueueType::FailedJobs: - statusStr = to_string(schedulerdb::RetrieveJobStatus::RJS_Failed); - break; - } - */ auto stmt = conn.createStmt(sql); stmt.bindString(":VID", vid); - //stmt.bindString(":STATUS", statusStr); return stmt.executeQuery(); } /** diff --git a/scheduler/rdbms/postgres/Transaction.cpp b/scheduler/rdbms/postgres/Transaction.cpp index 1060ba13e62c09d1b1bd0c55fa2fac252007b6ee..d2da8c8a83649485eeed7957055330a6ebf10c10 100644 --- a/scheduler/rdbms/postgres/Transaction.cpp +++ b/scheduler/rdbms/postgres/Transaction.cpp @@ -69,7 +69,6 @@ void Transaction::takeNamedLock(std::string_view tapePoolString) { auto hash64 = static_cast(lock_id); auto hash32 = static_cast(hash64 ^ (hash64 >> 32)); - // debug: std::cout << "Hash value (64-bit): " << hash64 << std::endl; std::string sql = "SELECT PG_ADVISORY_XACT_LOCK(:HASH32::bigint)"; auto stmt = m_conn->createStmt(sql); stmt.bindUint64(":HASH32", hash32); diff --git a/statistics/DatabaseStatisticsService.hpp b/statistics/DatabaseStatisticsService.hpp index 4898269ab51f62621313eadbaa20cbe4bd623cb2..1994c13730135ac007c4f686d35c3278cf2e2417 100644 --- a/statistics/DatabaseStatisticsService.hpp +++ b/statistics/DatabaseStatisticsService.hpp @@ -66,18 +66,6 @@ class DatabaseStatisticsService: public StatisticsService { * The database connection of the database that will be used by the service */ cta::rdbms::Conn & m_conn; - - /** - * Saves the total file statistics in the database used by this service - * @param statistics the statistics to save - */ - // virtual void saveFileStatistics(const cta::statistics::Statistics & statistics); - - /** - * Saves the per-VO statistics in the database used by this service - * @param statistics the statistics to save - */ - // virtual void saveStatisticsPerVo(const cta::statistics::Statistics & statistics); }; } // namespace cta::statistics diff --git a/statistics/StatisticsUpdateCmd.cpp b/statistics/StatisticsUpdateCmd.cpp index 2fb916ef3e9ccea86b1643dd94718cce7399f2d5..2bb1ccb3e5b184a90395ae62c33bc6e2a89d36e4 100644 --- a/statistics/StatisticsUpdateCmd.cpp +++ b/statistics/StatisticsUpdateCmd.cpp @@ -32,7 +32,6 @@ namespace cta::statistics { // exceptionThrowingMain //------------------------------------------------------------------------------ int StatisticsUpdateCmd::exceptionThrowingMain(const int argc, char *const *const argv) { - // using namespace cta::catalogue; const StatisticsUpdateCmdLineArgs cmdLineArgs(argc, argv); if (cmdLineArgs.help) { diff --git a/tapeserver/castor/tape/tapeserver/daemon/MigrationReportPacker.hpp b/tapeserver/castor/tape/tapeserver/daemon/MigrationReportPacker.hpp index 8a88b8c4855bca924c42ae668633006aa953f72d..4602ab6c795a22352e7c87f134aeb203e083058e 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/MigrationReportPacker.hpp +++ b/tapeserver/castor/tape/tapeserver/daemon/MigrationReportPacker.hpp @@ -18,8 +18,6 @@ #pragma once #include "common/threading/BlockingQueue.hpp" -/*#include "castor/tape/tapeserver/daemon/ReportPackerInterface.hpp" -#include "castor/tape/tapeserver/drive/DriveInterface.hpp"*/ #include "tapeserver/castor/tape/tapeserver/daemon/ReportPackerInterface.hpp" #include "tapeserver/castor/tape/tapeserver/drive/DriveInterface.hpp" #include "scheduler/ArchiveMount.hpp" diff --git a/tapeserver/castor/tape/tapeserver/daemon/RecallMemoryManager.cpp b/tapeserver/castor/tape/tapeserver/daemon/RecallMemoryManager.cpp index 21a946276bb36a144885e221957c5fefd47c9af0..6b3de2c5312a3a56d0f75a146b4afbe517105abe 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/RecallMemoryManager.cpp +++ b/tapeserver/castor/tape/tapeserver/daemon/RecallMemoryManager.cpp @@ -118,8 +118,6 @@ MemBlock* RecallMemoryManager::getFreeBlock() { // RecallMemoryManager::releaseBlock //------------------------------------------------------------------------------ void RecallMemoryManager::releaseBlock(MemBlock* mb) { - //m_lc.pushOrReplace(cta::log::Param("blockId", mb->m_memoryBlockId)); - //m_lc.log(cta::log::DEBUG, "RecallMemoryManager A block has been released"); mb->reset(); m_freeBlocks.push(mb); } diff --git a/tapeserver/castor/tape/tapeserver/daemon/TapeReadSingleThread.cpp b/tapeserver/castor/tape/tapeserver/daemon/TapeReadSingleThread.cpp index 2a43b1881358f5665c0d6283880dab6d23a91fb1..e1e8324d8af2734b906addb6badb1ec4a7434579 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/TapeReadSingleThread.cpp +++ b/tapeserver/castor/tape/tapeserver/daemon/TapeReadSingleThread.cpp @@ -235,8 +235,6 @@ std::unique_ptr castor::tape::tapeserver::daemon::TapeReadSingleThread::openReadSession() { try { auto readSession = castor::tape::tapeFile::ReadSessionFactory::create(m_drive, m_volInfo, m_useLbp); - // m_logContext.log(cta::log::DEBUG, "Created tapeFile::ReadSession with success"); - return readSession; } catch (cta::exception::Exception& ex) { cta::log::ScopedParamContainer scoped(m_logContext); diff --git a/tapeserver/castor/tape/tapeserver/daemon/TapeWriteTask.cpp b/tapeserver/castor/tape/tapeserver/daemon/TapeWriteTask.cpp index 64c32a2a7232c3ce319986823d0dc509686ee864..c2f17379f9cedbbd8ee92458cc5722257941fdf9 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/TapeWriteTask.cpp +++ b/tapeserver/castor/tape/tapeserver/daemon/TapeWriteTask.cpp @@ -395,7 +395,6 @@ TapeWriteTask::openFileWriter(const std::unique_ptrm_ulSsid = 0; record.m_RChunk.m_pChunk->mc_ulLow = 0; record.m_RChunk.m_pChunk->m_data.m_uiDataLen = uiDataLen; - record.m_RChunk.m_pChunk->m_data.m_pcDataVal = pcVolLabel;//new char[LIMITS::MMAXCHK]; + record.m_RChunk.m_pChunk->m_data.m_pcDataVal = pcVolLabel; // LIMITS::MMAXCHK memset(record.m_tcHandler, 0x20, sizeof(record.m_tcHandler)); record.m_ulVolid = volLabel.m_ulVolId; diff --git a/tapeserver/castor/tape/tapeserver/file/OsmFileStructure.hpp b/tapeserver/castor/tape/tapeserver/file/OsmFileStructure.hpp index fb43579a4c42c441d4c884f61886c036faf04743..097bde3f23160376629281f531fdfedcd62d7a13 100644 --- a/tapeserver/castor/tape/tapeserver/file/OsmFileStructure.hpp +++ b/tapeserver/castor/tape/tapeserver/file/OsmFileStructure.hpp @@ -82,9 +82,7 @@ public: * @return the logical block protection method */ uint8_t getLBPMethod() const { - // SCSI::logicBlockProtectionMethod::DoNotUse - // SCSI::logicBlockProtectionMethod::ReedSolomon - // SCSI::logicBlockProtectionMethod::CRC32C + // Possibilities are DoNotUse, ReedSolomon, CRC32C return SCSI::logicBlockProtectionMethod::CRC32C; } diff --git a/tapeserver/castor/tape/tapeserver/file/OsmXdrStructure.hpp b/tapeserver/castor/tape/tapeserver/file/OsmXdrStructure.hpp index 389f919dbef00504a28531c1bf85077672939917..30b17878f93f9bec593ff9739f383130e2c43119 100644 --- a/tapeserver/castor/tape/tapeserver/file/OsmXdrStructure.hpp +++ b/tapeserver/castor/tape/tapeserver/file/OsmXdrStructure.hpp @@ -132,7 +132,7 @@ public: if(!xdr_u_long(xdrs, &objp->m_ulVolId)) { return (FALSE); } - // #define NSR_LENGTH = 64 + // NSR_LENGTH = 64 if((objp->bFree && objp->m_pcVolName == nullptr) || !xdr_string(xdrs, &objp->m_pcVolName, 64)) { return (FALSE); } diff --git a/xroot_plugins/AdminCmdStream.cpp b/xroot_plugins/AdminCmdStream.cpp index 9d8bf786035d347dc209097be495ac8a9f63086b..a6bd618b27eb46ff38f15d70b9c977a78e894b2d 100644 --- a/xroot_plugins/AdminCmdStream.cpp +++ b/xroot_plugins/AdminCmdStream.cpp @@ -47,7 +47,6 @@ #include "XrdCtaVirtualOrganizationLs.hpp" #include "frontend/common/PbException.hpp" -// #include "frontend/common/GrpcEndpoint.hpp" #include "frontend/common/AdminCmd.hpp" #include "frontend/common/RequestTracker.hpp"