Skip to content
Snippets Groups Projects
Commit 0f968e64 authored by Michael Davis's avatar Michael Davis
Browse files

[frontend] Renames CTA_* xattrs to sys.* xattrs

Renames CTA_ArchiveFileID to sys.archive.file_id
Renames CTA_StorageClass to sys.archive.storage.class
parent d3119274
No related branches found
No related tags found
No related merge requests found
...@@ -239,11 +239,11 @@ void fillNotification(cta::eos::Notification &notification, int argc, const char ...@@ -239,11 +239,11 @@ void fillNotification(cta::eos::Notification &notification, int argc, const char
} }
else if(argstr == "--diskfilepath") notification.mutable_file()->set_lpath(argval); else if(argstr == "--diskfilepath") notification.mutable_file()->set_lpath(argval);
else if(argstr == "--storageclass") { else if(argstr == "--storageclass") {
google::protobuf::MapPair<std::string,std::string> sc("CTA_StorageClass", argval); google::protobuf::MapPair<std::string,std::string> sc("sys.archive.storage_class", argval);
notification.mutable_file()->mutable_xattr()->insert(sc); notification.mutable_file()->mutable_xattr()->insert(sc);
} }
else if(argstr == "--id") { else if(argstr == "--id") {
google::protobuf::MapPair<std::string,std::string> id("CTA_ArchiveFileId", argval); google::protobuf::MapPair<std::string,std::string> id("sys.archive.file_id", argval);
notification.mutable_file()->mutable_xattr()->insert(id); notification.mutable_file()->mutable_xattr()->insert(id);
} }
else throw std::runtime_error("Unrecognised key " + argstr); else throw std::runtime_error("Unrecognised key " + argstr);
......
...@@ -264,7 +264,7 @@ fi ...@@ -264,7 +264,7 @@ fi
eos mkdir ${CTA_TEST_DIR} eos mkdir ${CTA_TEST_DIR}
eos chmod 555 ${CTA_TEST_DIR} eos chmod 555 ${CTA_TEST_DIR}
eos attr set sys.acl=g:eosusers:rwx!d,u:poweruser1:rwx+dp,u:poweruser2:rwx+dp /eos/ctaeos/cta eos attr set sys.acl=g:eosusers:rwx!d,u:poweruser1:rwx+dp,u:poweruser2:rwx+dp /eos/ctaeos/cta
eos attr set CTA_StorageClass=ctaStorageClass ${CTA_TEST_DIR} eos attr set sys.archive.storage_class=ctaStorageClass ${CTA_TEST_DIR}
# Link the attributes of CTA worklow directory to the test directory # Link the attributes of CTA worklow directory to the test directory
eos attr link ${CTA_WF_DIR} ${CTA_TEST_DIR} eos attr link ${CTA_WF_DIR} ${CTA_TEST_DIR}
......
...@@ -5,7 +5,7 @@ eos mkdir ${PREPROD_DIR} ...@@ -5,7 +5,7 @@ eos mkdir ${PREPROD_DIR}
eos chmod 555 ${PREPROD_DIR} eos chmod 555 ${PREPROD_DIR}
eos attr set sys.acl=g:eosusers:rwx!d,u:poweruser1:rwx+dp,u:poweruser2:rwx+dp ${PREPROD_DIR} eos attr set sys.acl=g:eosusers:rwx!d,u:poweruser1:rwx+dp,u:poweruser2:rwx+dp ${PREPROD_DIR}
eos attr set CTA_StorageClass=ctaStorageClass ${PREPROD_DIR} eos attr set sys.archive.storage_class=ctaStorageClass ${PREPROD_DIR}
eos attr set sys.workflow.sync::create.default="proto" ${PREPROD_DIR} eos attr set sys.workflow.sync::create.default="proto" ${PREPROD_DIR}
eos attr set sys.workflow.sync::closew.default="proto" ${PREPROD_DIR} eos attr set sys.workflow.sync::closew.default="proto" ${PREPROD_DIR}
......
...@@ -331,13 +331,13 @@ void RequestMessage::processCREATE(const cta::eos::Notification &notification, c ...@@ -331,13 +331,13 @@ void RequestMessage::processCREATE(const cta::eos::Notification &notification, c
requester.name = notification.cli().user().username(); requester.name = notification.cli().user().username();
requester.group = notification.cli().user().groupname(); requester.group = notification.cli().user().groupname();
const auto storageClassItor = notification.file().xattr().find("CTA_StorageClass"); const auto storageClassItor = notification.file().xattr().find("sys.archive_storage_class");
if(notification.file().xattr().end() == storageClassItor) { if(notification.file().xattr().end() == storageClassItor) {
throw PbException(std::string(__FUNCTION__) + ": CTA_StorageClass extended attribute is not set"); throw PbException(std::string(__FUNCTION__) + ": sys.archive_storage_class extended attribute is not set");
} }
const std::string storageClass = storageClassItor->second; const std::string storageClass = storageClassItor->second;
if(storageClass.empty()) { if(storageClass.empty()) {
throw PbException(std::string(__FUNCTION__) + ": CTA_StorageClass extended attribute is set to an empty string"); throw PbException(std::string(__FUNCTION__) + ": sys.archive_storage_class extended attribute is set to an empty string");
} }
cta::utils::Timer t; cta::utils::Timer t;
...@@ -353,10 +353,10 @@ void RequestMessage::processCREATE(const cta::eos::Notification &notification, c ...@@ -353,10 +353,10 @@ void RequestMessage::processCREATE(const cta::eos::Notification &notification, c
m_lc.log(cta::log::INFO, "In RequestMessage::processCREATE(): assigning new archive file ID."); m_lc.log(cta::log::INFO, "In RequestMessage::processCREATE(): assigning new archive file ID.");
// Set ArchiveFileId in xattrs // Set ArchiveFileId in xattrs
response.mutable_xattr()->insert(google::protobuf::MapPair<std::string,std::string>("CTA_ArchiveFileId", std::to_string(archiveFileId))); response.mutable_xattr()->insert(google::protobuf::MapPair<std::string,std::string>("sys.archive.file_id", std::to_string(archiveFileId)));
// Set the storage class in xattrs // Set the storage class in xattrs
response.mutable_xattr()->insert(google::protobuf::MapPair<std::string,std::string>("CTA_StorageClass", storageClass)); response.mutable_xattr()->insert(google::protobuf::MapPair<std::string,std::string>("sys.archive_storage_class", storageClass));
// Set response type // Set response type
response.set_type(cta::xrd::Response::RSP_SUCCESS); response.set_type(cta::xrd::Response::RSP_SUCCESS);
...@@ -374,9 +374,9 @@ void RequestMessage::processCLOSEW(const cta::eos::Notification &notification, c ...@@ -374,9 +374,9 @@ void RequestMessage::processCLOSEW(const cta::eos::Notification &notification, c
checkIsNotEmptyString(notification.transport().report_url(), "notification.transport.report_url"); checkIsNotEmptyString(notification.transport().report_url(), "notification.transport.report_url");
// Unpack message // Unpack message
const auto storageClassItor = notification.file().xattr().find("CTA_StorageClass"); const auto storageClassItor = notification.file().xattr().find("sys.archive_storage_class");
if(notification.file().xattr().end() == storageClassItor) { if(notification.file().xattr().end() == storageClassItor) {
throw PbException(std::string(__FUNCTION__) + ": Failed to find the extended attribute named CTA_StorageClass"); throw PbException(std::string(__FUNCTION__) + ": Failed to find the extended attribute named sys.archive_storage_class");
} }
cta::common::dataStructures::ArchiveRequest request; cta::common::dataStructures::ArchiveRequest request;
...@@ -399,9 +399,9 @@ void RequestMessage::processCLOSEW(const cta::eos::Notification &notification, c ...@@ -399,9 +399,9 @@ void RequestMessage::processCLOSEW(const cta::eos::Notification &notification, c
// CTA Archive ID is an EOS extended attribute, i.e. it is stored as a string, which // CTA Archive ID is an EOS extended attribute, i.e. it is stored as a string, which
// must be converted to a valid uint64_t // must be converted to a valid uint64_t
const auto archiveFileIdItor = notification.file().xattr().find("CTA_ArchiveFileId"); const auto archiveFileIdItor = notification.file().xattr().find("sys.archive.file_id");
if(notification.file().xattr().end() == archiveFileIdItor) { if(notification.file().xattr().end() == archiveFileIdItor) {
throw PbException(std::string(__FUNCTION__) + ": Failed to find the extended attribute named CTA_ArchiveFileId"); throw PbException(std::string(__FUNCTION__) + ": Failed to find the extended attribute named sys.archive.file_id");
} }
const std::string archiveFileIdStr = archiveFileIdItor->second; const std::string archiveFileIdStr = archiveFileIdItor->second;
uint64_t archiveFileId = 0; uint64_t archiveFileId = 0;
...@@ -449,9 +449,9 @@ void RequestMessage::processPREPARE(const cta::eos::Notification &notification, ...@@ -449,9 +449,9 @@ void RequestMessage::processPREPARE(const cta::eos::Notification &notification,
// CTA Archive ID is an EOS extended attribute, i.e. it is stored as a string, which must be // CTA Archive ID is an EOS extended attribute, i.e. it is stored as a string, which must be
// converted to a valid uint64_t // converted to a valid uint64_t
const auto archiveFileIdItor = notification.file().xattr().find("CTA_ArchiveFileId"); const auto archiveFileIdItor = notification.file().xattr().find("sys.archive.file_id");
if(notification.file().xattr().end() == archiveFileIdItor) { if(notification.file().xattr().end() == archiveFileIdItor) {
throw PbException(std::string(__FUNCTION__) + ": Failed to find the extended attribute named CTA_ArchiveFileId"); throw PbException(std::string(__FUNCTION__) + ": Failed to find the extended attribute named sys.archive.file_id");
} }
const std::string archiveFileIdStr = archiveFileIdItor->second; const std::string archiveFileIdStr = archiveFileIdItor->second;
if((request.archiveFileID = strtoul(archiveFileIdStr.c_str(), nullptr, 10)) == 0) if((request.archiveFileID = strtoul(archiveFileIdStr.c_str(), nullptr, 10)) == 0)
...@@ -498,9 +498,9 @@ void RequestMessage::processABORT_PREPARE(const cta::eos::Notification &notifica ...@@ -498,9 +498,9 @@ void RequestMessage::processABORT_PREPARE(const cta::eos::Notification &notifica
// CTA Archive ID is an EOS extended attribute, i.e. it is stored as a string, which must be // CTA Archive ID is an EOS extended attribute, i.e. it is stored as a string, which must be
// converted to a valid uint64_t // converted to a valid uint64_t
const auto archiveFileIdItor = notification.file().xattr().find("CTA_ArchiveFileId"); const auto archiveFileIdItor = notification.file().xattr().find("sys.archive.file_id");
if(notification.file().xattr().end() == archiveFileIdItor) { if(notification.file().xattr().end() == archiveFileIdItor) {
throw PbException(std::string(__FUNCTION__) + ": Failed to find the extended attribute named CTA_ArchiveFileId"); throw PbException(std::string(__FUNCTION__) + ": Failed to find the extended attribute named sys.archive.file_id");
} }
const std::string archiveFileIdStr = archiveFileIdItor->second; const std::string archiveFileIdStr = archiveFileIdItor->second;
if((request.archiveFileID = strtoul(archiveFileIdStr.c_str(), nullptr, 10)) == 0) if((request.archiveFileID = strtoul(archiveFileIdStr.c_str(), nullptr, 10)) == 0)
...@@ -550,9 +550,9 @@ void RequestMessage::processDELETE(const cta::eos::Notification &notification, c ...@@ -550,9 +550,9 @@ void RequestMessage::processDELETE(const cta::eos::Notification &notification, c
// CTA Archive ID is an EOS extended attribute, i.e. it is stored as a string, which // CTA Archive ID is an EOS extended attribute, i.e. it is stored as a string, which
// must be converted to a valid uint64_t // must be converted to a valid uint64_t
const auto archiveFileIdItor = notification.file().xattr().find("CTA_ArchiveFileId"); const auto archiveFileIdItor = notification.file().xattr().find("sys.archive.file_id");
if(notification.file().xattr().end() == archiveFileIdItor) { if(notification.file().xattr().end() == archiveFileIdItor) {
throw PbException(std::string(__FUNCTION__) + ": Failed to find the extended attribute named CTA_ArchiveFileId"); throw PbException(std::string(__FUNCTION__) + ": Failed to find the extended attribute named sys.archive.file_id");
} }
const std::string archiveFileIdStr = archiveFileIdItor->second; const std::string archiveFileIdStr = archiveFileIdItor->second;
if((request.archiveFileID = strtoul(archiveFileIdStr.c_str(), nullptr, 10)) == 0) if((request.archiveFileID = strtoul(archiveFileIdStr.c_str(), nullptr, 10)) == 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment