Commit fb6c69ba authored by Steven Murray's avatar Steven Murray
Browse files

Removed unused method Catalogue::prepareToRetrieveFileByDiskFileId()

parent 92c49e77
......@@ -188,30 +188,6 @@ public:
const common::dataStructures::UserIdentity &user,
log::LogContext &lc) = 0;
/**
* Prepares for a file retrieval by returning the information required to
* queue the associated retrieve request(s).
*
* @param diskInstanceName The name of the instance from where the retrieval
* request originated
* @param diskFileId The identifier of the source disk file which is unique
* within it's host disk system. Two files from different disk systems may
* have the same identifier. The combination of diskInstanceName and
* diskFileId must be globally unique, in other words unique within the CTA
* catalogue.
* @param user The user for whom the file is to be retrieved. This will be
* used by the Catalogue to determine the mount policy to be used when
* retrieving the file.
* @param lc The log context.
*
* @return The information required to queue the associated retrieve request(s).
*/
virtual common::dataStructures::RetrieveFileQueueCriteria prepareToRetrieveFileByDiskFileId(
const std::string &diskInstanceName,
const std::string &diskFileId,
const common::dataStructures::UserIdentity &user,
log::LogContext &lc) = 0;
/**
* Notifies the CTA catalogue that the specified tape has been mounted in
* order to retrieve files.
......
......@@ -93,10 +93,6 @@ public:
return retryOnLostConnection(m_log, [&]{return m_catalogue->prepareToRetrieveFile(diskInstanceName, archiveFileId, user, lc);}, m_maxTriesToConnect);
}
common::dataStructures::RetrieveFileQueueCriteria prepareToRetrieveFileByDiskFileId(const std::string &diskInstanceName, const std::string &diskFileId, const common::dataStructures::UserIdentity &user, log::LogContext &lc) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->prepareToRetrieveFileByDiskFileId(diskInstanceName, diskFileId, user, lc);}, m_maxTriesToConnect);
}
void tapeMountedForRetrieve(const std::string &vid, const std::string &drive) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->tapeMountedForRetrieve(vid, drive);}, m_maxTriesToConnect);
}
......
This diff is collapsed.
......@@ -100,7 +100,6 @@ public:
common::dataStructures::ArchiveFileQueueCriteria getArchiveFileQueueCriteria(const std::string &diskInstanceName,
const std::string &storageClassName, const common::dataStructures::UserIdentity &user) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
common::dataStructures::RetrieveFileQueueCriteria prepareToRetrieveFile(const std::string& instanceName, const uint64_t archiveFileId, const common::dataStructures::UserIdentity& user, log::LogContext &lc) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
common::dataStructures::RetrieveFileQueueCriteria prepareToRetrieveFileByDiskFileId(const std::string &diskInstanceName, const std::string &diskFileId, const common::dataStructures::UserIdentity &user, log::LogContext &lc) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void reclaimTape(const common::dataStructures::SecurityIdentity& admin, const std::string& vid) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void setTapeDisabled(const common::dataStructures::SecurityIdentity& admin, const std::string& vid, const bool disabledValue) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void setTapeFull(const common::dataStructures::SecurityIdentity& admin, const std::string& vid, const bool fullValue) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
......
......@@ -4385,65 +4385,6 @@ common::dataStructures::RetrieveFileQueueCriteria RdbmsCatalogue::prepareToRetri
}
}
//------------------------------------------------------------------------------
// prepareToRetrieveFileByDiskFileId
//------------------------------------------------------------------------------
common::dataStructures::RetrieveFileQueueCriteria RdbmsCatalogue::prepareToRetrieveFileByDiskFileId(
const std::string &diskInstanceName,
const std::string &diskFileId,
const common::dataStructures::UserIdentity &user,
log::LogContext &lc) {
try {
cta::utils::Timer t;
auto conn = m_connPool.getConn();
const auto getConnTime = t.secs(utils::Timer::resetCounter);
auto archiveFile = getArchiveFileToRetrieveByDiskFileId(conn, diskInstanceName, diskFileId);
const auto getArchiveFileTime = t.secs(utils::Timer::resetCounter);
if(nullptr == archiveFile.get()) {
exception::UserError ex;
ex.getMessage() << "No tape files available for archive file with disk instance name " << diskInstanceName <<
" and disk file ID" << diskFileId;
throw ex;
}
t.reset();
const RequesterAndGroupMountPolicies mountPolicies = getMountPolicies(conn, diskInstanceName, user.name,
user.group);
const auto getMountPoliciesTime = t.secs(utils::Timer::resetCounter);
log::ScopedParamContainer spc(lc);
spc.add("getConnTime", getConnTime)
.add("getArchiveFileTime", getArchiveFileTime)
.add("getMountPoliciesTime", getMountPoliciesTime);
lc.log(log::INFO, "Catalogue::prepareToRetrieve internal timings");
// Requester mount policies overrule requester group mount policies
common::dataStructures::MountPolicy mountPolicy;
if(!mountPolicies.requesterMountPolicies.empty()) {
mountPolicy = mountPolicies.requesterMountPolicies.front();
} else if(!mountPolicies.requesterGroupMountPolicies.empty()) {
mountPolicy = mountPolicies.requesterGroupMountPolicies.front();
} else {
exception::UserError ue;
ue.getMessage() << "Cannot retrieve file because there are no mount rules for the requester or their group:" <<
" diskInstanceName=" << diskInstanceName << " diskFileId=" << diskFileId << " archiveFileId=" <<
archiveFile->archiveFileID << " path=" << archiveFile->diskFileInfo.path << " requester=" << diskInstanceName <<
":" << user.name << ":" << user.group;
throw ue;
}
common::dataStructures::RetrieveFileQueueCriteria criteria;
criteria.archiveFile = *archiveFile;
criteria.mountPolicy = mountPolicy;
return criteria;
} catch(exception::UserError &) {
throw;
} catch(exception::Exception &ex) {
ex.getMessage().str(std::string(__FUNCTION__) + ": " + ex.getMessage().str());
throw;
}
}
//------------------------------------------------------------------------------
// getMountPolicies
//------------------------------------------------------------------------------
......
......@@ -185,32 +185,6 @@ public:
const common::dataStructures::UserIdentity &user,
log::LogContext &lc) override;
/**
* Prepares for a file retrieval by returning the information required to
* queue the associated retrieve request(s).
*
* @param diskInstanceName The name of the instance from where the retrieval
* request originated
* @param diskFileId The identifier of the source disk file which is unique
* within it's host disk system. Two files from different disk systems may
* have the same identifier. The combination of diskInstanceName and
* diskFileId must be globally unique, in other words unique within the CTA
* catalogue.
* @param archiveFileId The unique identifier of the archived file that is
* to be retrieved.
* @param user The user for whom the file is to be retrieved. This will be
* used by the Catalogue to determine the mount policy to be used when
* retrieving the file.
* @param lc The log context.
*
* @return The information required to queue the associated retrieve request(s).
*/
common::dataStructures::RetrieveFileQueueCriteria prepareToRetrieveFileByDiskFileId(
const std::string &diskInstanceName,
const std::string &diskFileId,
const common::dataStructures::UserIdentity &user,
log::LogContext &lc) override;
/**
* Notifies the CTA catalogue that the specified tape has been mounted in
* order to retrieve files.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment