Commit 21b486e4 authored by Steven Murray's avatar Steven Murray
Browse files

Renamed ArchiveRequest::tapeCopies to ArchiveRequest::tapeFiles

parent a00bd53c
......@@ -1854,7 +1854,7 @@ std::list<common::dataStructures::ArchiveFile> SqliteCatalogue::getArchiveFiles(
tapeFile.copyNb = rset->columnUint64("COPY_NB");
tapeFile.creationTime = rset->columnUint64("TAPE_FILE_CREATION_TIME");
archiveFile.tapeCopies[rset->columnUint64("COPY_NB")] = tapeFile;
archiveFile.tapeFiles[rset->columnUint64("COPY_NB")] = tapeFile;
}
}
......@@ -2312,7 +2312,7 @@ std::unique_ptr<common::dataStructures::ArchiveFile> SqliteCatalogue::getArchive
tapeFile.blockId = rset->columnUint64("BLOCK_ID");
tapeFile.compressedSize = rset->columnUint64("COMPRESSED_SIZE");
tapeFile.creationTime = rset->columnUint64("TAPE_FILE_CREATION_TIME");
archiveFile->tapeCopies[rset->columnUint64("COPY_NB")] = tapeFile;
archiveFile->tapeFiles[rset->columnUint64("COPY_NB")] = tapeFile;
}
}
......
......@@ -1046,7 +1046,7 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createTapeFile_2_files) {
std::list<common::dataStructures::ArchiveFile> archiveFiles;
archiveFiles = catalogue.getArchiveFiles("", "", "", "", "", "", "", "", "");
ASSERT_EQ(1, archiveFiles.size());
ASSERT_TRUE(archiveFiles.front().tapeCopies.empty());
ASSERT_TRUE(archiveFiles.front().tapeFiles.empty());
const common::dataStructures::ArchiveFile archiveFile = archiveFiles.front();
......@@ -1063,7 +1063,7 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createTapeFile_2_files) {
ASSERT_EQ(bareArchiveFile.drData.drGroup, archiveFile.drData.drGroup);
ASSERT_EQ(bareArchiveFile.drData.drBlob, archiveFile.drData.drBlob);
ASSERT_TRUE(bareArchiveFile.tapeCopies.empty());
ASSERT_TRUE(bareArchiveFile.tapeFiles.empty());
}
ASSERT_TRUE(catalogue.getTapeFiles().empty());
......@@ -1097,10 +1097,10 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createTapeFile_2_files) {
ASSERT_EQ(bareArchiveFile.drData.drGroup, archiveFile.drData.drGroup);
ASSERT_EQ(bareArchiveFile.drData.drBlob, archiveFile.drData.drBlob);
ASSERT_EQ(1, archiveFile.tapeCopies.size());
ASSERT_EQ(1, archiveFile.tapeFiles.size());
{
auto copyNbToTapeFileItor = archiveFile.tapeCopies.find(1);
auto copyNbToTapeFileItor = archiveFile.tapeFiles.find(1);
ASSERT_EQ(1, copyNbToTapeFileItor->first);
ASSERT_EQ(tapeFile1.vid, copyNbToTapeFileItor->second.vid);
ASSERT_EQ(tapeFile1.fSeq, copyNbToTapeFileItor->second.fSeq);
......@@ -1150,10 +1150,10 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createTapeFile_2_files) {
ASSERT_EQ(bareArchiveFile.drData.drGroup, archiveFile.drData.drGroup);
ASSERT_EQ(bareArchiveFile.drData.drBlob, archiveFile.drData.drBlob);
ASSERT_EQ(2, archiveFile.tapeCopies.size());
ASSERT_EQ(2, archiveFile.tapeFiles.size());
{
auto copyNbToTapeFileItor = archiveFile.tapeCopies.find(1);
auto copyNbToTapeFileItor = archiveFile.tapeFiles.find(1);
ASSERT_EQ(1, copyNbToTapeFileItor->first);
ASSERT_EQ(tapeFile1.vid, copyNbToTapeFileItor->second.vid);
ASSERT_EQ(tapeFile1.fSeq, copyNbToTapeFileItor->second.fSeq);
......@@ -1163,7 +1163,7 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createTapeFile_2_files) {
}
{
auto copyNbToTapeFileItor = archiveFile.tapeCopies.find(2);
auto copyNbToTapeFileItor = archiveFile.tapeFiles.find(2);
ASSERT_EQ(2, copyNbToTapeFileItor->first);
ASSERT_EQ(tapeFile2.vid, copyNbToTapeFileItor->second.vid);
ASSERT_EQ(tapeFile2.fSeq, copyNbToTapeFileItor->second.fSeq);
......@@ -1318,7 +1318,7 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, getArchiveFile) {
ASSERT_EQ(file.drData.drGroup, archiveFile.drData.drGroup);
ASSERT_EQ(file.drData.drBlob, archiveFile.drData.drBlob);
ASSERT_TRUE(file.tapeCopies.empty());
ASSERT_TRUE(file.tapeFiles.empty());
ASSERT_TRUE(catalogue.getTapeFiles().empty());
}
......@@ -1340,7 +1340,7 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, getArchiveFile) {
ASSERT_EQ(file.drData.drGroup, retrievedFile->drData.drGroup);
ASSERT_EQ(file.drData.drBlob, retrievedFile->drData.drBlob);
ASSERT_TRUE(file.tapeCopies.empty());
ASSERT_TRUE(file.tapeFiles.empty());
ASSERT_TRUE(catalogue.getTapeFiles().empty());
}
......@@ -1396,7 +1396,7 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, fileWrittenToTape) {
ASSERT_EQ(file.drData.drGroup, archiveFile.drData.drGroup);
ASSERT_EQ(file.drData.drBlob, archiveFile.drData.drBlob);
ASSERT_TRUE(file.tapeCopies.empty());
ASSERT_TRUE(file.tapeFiles.empty());
ASSERT_TRUE(catalogue.getTapeFiles().empty());
}
......@@ -1418,7 +1418,7 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, fileWrittenToTape) {
ASSERT_EQ(file.drData.drGroup, retrievedFile->drData.drGroup);
ASSERT_EQ(file.drData.drBlob, retrievedFile->drData.drBlob);
ASSERT_TRUE(file.tapeCopies.empty());
ASSERT_TRUE(file.tapeFiles.empty());
ASSERT_TRUE(catalogue.getTapeFiles().empty());
}
......@@ -1458,7 +1458,7 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, fileWrittenToTape) {
ASSERT_EQ(file.drData.drGroup, retrievedFile->drData.drGroup);
ASSERT_EQ(file.drData.drBlob, retrievedFile->drData.drBlob);
ASSERT_EQ(1, retrievedFile->tapeCopies.size());
ASSERT_EQ(1, retrievedFile->tapeFiles.size());
ASSERT_EQ(1, catalogue.getTapeFiles().size());
}
......@@ -1498,7 +1498,7 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, fileWrittenToTape) {
ASSERT_EQ(file.drData.drGroup, retrievedFile->drData.drGroup);
ASSERT_EQ(file.drData.drBlob, retrievedFile->drData.drBlob);
ASSERT_EQ(2, retrievedFile->tapeCopies.size());
ASSERT_EQ(2, retrievedFile->tapeFiles.size());
ASSERT_EQ(2, catalogue.getTapeFiles().size());
}
......
......@@ -46,7 +46,7 @@ bool ArchiveFile::operator==(const ArchiveFile &rhs) const {
&& checksumValue == rhs.checksumValue
&& storageClass == rhs.storageClass
&& drData == rhs.drData
&& tapeCopies == rhs.tapeCopies;
&& tapeFiles == rhs.tapeFiles;
}
//------------------------------------------------------------------------------
......@@ -70,7 +70,7 @@ std::ostream &operator<<(std::ostream &os, ArchiveFile &obj) {
"checksumValue=" << obj.checksumValue << ","
"storageClass=" << obj.storageClass << ","
"drData=" << obj.drData << ","
"tapeCopies=" << obj.tapeCopies << ","
"tapeFiles=" << obj.tapeFiles << ","
"creationTime=" << obj.creationTime << ","
"reconciliationTime=" << obj.reconciliationTime <<
"}";
......
......@@ -68,7 +68,7 @@ struct ArchiveFile {
* to be listed by the operator. For example, if the listing requested is
* for a single tape, the map will contain only one element.
*/
std::map<uint64_t,TapeFile> tapeCopies;
std::map<uint64_t,TapeFile> tapeFiles;
time_t creationTime;
time_t reconciliationTime;
......
......@@ -57,8 +57,8 @@ TEST_F(cta_common_dataStructures_ArchiveFileTest, copy_constructor) {
tapeFile1.compressedSize = 5;
tapeFile1.copyNb = 1;
archiveFile1.tapeCopies[1] = tapeFile1;
ASSERT_EQ(1, archiveFile1.tapeCopies.size());
archiveFile1.tapeFiles[1] = tapeFile1;
ASSERT_EQ(1, archiveFile1.tapeFiles.size());
TapeFile tapeFile2;
tapeFile2.vid = "VID2";
......@@ -67,8 +67,8 @@ TEST_F(cta_common_dataStructures_ArchiveFileTest, copy_constructor) {
tapeFile2.compressedSize = 6;
tapeFile2.copyNb = 2;
archiveFile1.tapeCopies[2] = tapeFile1;
ASSERT_EQ(2, archiveFile1.tapeCopies.size());
archiveFile1.tapeFiles[2] = tapeFile1;
ASSERT_EQ(2, archiveFile1.tapeFiles.size());
ArchiveFile archiveFile2;
......@@ -87,11 +87,11 @@ TEST_F(cta_common_dataStructures_ArchiveFileTest, copy_constructor) {
ASSERT_EQ(archiveFile1.drData.drGroup, archiveFile2.drData.drGroup);
ASSERT_EQ(archiveFile1.drData.drBlob, archiveFile2.drData.drBlob);
ASSERT_EQ(2, archiveFile2.tapeCopies.size());
ASSERT_EQ(2, archiveFile2.tapeFiles.size());
{
auto copyNbToTapeFileItor = archiveFile2.tapeCopies.find(1);
ASSERT_TRUE(copyNbToTapeFileItor != archiveFile2.tapeCopies.end());
auto copyNbToTapeFileItor = archiveFile2.tapeFiles.find(1);
ASSERT_TRUE(copyNbToTapeFileItor != archiveFile2.tapeFiles.end());
ASSERT_EQ(1, copyNbToTapeFileItor->first);
ASSERT_EQ(tapeFile1.vid, copyNbToTapeFileItor->second.vid);
ASSERT_EQ(tapeFile1.fSeq, copyNbToTapeFileItor->second.fSeq);
......@@ -101,8 +101,8 @@ TEST_F(cta_common_dataStructures_ArchiveFileTest, copy_constructor) {
}
{
auto copyNbToTapeFileItor = archiveFile2.tapeCopies.find(2);
ASSERT_TRUE(copyNbToTapeFileItor != archiveFile2.tapeCopies.end());
auto copyNbToTapeFileItor = archiveFile2.tapeFiles.find(2);
ASSERT_TRUE(copyNbToTapeFileItor != archiveFile2.tapeFiles.end());
ASSERT_EQ(2, copyNbToTapeFileItor->first);
ASSERT_EQ(tapeFile1.vid, copyNbToTapeFileItor->second.vid);
ASSERT_EQ(tapeFile1.fSeq, copyNbToTapeFileItor->second.fSeq);
......
......@@ -49,7 +49,7 @@ bool RetrieveJob::operator!=(const RetrieveJob &rhs) const {
//------------------------------------------------------------------------------
std::ostream &operator<<(std::ostream &os, const RetrieveJob &obj) {
os << "(request=" << obj.request
<< " tapeCopies=" << obj.tapeCopies << ")";
<< " tapeFiles=" << obj.tapeCopies << ")";
return os;
}
......
......@@ -1543,7 +1543,7 @@ void XrdCtaFile::xCom_archivefile(const std::vector<std::string> &tokens, const
std::vector<std::string> header = {"id","copy no","vid","fseq","block id","disk id","size","checksum type","checksum value","storage class","owner","group","instance","path","creation time"};
if(hasOption(tokens, "-h", "--header")) responseTable.push_back(header);
for(auto it = list.cbegin(); it != list.cend(); it++) {
for(auto jt = it->tapeCopies.cbegin(); jt != it->tapeCopies.cend(); jt++) {
for(auto jt = it->tapeFiles.cbegin(); jt != it->tapeFiles.cend(); jt++) {
std::vector<std::string> currentRow;
currentRow.push_back(std::to_string((unsigned long long)it->archiveFileID));
currentRow.push_back(std::to_string((unsigned long long)jt->first));
......@@ -1722,7 +1722,7 @@ void XrdCtaFile::xCom_reconcile(const std::vector<std::string> &tokens, const ct
std::vector<std::string> header = {"id","copy no","vid","fseq","block id","disk id","instance","size","checksum type","checksum value","storage class","owner","group","path"};
responseTable.push_back(header);
for(auto it = list.cbegin(); it != list.cend(); it++) {
for(auto jt = it->tapeCopies.cbegin(); jt != it->tapeCopies.cend(); jt++) {
for(auto jt = it->tapeFiles.cbegin(); jt != it->tapeFiles.cend(); jt++) {
std::vector<std::string> currentRow;
currentRow.push_back(std::to_string((unsigned long long)it->archiveFileID));
currentRow.push_back(std::to_string((unsigned long long)jt->first));
......
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