Commit 5035ddba authored by Steven Murray's avatar Steven Murray
Browse files

Renamed dataStructures::TapeFileLocation to TapeFile

parent ab0bc303
......@@ -52,7 +52,7 @@
#include "common/dataStructures/StorageClass.hpp"
#include "common/dataStructures/Tape.hpp"
#include "common/dataStructures/TapeCopyToPoolMap.hpp"
#include "common/dataStructures/TapeFileLocation.hpp"
#include "common/dataStructures/TapeFile.hpp"
#include "common/dataStructures/TapePool.hpp"
#include "common/dataStructures/UpdateFileInfoRequest.hpp"
#include "common/dataStructures/UserIdentity.hpp"
......@@ -207,7 +207,7 @@ public:
*/
virtual void fileWrittenToTape(
const cta::common::dataStructures::ArchiveRequest &archiveRequest,
const cta::common::dataStructures::TapeFileLocation &tapeFileLocation) = 0;
const cta::common::dataStructures::TapeFile &tapeFileLocation) = 0;
virtual cta::common::dataStructures::TapeCopyToPoolMap getTapeCopyToPoolMap(const std::string &storageClass) const = 0;
......
......@@ -19,7 +19,7 @@
#include "catalogue/SqliteCatalogue.hpp"
#include "catalogue/SqliteCatalogueSchema.hpp"
#include "catalogue/SqliteStmt.hpp"
#include "common/dataStructures/TapeFileLocation.hpp"
#include "common/dataStructures/TapeFile.hpp"
#include "common/exception/Exception.hpp"
#include <memory>
......@@ -1756,7 +1756,7 @@ void SqliteCatalogue::setDriveStatus(const common::dataStructures::SecurityIdent
//------------------------------------------------------------------------------
void SqliteCatalogue::fileWrittenToTape(
const cta::common::dataStructures::ArchiveRequest &archiveRequest,
const cta::common::dataStructures::TapeFileLocation &tapeFileLocation) {
const cta::common::dataStructures::TapeFile &tapeFileLocation) {
}
//------------------------------------------------------------------------------
......@@ -1975,7 +1975,7 @@ bool SqliteCatalogue::hostIsAdmin(const std::string &hostName)
//------------------------------------------------------------------------------
// createTapeFile
//------------------------------------------------------------------------------
void SqliteCatalogue::createTapeFile(const common::dataStructures::TapeFileLocation &tapeFile,
void SqliteCatalogue::createTapeFile(const common::dataStructures::TapeFile &tapeFile,
const uint64_t archiveFileId) {
const time_t now = time(NULL);
const char *const sql =
......@@ -2005,8 +2005,8 @@ void SqliteCatalogue::createTapeFile(const common::dataStructures::TapeFileLocat
//------------------------------------------------------------------------------
// getTapeFiles
//------------------------------------------------------------------------------
std::list<common::dataStructures::TapeFileLocation> SqliteCatalogue::getTapeFiles() const {
std::list<cta::common::dataStructures::TapeFileLocation> files;
std::list<common::dataStructures::TapeFile> SqliteCatalogue::getTapeFiles() const {
std::list<cta::common::dataStructures::TapeFile> files;
const char *const sql =
"SELECT "
"VID AS VID,"
......@@ -2020,7 +2020,7 @@ std::list<common::dataStructures::TapeFileLocation> SqliteCatalogue::getTapeFile
if(nameToIdx.empty()) {
nameToIdx = stmt->getColumnNameToIdx();
}
common::dataStructures::TapeFileLocation file;
common::dataStructures::TapeFile file;
file.vid = stmt->columnText(nameToIdx["VID"]);
file.fSeq = stmt->columnUint64(nameToIdx["FSEQ"]);
......
......@@ -31,7 +31,7 @@ namespace dataStructures {
/**
* Forward declaration.
*/
class TapeFileLocation;
class TapeFile;
} // namespace dataStructures
} // namespace catalogue
......@@ -167,7 +167,7 @@ public:
*/
virtual void fileWrittenToTape(
const cta::common::dataStructures::ArchiveRequest &archiveRequest,
const cta::common::dataStructures::TapeFileLocation &tapeFileLocation);
const cta::common::dataStructures::TapeFile &tapeFileLocation);
/**
* Prepares the catalogue for a new archive file and returns the information
......@@ -273,14 +273,14 @@ protected:
* @param archiveFileId The identifier of the archive file of which the tape
* file is a copy.
*/
void createTapeFile(const common::dataStructures::TapeFileLocation &tapeFile, const uint64_t archiveFileId);
void createTapeFile(const common::dataStructures::TapeFile &tapeFile, const uint64_t archiveFileId);
/**
* Returns the list of all the tape files in the catalogue.
*
* @return The list of all the tape files in the catalogue.
*/
std::list<common::dataStructures::TapeFileLocation> getTapeFiles() const;
std::list<common::dataStructures::TapeFile> getTapeFiles() const;
/**
* Sets the last FSeq of the specified tape to the specified value.
......
......@@ -1060,7 +1060,7 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createTapeFile) {
ASSERT_TRUE(catalogue.getTapeFiles().empty());
common::dataStructures::TapeFileLocation tapeFile;
common::dataStructures::TapeFile tapeFile;
tapeFile.vid = "VID";
tapeFile.fSeq = 5678;
tapeFile.blockId = 9012;
......@@ -1069,7 +1069,7 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createTapeFile) {
catalogue.createTapeFile(tapeFile, archiveFileId);
const std::list<common::dataStructures::TapeFileLocation> tapeFiles = catalogue.getTapeFiles();
const std::list<common::dataStructures::TapeFile> tapeFiles = catalogue.getTapeFiles();
ASSERT_EQ(1, tapeFiles.size());
ASSERT_EQ(tapeFile.vid, tapeFiles.front().vid);
......
......@@ -51,7 +51,7 @@ set (COMMON_LIB_SRC_FILES
dataStructures/SecurityIdentity.cpp
dataStructures/StorageClass.cpp
dataStructures/Tape.cpp
dataStructures/TapeFileLocation.cpp
dataStructures/TapeFile.cpp
dataStructures/TapeLog.cpp
dataStructures/TapePool.cpp
dataStructures/TestSourceType.cpp
......
......@@ -24,7 +24,7 @@
#include <string>
#include "common/dataStructures/DRData.hpp"
#include "common/dataStructures/TapeFileLocation.hpp"
#include "common/dataStructures/TapeFile.hpp"
namespace cta {
namespace common {
......@@ -49,7 +49,7 @@ struct ArchiveFile {
std::string checksumValue;
std::string storageClass;
cta::common::dataStructures::DRData drData;
std::map<uint64_t,cta::common::dataStructures::TapeFileLocation> tapeCopies;
std::map<uint64_t,cta::common::dataStructures::TapeFile> tapeCopies;
time_t creationTime;
time_t reconciliationTime;
......
......@@ -24,7 +24,7 @@
#include <string>
#include "common/dataStructures/RetrieveRequest.hpp"
#include "common/dataStructures/TapeFileLocation.hpp"
#include "common/dataStructures/TapeFile.hpp"
namespace cta {
namespace common {
......@@ -43,7 +43,7 @@ struct RetrieveJob {
bool operator!=(const RetrieveJob &rhs) const;
cta::common::dataStructures::RetrieveRequest request;
std::map<std::string,std::pair<uint64_t,cta::common::dataStructures::TapeFileLocation>> tapeCopies;
std::map<std::string,std::pair<uint64_t,cta::common::dataStructures::TapeFile>> tapeCopies;
}; // struct RetrieveJob
......
......@@ -16,14 +16,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "common/dataStructures/TapeFileLocation.hpp"
#include "common/dataStructures/TapeFile.hpp"
#include "common/dataStructures/utils.hpp"
#include "common/exception/Exception.hpp"
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::common::dataStructures::TapeFileLocation::TapeFileLocation():
cta::common::dataStructures::TapeFile::TapeFile():
fSeq(0),
blockId(0),
creationTime(0) {}
......@@ -31,7 +31,7 @@ cta::common::dataStructures::TapeFileLocation::TapeFileLocation():
//------------------------------------------------------------------------------
// operator==
//------------------------------------------------------------------------------
bool cta::common::dataStructures::TapeFileLocation::operator==(const TapeFileLocation &rhs) const {
bool cta::common::dataStructures::TapeFile::operator==(const TapeFile &rhs) const {
return vid==rhs.vid
&& fSeq==rhs.fSeq
&& blockId==rhs.blockId
......@@ -41,14 +41,14 @@ bool cta::common::dataStructures::TapeFileLocation::operator==(const TapeFileLoc
//------------------------------------------------------------------------------
// operator!=
//------------------------------------------------------------------------------
bool cta::common::dataStructures::TapeFileLocation::operator!=(const TapeFileLocation &rhs) const {
bool cta::common::dataStructures::TapeFile::operator!=(const TapeFile &rhs) const {
return !operator==(rhs);
}
//------------------------------------------------------------------------------
// operator<<
//------------------------------------------------------------------------------
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::TapeFileLocation &obj) {
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::TapeFile &obj) {
os << "(vid=" << obj.vid
<< " fSeq=" << obj.fSeq
<< " blockId=" << obj.blockId
......
......@@ -31,23 +31,23 @@ namespace dataStructures {
/**
* This struct holds location information of a specific tape file
*/
struct TapeFileLocation {
struct TapeFile {
TapeFileLocation();
TapeFile();
bool operator==(const TapeFileLocation &rhs) const;
bool operator==(const TapeFile &rhs) const;
bool operator!=(const TapeFileLocation &rhs) const;
bool operator!=(const TapeFile &rhs) const;
std::string vid;
uint64_t fSeq;
uint64_t blockId;
time_t creationTime;
}; // struct TapeFileLocation
}; // struct TapeFile
} // namespace dataStructures
} // namespace common
} // namespace cta
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::TapeFileLocation &obj);
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::TapeFile &obj);
......@@ -18,7 +18,7 @@
#include "common/dataStructures/utils.hpp"
std::ostream &operator<<(std::ostream &os, const std::map<uint64_t,cta::common::dataStructures::TapeFileLocation> &map) {
std::ostream &operator<<(std::ostream &os, const std::map<uint64_t,cta::common::dataStructures::TapeFile> &map) {
os << "(";
for(auto it = map.begin(); it != map.end(); it++) {
os << " key=" << it->first << " value=" << it->second << " ";
......@@ -50,7 +50,7 @@ std::ostream &operator<<(std::ostream &os, const std::map<uint64_t,std::pair<std
return os;
}
std::ostream &operator<<(std::ostream &os, const std::map<std::string,std::pair<uint64_t,cta::common::dataStructures::TapeFileLocation>> &map) {
std::ostream &operator<<(std::ostream &os, const std::map<std::string,std::pair<uint64_t,cta::common::dataStructures::TapeFile>> &map) {
os << "(";
for(auto it = map.begin(); it != map.end(); it++) {
os << " key=" << it->first << " value.first=" << it->second.first << " value.second=" << it->second.second;
......
......@@ -18,14 +18,14 @@
#pragma once
#include "common/dataStructures/TapeFileLocation.hpp"
#include "common/dataStructures/TapeFile.hpp"
#include <iostream>
#include <map>
std::ostream &operator<<(std::ostream &os, const std::map<uint64_t,cta::common::dataStructures::TapeFileLocation> &map);
std::ostream &operator<<(std::ostream &os, const std::map<uint64_t,cta::common::dataStructures::TapeFile> &map);
std::ostream &operator<<(std::ostream &os, const std::map<uint64_t,std::string> &map);
std::ostream &operator<<(std::ostream &os, const std::pair<std::string,std::string> &pair);
std::ostream &operator<<(std::ostream &os, const std::map<uint64_t,std::pair<std::string,std::string>> &map);
std::ostream &operator<<(std::ostream &os, const std::map<std::string,std::pair<uint64_t,cta::common::dataStructures::TapeFileLocation>> &map);
std::ostream &operator<<(std::ostream &os, const std::map<std::string,std::pair<uint64_t,cta::common::dataStructures::TapeFile>> &map);
std::ostream &operator<<(std::ostream &os, const std::map<uint64_t,std::pair<std::string,std::string>> &map);
\ No newline at end of file
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