Commit 3a67ca56 authored by Michael Davis's avatar Michael Davis
Browse files

[schema] Sync changes in data structures with changes in master

Mostly changes to new unit tests.
parent 5b1e6e66
......@@ -3666,7 +3666,7 @@ TEST_P(cta_catalogue_CatalogueTest, deleteNonEmptyTape) {
file1Written.diskFileId = "5678";
file1Written.diskFilePath = "/public_dir/public_file";
file1Written.diskFileOwnerUid = PUBLIC_DISK_USER;
file1Written.diskFileGid = PUBLIC_DISK_GROUP;
file1Written.diskFileGid = PUBLIC_DISK_GROUP;
file1Written.size = fileSize;
file1Written.checksumBlob.insert(checksum::ADLER32, "1234");
file1Written.storageClassName = storageClass.name;
......@@ -7033,7 +7033,7 @@ TEST_P(cta_catalogue_CatalogueTest, prepareToRetrieveFileUsingArchiveFileId) {
file1Written.diskFileId = "5678";
file1Written.diskFilePath = "/public_dir/public_file";
file1Written.diskFileOwnerUid = PUBLIC_DISK_USER;
file1Written.diskFileGid = PUBLIC_DISK_GROUP;
file1Written.diskFileGid = PUBLIC_DISK_GROUP;
file1Written.size = archiveFileSize;
file1Written.checksumBlob.insert(checksum::ADLER32, "1234");
file1Written.storageClassName = storageClass.name;
......@@ -7281,7 +7281,7 @@ TEST_P(cta_catalogue_CatalogueTest, prepareToRetrieveFileUsingArchiveFileId_disa
file1Written.diskFileId = "5678";
file1Written.diskFilePath = "/public_dir/public_file";
file1Written.diskFileOwnerUid = PUBLIC_DISK_USER;
file1Written.diskFileGid = PUBLIC_DISK_GROUP;
file1Written.diskFileGid = PUBLIC_DISK_GROUP;
file1Written.size = archiveFileSize;
file1Written.checksumBlob.insert(checksum::ADLER32, "1234");
file1Written.storageClassName = storageClass.name;
......@@ -7816,8 +7816,8 @@ TEST_P(cta_catalogue_CatalogueTest, filesWrittenToTape_many_archive_files) {
fileWritten.diskInstance = storageClass.diskInstance;
fileWritten.diskFileId = diskFileId.str();
fileWritten.diskFilePath = diskFilePath.str();
fileWritten.diskFileOwnerUid = PUBLIC_DISK_USER;
fileWritten.diskFileGid = PUBLIC_DISK_GROUP;
fileWritten.diskFileOwnerUid = PUBLIC_DISK_USER;
fileWritten.diskFileGid = PUBLIC_DISK_GROUP;
fileWritten.size = archiveFileSize;
fileWritten.checksumBlob.insert(checksum::ADLER32, "1357");
fileWritten.storageClassName = storageClass.name;
......@@ -7877,8 +7877,8 @@ TEST_P(cta_catalogue_CatalogueTest, filesWrittenToTape_many_archive_files) {
fileWritten.diskInstance = storageClass.diskInstance;
fileWritten.diskFileId = diskFileId.str();
fileWritten.diskFilePath = diskFilePath.str();
fileWritten.diskFileOwnerUid = PUBLIC_DISK_USER;
fileWritten.diskFileGid = PUBLIC_DISK_GROUP;
fileWritten.diskFileOwnerUid = PUBLIC_DISK_USER;
fileWritten.diskFileGid = PUBLIC_DISK_GROUP;
fileWritten.size = archiveFileSize;
fileWritten.checksumBlob.insert(checksum::ADLER32, "1357");
fileWritten.storageClassName = storageClass.name;
......@@ -8111,8 +8111,8 @@ TEST_P(cta_catalogue_CatalogueTest, filesWrittenToTape_many_archive_files) {
fileWritten.diskInstance = storageClass.diskInstance;
fileWritten.diskFileId = diskFileId.str();
fileWritten.diskFilePath = diskFilePath.str();
fileWritten.diskFileOwnerUid = PUBLIC_DISK_USER;
fileWritten.diskFileGid = PUBLIC_DISK_GROUP;
fileWritten.diskFileOwnerUid = PUBLIC_DISK_USER;
fileWritten.diskFileGid = PUBLIC_DISK_GROUP;
fileWritten.size = archiveFileSize;
fileWritten.checksumBlob.insert(checksum::ADLER32, "1357");
fileWritten.storageClassName = storageClass.name;
......@@ -8169,8 +8169,8 @@ TEST_P(cta_catalogue_CatalogueTest, filesWrittenToTape_many_archive_files) {
fileWritten.diskInstance = storageClass.diskInstance;
fileWritten.diskFileId = diskFileId.str();
fileWritten.diskFilePath = diskFilePath.str();
fileWritten.diskFileOwnerUid = PUBLIC_DISK_USER;
fileWritten.diskFileGid = PUBLIC_DISK_GROUP;
fileWritten.diskFileOwnerUid = PUBLIC_DISK_USER;
fileWritten.diskFileGid = PUBLIC_DISK_GROUP;
fileWritten.size = archiveFileSize;
fileWritten.checksumBlob.insert(checksum::ADLER32, "1357");
fileWritten.storageClassName = storageClass.name;
......@@ -8227,8 +8227,8 @@ TEST_P(cta_catalogue_CatalogueTest, filesWrittenToTape_many_archive_files) {
fileWritten.diskInstance = storageClass.diskInstance;
fileWritten.diskFileId = diskFileId.str();
fileWritten.diskFilePath = diskFilePath.str();
fileWritten.diskFileOwnerUid = PUBLIC_DISK_USER;
fileWritten.diskFileGid = PUBLIC_DISK_GROUP;
fileWritten.diskFileOwnerUid = PUBLIC_DISK_USER;
fileWritten.diskFileGid = PUBLIC_DISK_GROUP;
fileWritten.size = archiveFileSize;
fileWritten.checksumBlob.insert(checksum::ADLER32, "1357");
fileWritten.storageClassName = storageClass.name;
......@@ -8336,7 +8336,7 @@ TEST_P(cta_catalogue_CatalogueTest, filesWrittenToTape_many_archive_files) {
{
catalogue::TapeFileSearchCriteria searchCriteria;
searchCriteria.diskInstance = storageClass.diskInstance;
searchCriteria.diskFileGid = PUBLIC_DISK_GROUP;
searchCriteria.diskFileGid = PUBLIC_DISK_GROUP;
auto archiveFileItor = m_catalogue->getArchiveFilesItor(searchCriteria);
const auto m = archiveFileItorToMap(archiveFileItor);
ASSERT_EQ(nbArchiveFiles, m.size());
......@@ -8516,8 +8516,8 @@ TEST_P(cta_catalogue_CatalogueTest, DISABLED_concurrent_filesWrittenToTape_many_
fileWritten.diskInstance = m_storageClass.diskInstance;
fileWritten.diskFileId = diskFileId.str();
fileWritten.diskFilePath = diskFilePath.str();
fileWritten.diskFileOwnerUid = PUBLIC_DISK_USER;
fileWritten.diskFileGid = PUBLIC_DISK_GROUP;
fileWritten.diskFileOwnerUid = PUBLIC_DISK_USER;
fileWritten.diskFileGid = PUBLIC_DISK_GROUP;
fileWritten.size = m_archiveFileSize;
fileWritten.checksumBlob.insert(checksum::ADLER32, "1357");
fileWritten.storageClassName = m_storageClass.name;
......@@ -8882,8 +8882,8 @@ TEST_P(cta_catalogue_CatalogueTest, DISABLED_concurrent_filesWrittenToTape_many_
fileWritten1.diskInstance = storageClass.diskInstance;
fileWritten1.diskFileId = diskFileId.str();
fileWritten1.diskFilePath = diskFilePath.str();
fileWritten1.diskFileOwnerUid = PUBLIC_DISK_USER;
fileWritten1.diskFileGid = PUBLIC_DISK_GROUP;
fileWritten1.diskFileOwnerUid = PUBLIC_DISK_USER;
fileWritten1.diskFileGid = PUBLIC_DISK_GROUP;
fileWritten1.size = archiveFileSize;
fileWritten1.checksumBlob.insert(checksum::ADLER32, "2468");
fileWritten1.storageClassName = storageClass.name;
......@@ -8955,8 +8955,8 @@ TEST_P(cta_catalogue_CatalogueTest, DISABLED_concurrent_filesWrittenToTape_many_
fileWritten1.diskInstance = storageClass.diskInstance;
fileWritten1.diskFileId = diskFileId.str();
fileWritten1.diskFilePath = diskFilePath.str();
fileWritten1.diskFileOwnerUid = PUBLIC_DISK_USER;
fileWritten1.diskFileGid = PUBLIC_DISK_GROUP;
fileWritten1.diskFileOwnerUid = PUBLIC_DISK_USER;
fileWritten1.diskFileGid = PUBLIC_DISK_GROUP;
fileWritten1.size = archiveFileSize;
fileWritten1.checksumBlob.insert(checksum::ADLER32, "2468");
fileWritten1.storageClassName = storageClass.name;
......@@ -9031,8 +9031,8 @@ TEST_P(cta_catalogue_CatalogueTest, DISABLED_concurrent_filesWrittenToTape_many_
fileWritten.diskInstance = storageClass.diskInstance;
fileWritten.diskFileId = diskFileId.str();
fileWritten.diskFilePath = diskFilePath.str();
fileWritten.diskFileOwnerUid = PUBLIC_DISK_USER;
fileWritten.diskFileGid = PUBLIC_DISK_GROUP;
fileWritten.diskFileOwnerUid = PUBLIC_DISK_USER;
fileWritten.diskFileGid = PUBLIC_DISK_GROUP;
fileWritten.size = archiveFileSize;
fileWritten.checksumBlob.insert(checksum::ADLER32, "1357");
fileWritten.storageClassName = storageClass.name;
......@@ -9092,8 +9092,8 @@ TEST_P(cta_catalogue_CatalogueTest, DISABLED_concurrent_filesWrittenToTape_many_
fileWritten.diskInstance = storageClass.diskInstance;
fileWritten.diskFileId = diskFileId.str();
fileWritten.diskFilePath = diskFilePath.str();
fileWritten.diskFileOwnerUid = PUBLIC_DISK_USER;
fileWritten.diskFileGid = PUBLIC_DISK_GROUP;
fileWritten.diskFileOwnerUid = PUBLIC_DISK_USER;
fileWritten.diskFileGid = PUBLIC_DISK_GROUP;
fileWritten.size = archiveFileSize;
fileWritten.checksumBlob.insert(checksum::ADLER32, "1357");
fileWritten.storageClassName = storageClass.name;
......@@ -9262,7 +9262,7 @@ TEST_P(cta_catalogue_CatalogueTest, DISABLED_concurrent_filesWrittenToTape_many_
{
catalogue::TapeFileSearchCriteria searchCriteria;
searchCriteria.diskInstance = storageClass.diskInstance;
searchCriteria.diskFileGid = PUBLIC_DISK_GROUP;
searchCriteria.diskFileGid = PUBLIC_DISK_GROUP;
auto archiveFileItor = m_catalogue->getArchiveFilesItor(searchCriteria);
const auto m = archiveFileItorToMap(archiveFileItor);
ASSERT_EQ(nbArchiveFiles, m.size());
......@@ -9463,7 +9463,7 @@ TEST_P(cta_catalogue_CatalogueTest, filesWrittenToTape_1_archive_file_2_tape_cop
file1Written.diskFileId = "5678";
file1Written.diskFilePath = "/public_dir/public_file";
file1Written.diskFileOwnerUid = PUBLIC_DISK_USER;
file1Written.diskFileGid = PUBLIC_DISK_GROUP;
file1Written.diskFileGid = PUBLIC_DISK_GROUP;
file1Written.size = archiveFileSize;
file1Written.checksumBlob.insert(checksum::ADLER32, "1234");
file1Written.storageClassName = storageClass.name;
......@@ -9682,7 +9682,7 @@ TEST_P(cta_catalogue_CatalogueTest, filesWrittenToTape_1_archive_file_2_tape_cop
file1Written.diskFileId = "5678";
file1Written.diskFilePath = "/public_dir/public_file";
file1Written.diskFileOwnerUid = PUBLIC_DISK_USER;
file1Written.diskFileGid = PUBLIC_DISK_GROUP;
file1Written.diskFileGid = PUBLIC_DISK_GROUP;
file1Written.size = archiveFileSize;
file1Written.checksumBlob.insert(checksum::ADLER32, "1234");
file1Written.storageClassName = storageClass.name;
......@@ -9872,7 +9872,7 @@ TEST_P(cta_catalogue_CatalogueTest, filesWrittenToTape_1_archive_file_2_tape_cop
file1Written.diskFileId = "5678";
file1Written.diskFilePath = "/public_dir/public_file";
file1Written.diskFileOwnerUid = PUBLIC_DISK_USER;
file1Written.diskFileGid = PUBLIC_DISK_GROUP;
file1Written.diskFileGid = PUBLIC_DISK_GROUP;
file1Written.size = archiveFileSize;
file1Written.checksumBlob.insert(checksum::ADLER32, "1234");
file1Written.storageClassName = storageClass.name;
......@@ -10090,7 +10090,7 @@ TEST_P(cta_catalogue_CatalogueTest, filesWrittenToTape_1_archive_file_2_tape_cop
file1Written.diskFileId = "5678";
file1Written.diskFilePath = "/public_dir/public_file";
file1Written.diskFileOwnerUid = PUBLIC_DISK_USER;
file1Written.diskFileGid = PUBLIC_DISK_GROUP;
file1Written.diskFileGid = PUBLIC_DISK_GROUP;
file1Written.size = archiveFileSize1;
file1Written.checksumBlob.insert(checksum::ADLER32, "1234");
file1Written.storageClassName = storageClass.name;
......@@ -10267,7 +10267,7 @@ TEST_P(cta_catalogue_CatalogueTest, filesWrittenToTape_1_archive_file_2_tape_cop
file1Written.diskFileId = "5678";
file1Written.diskFilePath = "/public_dir/public_file";
file1Written.diskFileOwnerUid = PUBLIC_DISK_USER;
file1Written.diskFileGid = PUBLIC_DISK_GROUP;
file1Written.diskFileGid = PUBLIC_DISK_GROUP;
file1Written.size = archiveFileSize;
file1Written.checksumBlob.insert(checksum::ADLER32, "1234");
file1Written.storageClassName = storageClass.name;
......@@ -10441,7 +10441,7 @@ TEST_P(cta_catalogue_CatalogueTest, filesWrittenToTape_1_archive_file_2_tape_cop
file1Written.diskFileId = "5678";
file1Written.diskFilePath = "/public_dir/public_file";
file1Written.diskFileOwnerUid = PUBLIC_DISK_USER;
file1Written.diskFileGid = PUBLIC_DISK_GROUP;
file1Written.diskFileGid = PUBLIC_DISK_GROUP;
file1Written.size = archiveFileSize;
file1Written.checksumBlob.insert(checksum::ADLER32, "1234");
file1Written.storageClassName = storageClass.name;
......@@ -10616,7 +10616,7 @@ TEST_P(cta_catalogue_CatalogueTest, deleteArchiveFile) {
file1Written.diskFileId = "5678";
file1Written.diskFilePath = "/public_dir/public_file";
file1Written.diskFileOwnerUid = PUBLIC_DISK_USER;
file1Written.diskFileGid = PUBLIC_DISK_GROUP;
file1Written.diskFileGid = PUBLIC_DISK_GROUP;
file1Written.size = archiveFileSize;
file1Written.checksumBlob.insert(checksum::ADLER32, "1234");
file1Written.storageClassName = storageClass.name;
......@@ -10915,7 +10915,7 @@ TEST_P(cta_catalogue_CatalogueTest, deleteArchiveFile_by_archive_file_id_of_anot
file1Written.diskFileId = "5678";
file1Written.diskFilePath = "/public_dir/public_file";
file1Written.diskFileOwnerUid = PUBLIC_DISK_USER;
file1Written.diskFileGid = PUBLIC_DISK_GROUP;
file1Written.diskFileGid = PUBLIC_DISK_GROUP;
file1Written.size = archiveFileSize;
file1Written.checksumBlob.insert(checksum::ADLER32, "1234");
file1Written.storageClassName = storageClass.name;
......@@ -11415,7 +11415,7 @@ TEST_P(cta_catalogue_CatalogueTest, reclaimTape_full_lastFSeq_1_no_tape_files) {
file1Written.diskFileId = "5678";
file1Written.diskFilePath = "/public_dir/public_file";
file1Written.diskFileOwnerUid = PUBLIC_DISK_USER;
file1Written.diskFileGid = PUBLIC_DISK_GROUP;
file1Written.diskFileGid = PUBLIC_DISK_GROUP;
file1Written.size = archiveFileSize;
file1Written.checksumBlob.insert(checksum::ADLER32, "1234");
file1Written.storageClassName = storageClass.name;
......@@ -11786,8 +11786,6 @@ TEST_P(cta_catalogue_CatalogueTest, reclaimTape_full_lastFSeq_1_one_tape_file_su
const uint64_t archiveFileSize = 1;
const std::string tapeDrive = "tape_drive";
const std::string checksumType = "checksum_type";
const std::string checksumValue = "checksum_value";
auto file1WrittenUP=cta::make_unique<cta::catalogue::TapeFileWritten>();
auto & file1Written = *file1WrittenUP;
......@@ -11797,16 +11795,15 @@ TEST_P(cta_catalogue_CatalogueTest, reclaimTape_full_lastFSeq_1_one_tape_file_su
file1Written.diskInstance = storageClass.diskInstance;
file1Written.diskFileId = "5678";
file1Written.diskFilePath = "/public_dir/public_file";
file1Written.diskFileUser = "public_disk_user";
file1Written.diskFileGroup = "public_disk_group";
file1Written.diskFileOwnerUid = PUBLIC_DISK_USER;
file1Written.diskFileGid = PUBLIC_DISK_GROUP;
file1Written.size = archiveFileSize;
file1Written.checksumType = checksumType;
file1Written.checksumValue = checksumValue;
file1Written.checksumBlob.insert(checksum::ADLER32, "1234");
file1Written.storageClassName = storageClass.name;
file1Written.vid = vid1;
file1Written.fSeq = 1;
file1Written.blockId = 4321;
file1Written.compressedSize = 1;
file1Written.size = 1;
file1Written.copyNb = 1;
file1Written.tapeDrive = tapeDrive;
m_catalogue->filesWrittenToTape(file1WrittenSet);
......@@ -11817,14 +11814,13 @@ TEST_P(cta_catalogue_CatalogueTest, reclaimTape_full_lastFSeq_1_one_tape_file_su
ASSERT_EQ(file1Written.archiveFileId, archiveFile.archiveFileID);
ASSERT_EQ(file1Written.diskFileId, archiveFile.diskFileId);
ASSERT_EQ(file1Written.size, archiveFile.fileSize);
ASSERT_EQ(file1Written.checksumType, archiveFile.checksumType);
ASSERT_EQ(file1Written.checksumValue, archiveFile.checksumValue);
ASSERT_EQ(file1Written.checksumBlob, archiveFile.checksumBlob);
ASSERT_EQ(file1Written.storageClassName, archiveFile.storageClass);
ASSERT_EQ(file1Written.diskInstance, archiveFile.diskInstance);
ASSERT_EQ(file1Written.diskFilePath, archiveFile.diskFileInfo.path);
ASSERT_EQ(file1Written.diskFileUser, archiveFile.diskFileInfo.owner);
ASSERT_EQ(file1Written.diskFileGroup, archiveFile.diskFileInfo.group);
ASSERT_EQ(file1Written.diskFileOwnerUid, archiveFile.diskFileInfo.owner_uid);
ASSERT_EQ(file1Written.diskFileGid, archiveFile.diskFileInfo.gid);
ASSERT_EQ(1, archiveFile.tapeFiles.size());
auto copyNbToTapeFile1Itor = archiveFile.tapeFiles.find(1);
......@@ -11833,9 +11829,8 @@ TEST_P(cta_catalogue_CatalogueTest, reclaimTape_full_lastFSeq_1_one_tape_file_su
ASSERT_EQ(file1Written.vid, tapeFile1.vid);
ASSERT_EQ(file1Written.fSeq, tapeFile1.fSeq);
ASSERT_EQ(file1Written.blockId, tapeFile1.blockId);
ASSERT_EQ(file1Written.compressedSize, tapeFile1.compressedSize);
ASSERT_EQ(file1Written.checksumType, tapeFile1.checksumType);
ASSERT_EQ(file1Written.checksumValue, tapeFile1.checksumValue);
ASSERT_EQ(file1Written.size, tapeFile1.fileSize);
ASSERT_EQ(file1Written.checksumBlob, tapeFile1.checksumBlob);
ASSERT_EQ(file1Written.copyNb, tapeFile1.copyNb);
}
......@@ -11884,16 +11879,15 @@ TEST_P(cta_catalogue_CatalogueTest, reclaimTape_full_lastFSeq_1_one_tape_file_su
file1WrittenAgain.diskInstance = storageClass.diskInstance;
file1WrittenAgain.diskFileId = "5678";
file1WrittenAgain.diskFilePath = "/public_dir/public_file";
file1WrittenAgain.diskFileUser = "public_disk_user";
file1WrittenAgain.diskFileGroup = "public_disk_group";
file1WrittenAgain.diskFileOwnerUid = PUBLIC_DISK_USER;
file1WrittenAgain.diskFileGid = PUBLIC_DISK_GROUP;
file1WrittenAgain.size = archiveFileSize;
file1WrittenAgain.checksumType = checksumType;
file1WrittenAgain.checksumValue = checksumValue;
file1WrittenAgain.checksumBlob.insert(checksum::ADLER32, "1234");
file1WrittenAgain.storageClassName = storageClass.name;
file1WrittenAgain.vid = vid2;
file1WrittenAgain.fSeq = 1;
file1WrittenAgain.blockId = 4321;
file1WrittenAgain.compressedSize = 1;
file1WrittenAgain.size = 1;
file1WrittenAgain.copyNb = 1;
file1WrittenAgain.tapeDrive = tapeDrive;
m_catalogue->filesWrittenToTape(file1WrittenAgainSet);
......
......@@ -58,6 +58,25 @@ const std::map<ChecksumType, std::string> ChecksumTypeName = {
*/
class ChecksumBlob {
public:
/*!
* Default constructor
*/
ChecksumBlob() {}
/*!
* Construct and insert one checksum
*/
ChecksumBlob(ChecksumType type, const std::string &value) {
insert(type, value);
}
/*!
* Construct and insert one 32-bit checksum
*/
ChecksumBlob(ChecksumType type, uint32_t value) {
insert(type, value);
}
/*!
* Clear all of the checksums in this blob
*/
......@@ -73,7 +92,8 @@ public:
/*!
* Insert a new 32-bit checksum into the blob
*
* Only valid for Adler-32, CRC-32 and CRC-32c checksums
* Only valid for Adler-32, CRC-32 and CRC-32c checksums. Throws an
* exception for other checksum types.
*
* @param[in] value 32-bit unsigned integer containing the checksum
*/
......
......@@ -96,6 +96,7 @@ TEST_F(cta_common_dataStructures_ArchiveFileTest, copy_constructor) {
ASSERT_EQ(tapeFile1.vid, copyNbToTapeFileItor->vid);
ASSERT_EQ(tapeFile1.fSeq, copyNbToTapeFileItor->fSeq);
ASSERT_EQ(tapeFile1.blockId, copyNbToTapeFileItor->blockId);
ASSERT_EQ(tapeFile1.fileSize, copyNbToTapeFileItor->fileSize);
ASSERT_EQ(tapeFile1.copyNb, copyNbToTapeFileItor->copyNb);
}
......@@ -106,6 +107,7 @@ TEST_F(cta_common_dataStructures_ArchiveFileTest, copy_constructor) {
ASSERT_EQ(tapeFile2.vid, copyNbToTapeFileItor->vid);
ASSERT_EQ(tapeFile2.fSeq, copyNbToTapeFileItor->fSeq);
ASSERT_EQ(tapeFile2.blockId, copyNbToTapeFileItor->blockId);
ASSERT_EQ(tapeFile2.fileSize, copyNbToTapeFileItor->fileSize);
ASSERT_EQ(tapeFile2.copyNb, copyNbToTapeFileItor->copyNb);
}
}
......
......@@ -1085,8 +1085,7 @@ RetrieveRequest::AsyncRetrieveToArchiveTransformer * RetrieveRequest::asyncTrans
serializers::ArchiveRequest archiveRequestPayload;
const cta::objectstore::serializers::ArchiveFile& archiveFile = retrieveRequestPayload.archivefile();
archiveRequestPayload.set_archivefileid(archiveFile.archivefileid());
archiveRequestPayload.set_checksumtype(archiveFile.checksumtype());
archiveRequestPayload.set_checksumvalue(archiveFile.checksumvalue());
archiveRequestPayload.set_checksumblob(archiveFile.checksumblob());
archiveRequestPayload.set_creationtime(archiveFile.creationtime()); //TODO : should the creation time be the same as the archiveFile creation time ?
archiveRequestPayload.set_diskfileid(archiveFile.diskfileid());
archiveRequestPayload.set_diskinstance(archiveFile.diskinstance());
......@@ -1116,7 +1115,7 @@ RetrieveRequest::AsyncRetrieveToArchiveTransformer * RetrieveRequest::asyncTrans
//ArchiveRequest source url is the same as the retrieveRequest destination URL
const cta::objectstore::serializers::SchedulerRetrieveRequest schedulerRetrieveRequest = retrieveRequestPayload.schedulerrequest();
archiveRequestPayload.set_srcurl(schedulerRetrieveRequest.dsturl());
cta::objectstore::serializers::UserIdentity *archiveRequestUser = archiveRequestPayload.mutable_requester();
cta::objectstore::serializers::RequesterIdentity *archiveRequestUser = archiveRequestPayload.mutable_requester();
archiveRequestUser->CopyFrom(schedulerRetrieveRequest.requester());
//Copy the RetrieveRequest MountPolicy into the new ArchiveRequest
......
......@@ -80,8 +80,7 @@ TEST(ObjectStore,SorterInsertArchiveRequest){
cta::common::dataStructures::ArchiveFile aFile;
aFile.archiveFileID = 123456789L;
aFile.diskFileId = "eos://diskFile";
aFile.checksumType = "checksumType";
aFile.checksumValue = "checksumValue";
aFile.checksumBlob.insert(cta::checksum::ADLER32, "1234");
aFile.creationTime = 0;
aFile.reconciliationTime = 0;
aFile.diskFileInfo = cta::common::dataStructures::DiskFileInfo();
......@@ -98,7 +97,7 @@ TEST(ObjectStore,SorterInsertArchiveRequest){
ar.setMountPolicy(mp);
ar.setArchiveReportURL("");
ar.setArchiveErrorReportURL("");
ar.setRequester(cta::common::dataStructures::UserIdentity("user0", "group0"));
ar.setRequester(cta::common::dataStructures::RequesterIdentity("user0", "group0"));
ar.setSrcURL("root://eoseos/myFile");
ar.setEntryLog(cta::common::dataStructures::EntryLog("user0", "host0", time(nullptr)));
ar.insert();
......@@ -145,8 +144,7 @@ TEST(ObjectStore,SorterInsertArchiveRequest){
ASSERT_EQ(archiveFile.archiveFileID,aFile.archiveFileID);
ASSERT_EQ(archiveFile.diskFileId,aFile.diskFileId);
ASSERT_EQ(archiveFile.checksumType,aFile.checksumType);
ASSERT_EQ(archiveFile.checksumValue,aFile.checksumValue);
ASSERT_EQ(archiveFile.checksumBlob,aFile.checksumBlob);
ASSERT_EQ(archiveFile.creationTime,aFile.creationTime);
ASSERT_EQ(archiveFile.reconciliationTime,aFile.reconciliationTime);
ASSERT_EQ(archiveFile.diskFileInfo,aFile.diskFileInfo);
......@@ -175,8 +173,7 @@ TEST(ObjectStore,SorterInsertArchiveRequest){
ASSERT_EQ(archiveFile.archiveFileID,aFile.archiveFileID);
ASSERT_EQ(archiveFile.diskFileId,aFile.diskFileId);
ASSERT_EQ(archiveFile.checksumType,aFile.checksumType);
ASSERT_EQ(archiveFile.checksumValue,aFile.checksumValue);
ASSERT_EQ(archiveFile.checksumBlob,aFile.checksumBlob);
ASSERT_EQ(archiveFile.creationTime,aFile.creationTime);
ASSERT_EQ(archiveFile.reconciliationTime,aFile.reconciliationTime);
ASSERT_EQ(archiveFile.diskFileInfo,aFile.diskFileInfo);
......@@ -231,8 +228,7 @@ TEST(ObjectStore,SorterInsertRetrieveRequest){
cta::common::dataStructures::RetrieveFileQueueCriteria rqc;
rqc.archiveFile.archiveFileID = 123456789L;
rqc.archiveFile.diskFileId = "eos://diskFile";
rqc.archiveFile.checksumType = "";
rqc.archiveFile.checksumValue = "";
rqc.archiveFile.checksumBlob.insert(cta::checksum::NONE, "");
rqc.archiveFile.creationTime = 0;
rqc.archiveFile.reconciliationTime = 0;
rqc.archiveFile.diskFileInfo = cta::common::dataStructures::DiskFileInfo();
......@@ -242,8 +238,7 @@ TEST(ObjectStore,SorterInsertRetrieveRequest){
{
cta::common::dataStructures::TapeFile tf;
tf.blockId=0;
tf.compressedSize=1;
tf.compressedSize=1;
tf.fileSize=1;
tf.copyNb=1;
tf.creationTime=time(nullptr);
tf.fSeq=2;
......@@ -253,8 +248,7 @@ TEST(ObjectStore,SorterInsertRetrieveRequest){
{
cta::common::dataStructures::TapeFile tf;
tf.blockId=0;
tf.compressedSize=2;
tf.compressedSize=2;
tf.fileSize=2;
tf.copyNb=2;
tf.creationTime=time(nullptr);
tf.fSeq=2;
......@@ -318,8 +312,7 @@ TEST(ObjectStore,SorterInsertRetrieveRequest){
cta::common::dataStructures::ArchiveFile aFile = elt.archiveFile;
ASSERT_EQ(aFile.archiveFileID,rqc.archiveFile.archiveFileID);
ASSERT_EQ(aFile.diskFileId,rqc.archiveFile.diskFileId);
ASSERT_EQ(aFile.checksumType,rqc.archiveFile.checksumType);
ASSERT_EQ(aFile.checksumValue,rqc.archiveFile.checksumValue);
ASSERT_EQ(aFile.checksumBlob,rqc.archiveFile.checksumBlob);
ASSERT_EQ(aFile.creationTime,rqc.archiveFile.creationTime);
ASSERT_EQ(aFile.reconciliationTime,rqc.archiveFile.reconciliationTime);
ASSERT_EQ(aFile.diskFileInfo,rqc.archiveFile.diskFileInfo);
......@@ -363,15 +356,14 @@ TEST(ObjectStore,SorterInsertRetrieveRequest){
cta::common::dataStructures::ArchiveFile aFile = elt.archiveFile;
ASSERT_EQ(aFile.archiveFileID,rqc.archiveFile.archiveFileID);
ASSERT_EQ(aFile.diskFileId,rqc.archiveFile.diskFileId);
ASSERT_EQ(aFile.checksumType,rqc.archiveFile.checksumType);
ASSERT_EQ(aFile.checksumValue,rqc.archiveFile.checksumValue);
ASSERT_EQ(aFile.checksumBlob,rqc.archiveFile.checksumBlob);
ASSERT_EQ(aFile.creationTime,rqc.archiveFile.creationTime);
ASSERT_EQ(aFile.reconciliationTime,rqc.archiveFile.reconciliationTime);
ASSERT_EQ(aFile.diskFileInfo,rqc.archiveFile.diskFileInfo);
ASSERT_EQ(aFile.fileSize,rqc.archiveFile.fileSize);
ASSERT_EQ(aFile.storageClass,rqc.archiveFile.storageClass);
ASSERT_EQ(elt.copyNb,2);
ASSERT_EQ(elt.archiveFile.tapeFiles.at(2).compressedSize,2);
ASSERT_EQ(elt.archiveFile.tapeFiles.at(2).fileSize,2);
ASSERT_EQ(elt.bytes,1000);
ASSERT_EQ(elt.reportType,cta::SchedulerDatabase::RetrieveJob::ReportType::NoReportRequired);
ASSERT_EQ(elt.rr.archiveFileID,aFile.archiveFileID);
......@@ -436,8 +428,7 @@ TEST(ObjectStore,SorterInsertDifferentTypesOfRequests){
cta::common::dataStructures::RetrieveFileQueueCriteria rqc;
rqc.archiveFile.archiveFileID = 1L;
rqc.archiveFile.diskFileId = "eos://diskFile1";
rqc.archiveFile.checksumType = "";
rqc.archiveFile.checksumValue = "";
rqc.archiveFile.checksumBlob.insert(cta::checksum::NONE, "");
rqc.archiveFile.creationTime = 0;
rqc.archiveFile.reconciliationTime = 0;
rqc.archiveFile.diskFileInfo = cta::common::dataStructures::DiskFileInfo();
......@@ -447,8 +438,7 @@ TEST(ObjectStore,SorterInsertDifferentTypesOfRequests){
{
cta::common::dataStructures::TapeFile tf;
tf.blockId=0;
tf.compressedSize=1;
tf.compressedSize=1;
tf.fileSize=1;
tf.copyNb=1;
tf.creationTime=time(nullptr);
tf.fSeq=1;
......@@ -480,8 +470,7 @@ TEST(ObjectStore,SorterInsertDifferentTypesOfRequests){
cta::common::dataStructures::RetrieveFileQueueCriteria rqc2;
rqc2.archiveFile.archiveFileID = 2L;
rqc2.archiveFile.diskFileId = "eos://diskFile2";
rqc2.archiveFile.checksumType = "";
rqc2.archiveFile.checksumValue = "";
rqc2.archiveFile.checksumBlob.insert(cta::checksum::NONE, "");
rqc2.archiveFile.creationTime = 0;
rqc2.archiveFile.reconciliationTime = 0;
rqc2.archiveFile.diskFileInfo = cta::common::dataStructures::DiskFileInfo();
......@@ -491,8 +480,7 @@ TEST(ObjectStore,SorterInsertDifferentTypesOfRequests){
{
cta::common::dataStructures::TapeFile tf;
tf.blockId=0;
tf.compressedSize=1;
tf.compressedSize=1;
tf.fileSize=1;
tf.copyNb=2;
tf.creationTime=time(nullptr);
tf.fSeq=2;
......@@ -559,8 +547,7 @@ TEST(ObjectStore,SorterInsertDifferentTypesOfRequests){
cta::common::dataStructures::ArchiveFile aFile;
aFile.archiveFileID = 3L;
aFile.diskFileId = "eos://diskFile";
aFile.checksumType = "checksumType";
aFile.checksumValue = "checksumValue";
aFile.checksumBlob.insert(cta::checksum::ADLER32, "1234");
aFile.creationTime = 0;
aFile.reconciliationTime = 0;
aFile.diskFileInfo = cta::common::dataStructures::DiskFileInfo();
......@@ -573,7 +560,7 @@ TEST(ObjectStore,SorterInsertDifferentTypesOfRequests){
ar.setMountPolicy(mp);
ar.setArchiveReportURL("");
ar.setArchiveErrorReportURL("");
ar.setRequester(cta::common::dataStructures::UserIdentity("user0", "group0"));
ar.setRequester(cta::common::dataStructures::RequesterIdentity("user0", "group0"));
ar.setSrcURL("root://eoseos/myFile");
ar.setEntryLog(cta::common::dataStructures::EntryLog("user0", "host0", time(nullptr)));
ar.insert();
......@@ -585,8 +572,7 @@ TEST(ObjectStore,SorterInsertDifferentTypesOfRequests){
cta::common::dataStructures::ArchiveFile aFile2;
aFile2.archiveFileID = 4L;
aFile2.diskFileId = "eos://diskFile";
aFile2.checksumType = "checksumType";
aFile2.checksumValue = "checksumValue";
aFile2.checksumBlob.insert(cta::checksum::ADLER32, "1234");
aFile2.creationTime = 0;
aFile2.reconciliationTime = 0;
aFile2.diskFileInfo = cta::common::dataStructures::DiskFileInfo();
......@@ -600,7 +586,7 @@ TEST(ObjectStore,SorterInsertDifferentTypesOfRequests){
ar2.setMountPolicy(mp);
ar2.setArchiveReportURL("");
ar2.setArchiveErrorReportURL("");
ar2.setRequester(cta::common::dataStructures::UserIdentity("user0", "group0"));
ar2.setRequester(cta::common::dataStructures::RequesterIdentity("user0", "group0"));
ar2.setSrcURL("root://eoseos/myFile");
ar2.setEntryLog(cta::common::dataStructures::EntryLog("user0", "host0", time(nullptr)));
ar2.insert();
......@@ -747,8 +733,7 @@ TEST(ObjectStore,SorterInsertArchiveRequestNotFetched){
cta::common::dataStructures::ArchiveFile aFile;
aFile.archiveFileID = 3L;
aFile.diskFileId = "eos://diskFile";
aFile.checksumType = "checksumType";
aFile.checksumValue = "checksumValue";
aFile.checksumBlob.insert(cta::checksum::ADLER32, "1234");
aFile.creationTime = 0;
aFile.reconciliationTime = 0;
aFile.diskFileInfo = cta::common::dataStructures::DiskFileInfo();
......@@ -762,7 +747,7 @@ TEST(ObjectStore,SorterInsertArchiveRequestNotFetched){
ar.setMountPolicy(mp);
ar.setArchiveReportURL("");
ar.setArchiveErrorReportURL("");
ar.setRequester(cta::common::dataStructures::UserIdentity("user0", "group0"));
ar.setRequester(cta::common::dataStructures::RequesterIdentity("user0", "group0"));
ar.setSrcURL("root://eoseos/myFile");
ar.setEntryLog(cta::common::dataStructures::EntryLog("user0", "host0", time(nullptr)));
ar.insert();
......@@ -830,8 +815,7 @@ TEST(ObjectStore,SorterInsertArchiveRequestNotFetched){
ASSERT_EQ(elt.copyNb,1);
ASSERT_EQ(elt.archiveFile.archiveFileID,3L);
ASSERT_EQ(elt.archiveFile.checksumType,"checksumType");
ASSERT_EQ(elt.archiveFile.checksumValue,"checksumValue");
ASSERT_EQ(elt.archiveFile.checksumBlob,cta::checksum::ChecksumBlob(cta::checksum::ADLER32, "1234"));
ASSERT_EQ(elt.archiveFile.diskInstance,"eoseos");
ASSERT_EQ(elt.archiveFile.diskFileId,"eos://diskFile");
......@@ -839,8 +823,7 @@ TEST(ObjectStore,SorterInsertArchiveRequestNotFetched){
ASSERT_EQ(elt2.copyNb,2);
ASSERT_EQ(elt2.archiveFile.archiveFileID,3L);
ASSERT_EQ(elt2.archiveFile.checksumType,"checksumType");
ASSERT_EQ(elt2.archiveFile.checksumValue,"checksumValue");
ASSERT_EQ(elt2.archiveFile.checksumBlob,cta::checksum::ChecksumBlob(cta::checksum::ADLER32, "1234"));
ASSERT_EQ(elt.archiveFile.diskInstance,"eoseos");
ASSERT_EQ(elt.archiveFile.diskFileId,"eos://diskFile");
}
......@@ -893,8 +876,7 @@ TEST(ObjectStore,SorterInsertRetrieveRequestNotFetched){
cta::common::dataStructures::RetrieveFileQueueCriteria rqc;
rqc.archiveFile.archiveFileID = 1L;
rqc.archiveFile.diskFileId = "eos://diskFile";
rqc.archiveFile.checksumType = "checksumType";
rqc.archiveFile.checksumValue = "checksumValue";
rqc.archiveFile.checksumBlob.insert(cta::checksum::ADLER32, "1234");
rqc.archiveFile.creationTime = 0;
rqc.archiveFile.reconciliationTime = 0;
rqc.archiveFile.diskFileInfo = cta::common::dataStructures::DiskFileInfo();
......@@ -904,8 +886,7 @@ TEST(ObjectStore,SorterInsertRetrieveRequestNotFetched){
{
cta::common::dataStructures::TapeFile tf;
tf.blockId=0;
tf.compressedSize=1;
tf.compressedSize=1;
tf.fileSize=1;
tf.copyNb=1;
tf.creationTime=time(nullptr);
tf.fSeq=1;
......@@ -978,8 +959,7 @@ TEST(ObjectStore,SorterInsertRetrieveRequestNotFetched){
ASSERT_EQ(elt.copyNb,1);
ASSERT_EQ(elt.archiveFile.tapeFiles.at(1).vid,"Tape0");
ASSERT_EQ(elt.archiveFile.tapeFiles.at(1).fSeq,1);
ASSERT_EQ(elt.archiveFile.checksumValue,"checksumValue");
ASSERT_EQ(elt.archiveFile.checksumType,"checksumType");
ASSERT_EQ(elt.archiveFile.checksumBlob,cta::checksum::ChecksumBlob(cta::checksum::ADLER32, "1234"));
ASSERT_EQ(elt.archiveFile.diskInstance,"eoseos");
ASSERT_EQ(elt.archiveFile.fileSize,1000);
ASSERT_EQ(elt.archiveFile.storageClass,"sc");
......@@ -987,4 +967,4 @@ TEST(ObjectStore,SorterInsertRetrieveRequestNotFetched){
}
}
\ No newline at end of file
}
......@@ -73,7 +73,6 @@ class StorageClass;
class Tape;
class TapeMount;
class TapeSession;
class UserIdentity;
class RepackRequest;
namespace objectstore{
class RetrieveRequest;
......
......@@ -1395,8 +1395,6 @@ TEST_P(SchedulerTest, expandRepackRequest) {