diff --git a/xroot_plugins/CMakeLists.txt b/xroot_plugins/CMakeLists.txt index 0ea81be879f3276aebe12cd61aac5ec1aba2cdc3..9731072e261f1e6ca20f085f862aeccf066de628 100644 --- a/xroot_plugins/CMakeLists.txt +++ b/xroot_plugins/CMakeLists.txt @@ -35,7 +35,7 @@ include_directories(${CMAKE_BINARY_DIR}/eos_cta ${PROTOBUF3_INCLUDE_DIRS}) # # XRootD SSI plugin for CTA Frontend # -add_library(XrdSsiCta MODULE XrdSsiCtaServiceProvider.cpp XrdSsiCtaRequestProc.cpp XrdSsiCtaRequestMessage.cpp ../cmdline/CtaAdminCmdParse.cpp) +add_library(XrdSsiCta MODULE XrdSsiCtaServiceProvider.cpp XrdSsiCtaRequestProc.cpp XrdSsiCtaRequestMessage.cpp ../cmdline/CtaAdminCmdParse.cpp Namespace.cpp) target_link_libraries(XrdSsiCta XrdSsi-4 XrdSsiLib XrdSsiPbEosCta ctascheduler ctacommon ctaobjectstore ctacatalogue) set_property (TARGET XrdSsiCta APPEND PROPERTY INSTALL_RPATH ${PROTOBUF3_RPATH}) if (OCCI_SUPPORT) diff --git a/xroot_plugins/Namespace.cpp b/xroot_plugins/Namespace.cpp new file mode 100644 index 0000000000000000000000000000000000000000..aaff6909170e291ac5b39bc05180b6f68e01ce92 --- /dev/null +++ b/xroot_plugins/Namespace.cpp @@ -0,0 +1,25 @@ +/*! + * @project The CERN Tape Archive (CTA) + * @brief CTA Frontend Tape Namespace query class + * @copyright Copyright 2019 CERN + * @license This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, 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. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include <string> +#include <xroot_plugins/Namespace.hpp> + + +std::string cta::Namespace::getPath(const std::string &diskFileId) { + return "/path/to/file/" + diskFileId; +} diff --git a/xroot_plugins/Namespace.hpp b/xroot_plugins/Namespace.hpp new file mode 100644 index 0000000000000000000000000000000000000000..61d61a53c650372128ac71800ab1021d28ac3a06 --- /dev/null +++ b/xroot_plugins/Namespace.hpp @@ -0,0 +1,31 @@ +/*! + * @project The CERN Tape Archive (CTA) + * @brief CTA Frontend Tape Namespace query class + * @copyright Copyright 2019 CERN + * @license This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, 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. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#pragma once + +namespace cta { + +class Namespace +{ +public: + std::string getPath(const std::string &diskFileId); + +//private: +}; + +} // namespace cta diff --git a/xroot_plugins/XrdCtaTapeFileLs.hpp b/xroot_plugins/XrdCtaTapeFileLs.hpp index 3563e177df31fd0568ebaed6b5f4b401fe4d66bb..eb11778313f98551cf991f93cfc1265fe047080a 100644 --- a/xroot_plugins/XrdCtaTapeFileLs.hpp +++ b/xroot_plugins/XrdCtaTapeFileLs.hpp @@ -20,6 +20,7 @@ #include <xroot_plugins/XrdCtaStream.hpp> #include <xroot_plugins/XrdSsiCtaRequestMessage.hpp> +#include <xroot_plugins/Namespace.hpp> #include <common/checksum/ChecksumBlobSerDeser.hpp> @@ -50,6 +51,7 @@ private: virtual int fillBuffer(XrdSsiPb::OStreamBuffer<Data> *streambuf); catalogue::ArchiveFileItor m_tapeFileItor; //!< Iterator across files which have been archived + Namespace m_namespace; #if 0 bool m_isSummary; //!< Full listing or short summary? bool m_isSummaryDone; //!< Summary has been sent @@ -146,10 +148,10 @@ int TapeFileLsStream::fillBuffer(XrdSsiPb::OStreamBuffer<Data> *streambuf) { // Disk file auto df = record.mutable_tfls_item()->mutable_df(); df->set_disk_id(archiveFile.diskFileId); + df->set_path(m_namespace.getPath(archiveFile.diskFileId)); df->set_disk_instance(archiveFile.diskInstance); df->mutable_owner_id()->set_uid(archiveFile.diskFileInfo.owner_uid); df->mutable_owner_id()->set_gid(archiveFile.diskFileInfo.gid); - df->set_path(archiveFile.diskFileInfo.path); // Tape file auto tf = record.mutable_tfls_item()->mutable_tf();