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

Added ArchiveFileQueueCriteria

parent e626555e
......@@ -27,6 +27,7 @@
#include "common/dataStructures/AdminHost.hpp"
#include "common/dataStructures/AdminUser.hpp"
#include "common/dataStructures/ArchiveFile.hpp"
#include "common/dataStructures/ArchiveFileQueueCriteria.hpp"
#include "common/dataStructures/ArchiveFileSummary.hpp"
#include "common/dataStructures/ArchiveJob.hpp"
#include "common/dataStructures/ArchiveRequest.hpp"
......@@ -190,12 +191,11 @@ public:
* @param user The user for whom the file is to be archived. This will be
* used by the Catalogue to determine the mount policy to be used when
* archiving the file.
* @return A triplet of archive file ID, tape copy to tape pool map and mount
* group.
* @return The information required to queue the associated archive request.
*/
virtual std::tuple<uint64_t, cta::common::dataStructures::TapeCopyToPoolMap,
cta::common::dataStructures::MountPolicy> prepareForNewFile(
const std::string &storageClass, const std::string &user) = 0;
virtual cta::common::dataStructures::ArchiveFileQueueCriteria
prepareForNewFile(const std::string &storageClass, const std::string &user)
= 0;
/**
* Notifies the catalogue that a file has been written to tape.
......
......@@ -441,14 +441,10 @@ void cta::catalogue::DummyCatalogue::fileWrittenToTape(
//------------------------------------------------------------------------------
// prepareForNewFile
//------------------------------------------------------------------------------
std::tuple<uint64_t, cta::common::dataStructures::TapeCopyToPoolMap,
cta::common::dataStructures::MountPolicy>
cta::common::dataStructures::ArchiveFileQueueCriteria
cta::catalogue::DummyCatalogue::prepareForNewFile(
const std::string &storageClass, const std::string &user) {
const uint64_t fileId = 0;
const common::dataStructures::TapeCopyToPoolMap copyToPoolMap;
const common::dataStructures::MountPolicy mountPolicy;
return std::make_tuple(fileId, copyToPoolMap, mountPolicy);
return common::dataStructures::ArchiveFileQueueCriteria();
}
//------------------------------------------------------------------------------
......
......@@ -157,12 +157,10 @@ public:
* @param user The user for whom the file is to be archived. This will be
* used by the Catalogue to determine the mount policy to be used when
* archiving the file.
* @return A triplet of archive file ID, tape copy to tape pool map and mount
* group.
* @return The information required to queue the associated archive request.
*/
virtual std::tuple<uint64_t, cta::common::dataStructures::TapeCopyToPoolMap,
cta::common::dataStructures::MountPolicy> prepareForNewFile(
const std::string &storageClass, const std::string &user);
virtual cta::common::dataStructures::ArchiveFileQueueCriteria
prepareForNewFile(const std::string &storageClass, const std::string &user);
std::map<uint64_t,std::string> getCopyNbToTapePoolMap(const std::string &storageClass) const;
......
......@@ -2043,14 +2043,10 @@ void cta::catalogue::SqliteCatalogue::fileWrittenToTape(
//------------------------------------------------------------------------------
// prepareForNewFile
//------------------------------------------------------------------------------
std::tuple<uint64_t, cta::common::dataStructures::TapeCopyToPoolMap,
cta::common::dataStructures::MountPolicy>
cta::common::dataStructures::ArchiveFileQueueCriteria
cta::catalogue::SqliteCatalogue::prepareForNewFile(
const std::string &storageClass, const std::string &user) {
const uint64_t fileId = 0;
const common::dataStructures::TapeCopyToPoolMap copyToPoolMap;
const common::dataStructures::MountPolicy mountPolicy;
return std::make_tuple(fileId, copyToPoolMap, mountPolicy);
return common::dataStructures::ArchiveFileQueueCriteria();
}
//------------------------------------------------------------------------------
......
......@@ -177,12 +177,10 @@ public:
* @param user The user for whom the file is to be archived. This will be
* used by the Catalogue to determine the mount policy to be used when
* archiving the file.
* @return A triplet of archive file ID, tape copy to tape pool map and mount
* group.
* @return The information required to queue the associated archive request.
*/
virtual std::tuple<uint64_t, cta::common::dataStructures::TapeCopyToPoolMap,
cta::common::dataStructures::MountPolicy> prepareForNewFile(
const std::string &storageClass, const std::string &user);
virtual cta::common::dataStructures::ArchiveFileQueueCriteria
prepareForNewFile(const std::string &storageClass, const std::string &user);
virtual std::map<uint64_t,std::string> getCopyNbToTapePoolMap(const std::string &storageClass) const;
virtual cta::common::dataStructures::MountPolicy getArchiveMountPolicy(const cta::common::dataStructures::UserIdentity &requester) const;
......
......@@ -25,6 +25,7 @@ set (COMMON_LIB_SRC_FILES
dataStructures/AdminHost.cpp
dataStructures/AdminUser.cpp
dataStructures/ArchiveFile.cpp
dataStructures/ArchiveFileQueueCriteria.cpp
dataStructures/ArchiveFileSummary.cpp
dataStructures/ArchiveJob.cpp
dataStructures/ArchiveRequest.cpp
......
/*
* The CERN Tape Archive (CTA) project
* Copyright (C) 2015 CERN
*
* 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 "common/dataStructures/ArchiveFileQueueCriteria.hpp"
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::common::dataStructures::ArchiveFileQueueCriteria::
ArchiveFileQueueCriteria(): fileId(0) {
}
/*
* The CERN Tape Archive (CTA) project
* Copyright (C) 2015 CERN
*
* 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
#include "common/dataStructures/MountPolicy.hpp"
#include "common/dataStructures/TapeCopyToPoolMap.hpp"
#include <stdint.h>
namespace cta {
namespace common {
namespace dataStructures {
/**
* The queueing criteria created after preparing for a new archive file within
* the Catalogue. This queueing criteria specify on which tape-pool queue(s)
* the corresponding data-transfer jobs are to be queued and which mount policy
* should be used.
*/
struct ArchiveFileQueueCriteria {
/**
* Constructor.
*/
ArchiveFileQueueCriteria();
/**
* The unique archive-file identifier.
*/
uint64_t fileId;
/**
* The map from tape copy number to tape pool name.
*/
TapeCopyToPoolMap copyToPoolMap;
/**
* The mount policy.
*/
MountPolicy mountPolicy;
}; // struct ArchiveFileQueueCriteria
} // namespace dataStructures
} // namespace common
} // namespace cta
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