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

Renamed ArchiveFileSearchCriteria to TapeFileSearchCriteria

parent d5ab0b57
......@@ -19,7 +19,7 @@
#pragma once
#include "catalogue/ArchiveFileItor.hpp"
#include "catalogue/ArchiveFileSearchCriteria.hpp"
#include "catalogue/TapeFileSearchCriteria.hpp"
#include "catalogue/TapeFileWritten.hpp"
#include "catalogue/TapeForWriting.hpp"
#include "catalogue/TapeSearchCriteria.hpp"
......@@ -481,7 +481,7 @@ public:
* @return An iterator over the list of archive files.
*/
virtual std::unique_ptr<ArchiveFileItor> getArchiveFileItor(
const ArchiveFileSearchCriteria &searchCriteria = ArchiveFileSearchCriteria(),
const TapeFileSearchCriteria &searchCriteria = TapeFileSearchCriteria(),
const uint64_t nbArchiveFilesToPrefetch = 1000) const = 0;
/**
......@@ -492,7 +492,7 @@ public:
* @return The summary.
*/
virtual common::dataStructures::ArchiveFileSummary getTapeFileSummary(
const ArchiveFileSearchCriteria &searchCriteria = ArchiveFileSearchCriteria()) const = 0;
const TapeFileSearchCriteria &searchCriteria = TapeFileSearchCriteria()) const = 0;
/**
* Returns the archive file with the specified unique identifier.
......
......@@ -5021,7 +5021,7 @@ TEST_P(cta_catalogue_CatalogueTest, prepareToRetrieveFile) {
TEST_P(cta_catalogue_CatalogueTest, getArchiveFileItor_zero_prefetch) {
using namespace cta;
ASSERT_THROW(m_catalogue->getArchiveFileItor(catalogue::ArchiveFileSearchCriteria(), 0), exception::Exception);
ASSERT_THROW(m_catalogue->getArchiveFileItor(catalogue::TapeFileSearchCriteria(), 0), exception::Exception);
}
TEST_P(cta_catalogue_CatalogueTest, fileWrittenToTape_many_archive_files) {
......@@ -5169,7 +5169,7 @@ TEST_P(cta_catalogue_CatalogueTest, fileWrittenToTape_many_archive_files) {
std::list<uint64_t> prefetches = {1, 2, 3, nbArchiveFiles - 1, nbArchiveFiles, nbArchiveFiles+1, nbArchiveFiles*2};
for(auto prefetch: prefetches) {
{
catalogue::ArchiveFileSearchCriteria searchCriteria;
catalogue::TapeFileSearchCriteria searchCriteria;
searchCriteria.archiveFileId = 1;
searchCriteria.diskInstance = storageClass.diskInstance;
searchCriteria.diskFileId = std::to_string(12345678);
......@@ -5201,7 +5201,7 @@ TEST_P(cta_catalogue_CatalogueTest, fileWrittenToTape_many_archive_files) {
}
{
const auto archiveFileItor = m_catalogue->getArchiveFileItor(catalogue::ArchiveFileSearchCriteria(), prefetch);
const auto archiveFileItor = m_catalogue->getArchiveFileItor(catalogue::TapeFileSearchCriteria(), prefetch);
std::map<uint64_t, common::dataStructures::ArchiveFile> m = archiveFileItorToMap(*archiveFileItor);
ASSERT_EQ(nbArchiveFiles, m.size());
......@@ -5280,7 +5280,7 @@ TEST_P(cta_catalogue_CatalogueTest, fileWrittenToTape_many_archive_files) {
}
{
catalogue::ArchiveFileSearchCriteria searchCriteria;
catalogue::TapeFileSearchCriteria searchCriteria;
searchCriteria.archiveFileId = 10;
const auto archiveFileItor = m_catalogue->getArchiveFileItor(searchCriteria, prefetch);
const auto m = archiveFileItorToMap(*archiveFileItor);
......@@ -5295,7 +5295,7 @@ TEST_P(cta_catalogue_CatalogueTest, fileWrittenToTape_many_archive_files) {
}
{
catalogue::ArchiveFileSearchCriteria searchCriteria;
catalogue::TapeFileSearchCriteria searchCriteria;
searchCriteria.diskInstance = storageClass.diskInstance;
const auto archiveFileItor = m_catalogue->getArchiveFileItor(searchCriteria, prefetch);
const auto m = archiveFileItorToMap(*archiveFileItor);
......@@ -5308,7 +5308,7 @@ TEST_P(cta_catalogue_CatalogueTest, fileWrittenToTape_many_archive_files) {
}
{
catalogue::ArchiveFileSearchCriteria searchCriteria;
catalogue::TapeFileSearchCriteria searchCriteria;
searchCriteria.diskFileId = "12345687";
const auto archiveFileItor = m_catalogue->getArchiveFileItor(searchCriteria, prefetch);
const auto m = archiveFileItorToMap(*archiveFileItor);
......@@ -5322,7 +5322,7 @@ TEST_P(cta_catalogue_CatalogueTest, fileWrittenToTape_many_archive_files) {
}
{
catalogue::ArchiveFileSearchCriteria searchCriteria;
catalogue::TapeFileSearchCriteria searchCriteria;
searchCriteria.diskFilePath = "/public_dir/public_file_10";
const auto archiveFileItor = m_catalogue->getArchiveFileItor(searchCriteria, prefetch);
const auto m = archiveFileItorToMap(*archiveFileItor);
......@@ -5336,7 +5336,7 @@ TEST_P(cta_catalogue_CatalogueTest, fileWrittenToTape_many_archive_files) {
}
{
catalogue::ArchiveFileSearchCriteria searchCriteria;
catalogue::TapeFileSearchCriteria searchCriteria;
searchCriteria.diskFileUser = "public_disk_user";
const auto archiveFileItor = m_catalogue->getArchiveFileItor(searchCriteria, prefetch);
const auto m = archiveFileItorToMap(*archiveFileItor);
......@@ -5349,7 +5349,7 @@ TEST_P(cta_catalogue_CatalogueTest, fileWrittenToTape_many_archive_files) {
}
{
catalogue::ArchiveFileSearchCriteria searchCriteria;
catalogue::TapeFileSearchCriteria searchCriteria;
searchCriteria.diskFileGroup = "public_disk_group";
const auto archiveFileItor = m_catalogue->getArchiveFileItor(searchCriteria, prefetch);
const auto m = archiveFileItorToMap(*archiveFileItor);
......@@ -5362,7 +5362,7 @@ TEST_P(cta_catalogue_CatalogueTest, fileWrittenToTape_many_archive_files) {
}
{
catalogue::ArchiveFileSearchCriteria searchCriteria;
catalogue::TapeFileSearchCriteria searchCriteria;
searchCriteria.storageClass = "storage_class";
const auto archiveFileItor = m_catalogue->getArchiveFileItor(searchCriteria, prefetch);
const auto m = archiveFileItorToMap(*archiveFileItor);
......@@ -5375,7 +5375,7 @@ TEST_P(cta_catalogue_CatalogueTest, fileWrittenToTape_many_archive_files) {
}
{
catalogue::ArchiveFileSearchCriteria searchCriteria;
catalogue::TapeFileSearchCriteria searchCriteria;
const auto archiveFileItor = m_catalogue->getArchiveFileItor(searchCriteria, prefetch);
const auto m = archiveFileItorToMap(*archiveFileItor);
ASSERT_EQ(nbArchiveFiles, m.size());
......@@ -5387,7 +5387,7 @@ TEST_P(cta_catalogue_CatalogueTest, fileWrittenToTape_many_archive_files) {
}
{
catalogue::ArchiveFileSearchCriteria searchCriteria;
catalogue::TapeFileSearchCriteria searchCriteria;
searchCriteria.vid = vid1;
const auto archiveFileItor = m_catalogue->getArchiveFileItor(searchCriteria, prefetch);
const auto m = archiveFileItorToMap(*archiveFileItor);
......@@ -5400,7 +5400,7 @@ TEST_P(cta_catalogue_CatalogueTest, fileWrittenToTape_many_archive_files) {
}
{
catalogue::ArchiveFileSearchCriteria searchCriteria;
catalogue::TapeFileSearchCriteria searchCriteria;
searchCriteria.tapeFileCopyNb = 1;
const auto archiveFileItor = m_catalogue->getArchiveFileItor(searchCriteria, prefetch);
const auto m = archiveFileItorToMap(*archiveFileItor);
......@@ -5413,7 +5413,7 @@ TEST_P(cta_catalogue_CatalogueTest, fileWrittenToTape_many_archive_files) {
}
{
catalogue::ArchiveFileSearchCriteria searchCriteria;
catalogue::TapeFileSearchCriteria searchCriteria;
searchCriteria.tapePool = "tape_pool_name";
const auto archiveFileItor = m_catalogue->getArchiveFileItor(searchCriteria, prefetch);
const auto m = archiveFileItorToMap(*archiveFileItor);
......@@ -5426,7 +5426,7 @@ TEST_P(cta_catalogue_CatalogueTest, fileWrittenToTape_many_archive_files) {
}
{
catalogue::ArchiveFileSearchCriteria searchCriteria;
catalogue::TapeFileSearchCriteria searchCriteria;
searchCriteria.archiveFileId = nbArchiveFiles + 1234;
const auto archiveFileItor = m_catalogue->getArchiveFileItor(searchCriteria, prefetch);
const auto m = archiveFileItorToMap(*archiveFileItor);
......
......@@ -3390,7 +3390,7 @@ void RdbmsCatalogue::insertArchiveFile(rdbms::Conn &conn, const ArchiveFileRow &
//------------------------------------------------------------------------------
// getArchiveFileItor
//------------------------------------------------------------------------------
std::unique_ptr<ArchiveFileItor> RdbmsCatalogue::getArchiveFileItor(const ArchiveFileSearchCriteria &searchCriteria,
std::unique_ptr<ArchiveFileItor> RdbmsCatalogue::getArchiveFileItor(const TapeFileSearchCriteria &searchCriteria,
const uint64_t nbArchiveFilesToPrefetch) const {
try {
return cta::make_unique<ArchiveFileItorImpl>(*this, nbArchiveFilesToPrefetch, searchCriteria);
......@@ -3405,7 +3405,7 @@ std::unique_ptr<ArchiveFileItor> RdbmsCatalogue::getArchiveFileItor(const Archiv
RdbmsCatalogue::ArchiveFileItorImpl::ArchiveFileItorImpl(
const RdbmsCatalogue &catalogue,
const uint64_t nbArchiveFilesToPrefetch,
const ArchiveFileSearchCriteria &searchCriteria):
const TapeFileSearchCriteria &searchCriteria):
m_catalogue(catalogue),
m_nbArchiveFilesToPrefetch(nbArchiveFilesToPrefetch),
m_searchCriteria(searchCriteria),
......@@ -3472,7 +3472,7 @@ common::dataStructures::ArchiveFile RdbmsCatalogue::ArchiveFileItorImpl::next()
std::list<common::dataStructures::ArchiveFile> RdbmsCatalogue::getArchiveFilesForItor(
const uint64_t startingArchiveFileId,
const uint64_t maxNbArchiveFiles,
const ArchiveFileSearchCriteria &searchCriteria) const {
const TapeFileSearchCriteria &searchCriteria) const {
try {
std::string sql =
"SELECT "
......@@ -3637,7 +3637,7 @@ std::list<common::dataStructures::ArchiveFile> RdbmsCatalogue::getArchiveFilesFo
// getTapeFileSummary
//------------------------------------------------------------------------------
common::dataStructures::ArchiveFileSummary RdbmsCatalogue::getTapeFileSummary(
const ArchiveFileSearchCriteria &searchCriteria) const {
const TapeFileSearchCriteria &searchCriteria) const {
try {
std::string sql =
"SELECT "
......
......@@ -467,7 +467,7 @@ public:
* This parameter must be set to a value equal to or greater than 1.
* @return An iterator over the list of archive files.
*/
std::unique_ptr<ArchiveFileItor> getArchiveFileItor(const ArchiveFileSearchCriteria &searchCriteria,
std::unique_ptr<ArchiveFileItor> getArchiveFileItor(const TapeFileSearchCriteria &searchCriteria,
const uint64_t nbArchiveFilesToPrefetch) const override;
/**
......@@ -478,7 +478,7 @@ public:
* @return The summary.
*/
common::dataStructures::ArchiveFileSummary getTapeFileSummary(
const ArchiveFileSearchCriteria &searchCriteria) const override;
const TapeFileSearchCriteria &searchCriteria) const override;
/**
* Returns the archive file with the specified unique identifier.
......@@ -840,12 +840,12 @@ protected:
*
* @param catalogue The RdbmsCatalogue.
* @param nbArchiveFilesToPrefetch The number of archive files to prefetch.
* @param searchCriteria The criteria used to select the archive files.
* @param searchCriteria The search criteria.
*/
ArchiveFileItorImpl(
const RdbmsCatalogue &catalogue,
const uint64_t nbArchiveFilesToPrefetch,
const ArchiveFileSearchCriteria &searchCriteria);
const TapeFileSearchCriteria &searchCriteria);
/**
* Destructor.
......@@ -875,9 +875,9 @@ protected:
const uint64_t m_nbArchiveFilesToPrefetch;
/**
* The criteria used to select the archive files.
* The search criteria.
*/
ArchiveFileSearchCriteria m_searchCriteria;
TapeFileSearchCriteria m_searchCriteria;
/**
* The current offset into the list of archive files in the form of an
......@@ -899,13 +899,13 @@ protected:
* @param startingArchiveFileId The unique identifier of the first archive
* file to be returned.
* @param nbArchiveFiles The maximum number of archive files to be returned.
* @param searchCriteria The criteria used to select the archive files.
* @param searchCriteria The search criteria.
* @return The archive files.
*/
std::list<common::dataStructures::ArchiveFile> getArchiveFilesForItor(
const uint64_t startingArchiveFileId,
const uint64_t maxNbArchiveFiles,
const ArchiveFileSearchCriteria &searchCriteria) const;
const TapeFileSearchCriteria &searchCriteria) const;
/**
* Returns the mapping from tape copy to tape pool for the specified storage
......
......@@ -26,15 +26,15 @@ namespace cta {
namespace catalogue {
/**
* The collection of criteria used to select a set of archive files.
* The collection of criteria used to select a set of tape files.
*
* An archive file is selected if it meets all of the specified criteria.
* An tape file is selected if it meets all of the specified criteria.
*
* A criterion is only considered specified if it has been set.
*
* Please note that no wild cards, for example '*' or '%', are supported.
*/
struct ArchiveFileSearchCriteria {
struct TapeFileSearchCriteria {
/**
* The unique identifier of an archive file.
......@@ -89,7 +89,7 @@ struct ArchiveFileSearchCriteria {
*/
optional<std::string> tapePool;
}; // struct ArchiveFileSearchCriteria
}; // struct TapeFileSearchCriteria
} // namespace catalogue
} // namespace cta
......@@ -20,7 +20,7 @@
#include "XrdSec/XrdSecEntity.hh"
#include "catalogue/ArchiveFileSearchCriteria.hpp"
#include "catalogue/TapeFileSearchCriteria.hpp"
#include "xroot_plugins/XrdCtaDir.hpp"
namespace cta { namespace xrootPlugins {
......@@ -46,7 +46,7 @@ int XrdCtaDir::open(const char *path, const XrdSecEntity *client, const char *op
if(!path || strlen(path)<1){
throw cta::exception::Exception(std::string(__FUNCTION__)+": [ERROR] invalid virtual directory path");
}
cta::catalogue::ArchiveFileSearchCriteria searchCriteria;
cta::catalogue::TapeFileSearchCriteria searchCriteria;
searchCriteria.diskInstance = path; //the path will be the disk instance that we want the disk id's of
m_itor = m_catalogue->getArchiveFileItor(searchCriteria);
std::list<log::Param> params;
......
......@@ -21,7 +21,7 @@
#include "XrdSec/XrdSecEntity.hh"
#include "catalogue/ArchiveFileSearchCriteria.hpp"
#include "catalogue/TapeFileSearchCriteria.hpp"
#include "common/Configuration.hpp"
#include "common/utils/utils.hpp"
#include "common/exception/UserError.hpp"
......@@ -1690,7 +1690,7 @@ void XrdCtaFile::xCom_archivefile() {
if("ls" == m_requestTokens.at(2)) { //ls
bool summary = hasOption("-S", "--summary");
bool all = hasOption("-a", "--all");
cta::catalogue::ArchiveFileSearchCriteria searchCriteria;
cta::catalogue::TapeFileSearchCriteria searchCriteria;
searchCriteria.archiveFileId = getOptionUint64Value("-I", "--id", false, false);
searchCriteria.diskFileGroup = getOptionStringValue("-g", "--group", false, false);
searchCriteria.diskFileId = getOptionStringValue("-d", "--diskid", false, false);
......
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