Commit 973f3f8c authored by Michael Davis's avatar Michael Davis
Browse files

[catalogue] Changes type of file owner user and group from string to numeric uid/gid

parent f4b6f623
...@@ -38,8 +38,8 @@ bool ArchiveFileRow::operator==(const ArchiveFileRow &rhs) const { ...@@ -38,8 +38,8 @@ bool ArchiveFileRow::operator==(const ArchiveFileRow &rhs) const {
diskInstance == rhs.diskInstance && diskInstance == rhs.diskInstance &&
diskFileId == rhs.diskFileId && diskFileId == rhs.diskFileId &&
diskFilePath == rhs.diskFilePath && diskFilePath == rhs.diskFilePath &&
diskFileUser == rhs.diskFileUser && diskFileOwnerUid == rhs.diskFileOwnerUid &&
diskFileGroup == rhs.diskFileGroup && diskFileGid == rhs.diskFileGid &&
size == rhs.size && size == rhs.size &&
checksumType == rhs.checksumType && checksumType == rhs.checksumType &&
checksumValue == rhs.checksumValue && checksumValue == rhs.checksumValue &&
...@@ -56,8 +56,8 @@ std::ostream &operator<<(std::ostream &os, const ArchiveFileRow &obj) { ...@@ -56,8 +56,8 @@ std::ostream &operator<<(std::ostream &os, const ArchiveFileRow &obj) {
"diskInstance=" << obj.diskInstance << "diskInstance=" << obj.diskInstance <<
"diskFileId=" << obj.diskFileId << "diskFileId=" << obj.diskFileId <<
"diskFilePath=" << obj.diskFilePath << "diskFilePath=" << obj.diskFilePath <<
"diskFileUser=" << obj.diskFileUser << "diskFileOwnerUid=" << obj.diskFileOwnerUid <<
"diskFileGroup=" << obj.diskFileGroup << "diskFileGid=" << obj.diskFileGid <<
"size=" << obj.size << "size=" << obj.size <<
"checksumType=" << obj.checksumType << "checksumValue=" << obj.checksumValue << "checksumType=" << obj.checksumType << "checksumValue=" << obj.checksumValue <<
"storageClassName=" << obj.storageClassName << "storageClassName=" << obj.storageClassName <<
......
...@@ -69,14 +69,14 @@ struct ArchiveFileRow { ...@@ -69,14 +69,14 @@ struct ArchiveFileRow {
std::string diskFilePath; std::string diskFilePath;
/** /**
* The user name of the source disk file within its host disk system. * The user ID of the owner of the source disk file within its host disk system.
*/ */
std::string diskFileUser; uint32_t diskFileOwnerUid;
/** /**
* The group name of the source disk file within its host disk system. * The group ID of the source disk file within its host disk system.
*/ */
std::string diskFileGroup; uint32_t diskFileGid;
/** /**
* The uncompressed size of the tape file in bytes. * The uncompressed size of the tape file in bytes.
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
#include "common/dataStructures/TapeCopyToPoolMap.hpp" #include "common/dataStructures/TapeCopyToPoolMap.hpp"
#include "common/dataStructures/TapeFile.hpp" #include "common/dataStructures/TapeFile.hpp"
#include "common/dataStructures/UpdateFileInfoRequest.hpp" #include "common/dataStructures/UpdateFileInfoRequest.hpp"
#include "common/dataStructures/UserIdentity.hpp" #include "common/dataStructures/RequesterIdentity.hpp"
#include "common/dataStructures/VidToTapeMap.hpp" #include "common/dataStructures/VidToTapeMap.hpp"
#include "common/dataStructures/WriteTestResult.hpp" #include "common/dataStructures/WriteTestResult.hpp"
#include "common/exception/UserError.hpp" #include "common/exception/UserError.hpp"
...@@ -114,7 +114,7 @@ public: ...@@ -114,7 +114,7 @@ public:
virtual uint64_t checkAndGetNextArchiveFileId( virtual uint64_t checkAndGetNextArchiveFileId(
const std::string &diskInstanceName, const std::string &diskInstanceName,
const std::string &storageClassName, const std::string &storageClassName,
const common::dataStructures::UserIdentity &user) = 0; const common::dataStructures::RequesterIdentity &user) = 0;
/** /**
* Returns the information required to queue an archive request. * Returns the information required to queue an archive request.
...@@ -133,7 +133,7 @@ public: ...@@ -133,7 +133,7 @@ public:
virtual common::dataStructures::ArchiveFileQueueCriteria getArchiveFileQueueCriteria( virtual common::dataStructures::ArchiveFileQueueCriteria getArchiveFileQueueCriteria(
const std::string &diskInstanceName, const std::string &diskInstanceName,
const std::string &storageClassName, const std::string &storageClassName,
const common::dataStructures::UserIdentity &user) = 0; const common::dataStructures::RequesterIdentity &user) = 0;
/** /**
* Returns the list of tapes that can be written to by a tape drive in the * Returns the list of tapes that can be written to by a tape drive in the
...@@ -184,7 +184,7 @@ public: ...@@ -184,7 +184,7 @@ public:
virtual common::dataStructures::RetrieveFileQueueCriteria prepareToRetrieveFile( virtual common::dataStructures::RetrieveFileQueueCriteria prepareToRetrieveFile(
const std::string &diskInstanceName, const std::string &diskInstanceName,
const uint64_t archiveFileId, const uint64_t archiveFileId,
const common::dataStructures::UserIdentity &user, const common::dataStructures::RequesterIdentity &user,
const optional<std::string> & activity, const optional<std::string> & activity,
log::LogContext &lc) = 0; log::LogContext &lc) = 0;
......
...@@ -68,12 +68,12 @@ public: ...@@ -68,12 +68,12 @@ public:
return retryOnLostConnection(m_log, [&]{return m_catalogue->tapeLabelled(vid, drive);}, m_maxTriesToConnect); return retryOnLostConnection(m_log, [&]{return m_catalogue->tapeLabelled(vid, drive);}, m_maxTriesToConnect);
} }
uint64_t checkAndGetNextArchiveFileId(const std::string &diskInstanceName, const std::string &storageClassName, const common::dataStructures::UserIdentity &user) override { uint64_t checkAndGetNextArchiveFileId(const std::string &diskInstanceName, const std::string &storageClassName, const common::dataStructures::RequesterIdentity &user) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->checkAndGetNextArchiveFileId(diskInstanceName, storageClassName, user);}, m_maxTriesToConnect); return retryOnLostConnection(m_log, [&]{return m_catalogue->checkAndGetNextArchiveFileId(diskInstanceName, storageClassName, user);}, m_maxTriesToConnect);
} }
common::dataStructures::ArchiveFileQueueCriteria getArchiveFileQueueCriteria(const std::string &diskInstanceName, common::dataStructures::ArchiveFileQueueCriteria getArchiveFileQueueCriteria(const std::string &diskInstanceName,
const std::string &storageClassName, const common::dataStructures::UserIdentity &user) override { const std::string &storageClassName, const common::dataStructures::RequesterIdentity &user) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->getArchiveFileQueueCriteria(diskInstanceName, storageClassName, user);}, m_maxTriesToConnect); return retryOnLostConnection(m_log, [&]{return m_catalogue->getArchiveFileQueueCriteria(diskInstanceName, storageClassName, user);}, m_maxTriesToConnect);
} }
...@@ -89,7 +89,7 @@ public: ...@@ -89,7 +89,7 @@ public:
return retryOnLostConnection(m_log, [&]{return m_catalogue->tapeMountedForArchive(vid, drive);}, m_maxTriesToConnect); return retryOnLostConnection(m_log, [&]{return m_catalogue->tapeMountedForArchive(vid, drive);}, m_maxTriesToConnect);
} }
common::dataStructures::RetrieveFileQueueCriteria prepareToRetrieveFile(const std::string& diskInstanceName, const uint64_t archiveFileId, const common::dataStructures::UserIdentity& user, const optional<std::string>& activity, log::LogContext& lc) override { common::dataStructures::RetrieveFileQueueCriteria prepareToRetrieveFile(const std::string& diskInstanceName, const uint64_t archiveFileId, const common::dataStructures::RequesterIdentity& user, const optional<std::string>& activity, log::LogContext& lc) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->prepareToRetrieveFile(diskInstanceName, archiveFileId, user, activity, lc);}, m_maxTriesToConnect); return retryOnLostConnection(m_log, [&]{return m_catalogue->prepareToRetrieveFile(diskInstanceName, archiveFileId, user, activity, lc);}, m_maxTriesToConnect);
} }
......
This diff is collapsed.
...@@ -107,10 +107,10 @@ public: ...@@ -107,10 +107,10 @@ public:
void noSpaceLeftOnTape(const std::string& vid) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } void noSpaceLeftOnTape(const std::string& vid) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void ping() override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } void ping() override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
std::map<std::string, uint64_t> getSchemaVersion() const override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } std::map<std::string, uint64_t> getSchemaVersion() const override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
uint64_t checkAndGetNextArchiveFileId(const std::string &diskInstanceName, const std::string &storageClassName, const common::dataStructures::UserIdentity &user) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } uint64_t checkAndGetNextArchiveFileId(const std::string &diskInstanceName, const std::string &storageClassName, const common::dataStructures::RequesterIdentity &user) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
common::dataStructures::ArchiveFileQueueCriteria getArchiveFileQueueCriteria(const std::string &diskInstanceName, common::dataStructures::ArchiveFileQueueCriteria getArchiveFileQueueCriteria(const std::string &diskInstanceName,
const std::string &storageClassName, const common::dataStructures::UserIdentity &user) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } const std::string &storageClassName, const common::dataStructures::RequesterIdentity &user) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
common::dataStructures::RetrieveFileQueueCriteria prepareToRetrieveFile(const std::string& diskInstanceName, const uint64_t archiveFileId, const common::dataStructures::UserIdentity& user, const optional<std::string>& activity, log::LogContext& lc) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } common::dataStructures::RetrieveFileQueueCriteria prepareToRetrieveFile(const std::string& diskInstanceName, const uint64_t archiveFileId, const common::dataStructures::RequesterIdentity& user, const optional<std::string>& activity, log::LogContext& lc) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void reclaimTape(const common::dataStructures::SecurityIdentity& admin, const std::string& vid) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } void reclaimTape(const common::dataStructures::SecurityIdentity& admin, const std::string& vid) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void setTapeDisabled(const common::dataStructures::SecurityIdentity& admin, const std::string& vid, const bool disabledValue) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } void setTapeDisabled(const common::dataStructures::SecurityIdentity& admin, const std::string& vid, const bool disabledValue) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void setTapeFull(const common::dataStructures::SecurityIdentity& admin, const std::string& vid, const bool fullValue) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } void setTapeFull(const common::dataStructures::SecurityIdentity& admin, const std::string& vid, const bool fullValue) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
......
...@@ -205,8 +205,7 @@ common::dataStructures::Tape MysqlCatalogue::selectTapeForUpdate(rdbms::Conn &co ...@@ -205,8 +205,7 @@ common::dataStructures::Tape MysqlCatalogue::selectTapeForUpdate(rdbms::Conn &co
tape.comment = rset.columnString("USER_COMMENT"); tape.comment = rset.columnString("USER_COMMENT");
common::dataStructures::UserIdentity creatorUI; // std::string creatorUIname = rset.columnString("CREATION_LOG_USER_NAME");
creatorUI.name = rset.columnString("CREATION_LOG_USER_NAME");
common::dataStructures::EntryLog creationLog; common::dataStructures::EntryLog creationLog;
creationLog.username = rset.columnString("CREATION_LOG_USER_NAME"); creationLog.username = rset.columnString("CREATION_LOG_USER_NAME");
...@@ -215,8 +214,7 @@ common::dataStructures::Tape MysqlCatalogue::selectTapeForUpdate(rdbms::Conn &co ...@@ -215,8 +214,7 @@ common::dataStructures::Tape MysqlCatalogue::selectTapeForUpdate(rdbms::Conn &co
tape.creationLog = creationLog; tape.creationLog = creationLog;
common::dataStructures::UserIdentity updaterUI; // std::string updaterUIname = rset.columnString("LAST_UPDATE_USER_NAME");
updaterUI.name = rset.columnString("LAST_UPDATE_USER_NAME");
common::dataStructures::EntryLog updateLog; common::dataStructures::EntryLog updateLog;
updateLog.username = rset.columnString("LAST_UPDATE_USER_NAME"); updateLog.username = rset.columnString("LAST_UPDATE_USER_NAME");
...@@ -320,8 +318,8 @@ void MysqlCatalogue::fileWrittenToTape(rdbms::Conn &conn, const TapeFileWritten ...@@ -320,8 +318,8 @@ void MysqlCatalogue::fileWrittenToTape(rdbms::Conn &conn, const TapeFileWritten
row.checksumValue = event.checksumValue; row.checksumValue = event.checksumValue;
row.storageClassName = event.storageClassName; row.storageClassName = event.storageClassName;
row.diskFilePath = event.diskFilePath; row.diskFilePath = event.diskFilePath;
row.diskFileUser = event.diskFileUser; row.diskFileOwnerUid = event.diskFileOwnerUid;
row.diskFileGroup = event.diskFileGroup; row.diskFileGid = event.diskFileGid;
insertArchiveFile(conn, row); insertArchiveFile(conn, row);
} catch(exception::DatabasePrimaryKeyError &) { } catch(exception::DatabasePrimaryKeyError &) {
// Ignore this error // Ignore this error
...@@ -437,8 +435,8 @@ void MysqlCatalogue::deleteArchiveFile(const std::string &diskInstanceName, cons ...@@ -437,8 +435,8 @@ void MysqlCatalogue::deleteArchiveFile(const std::string &diskInstanceName, cons
archiveFile->diskInstance = selectRset.columnString("DISK_INSTANCE_NAME"); archiveFile->diskInstance = selectRset.columnString("DISK_INSTANCE_NAME");
archiveFile->diskFileId = selectRset.columnString("DISK_FILE_ID"); archiveFile->diskFileId = selectRset.columnString("DISK_FILE_ID");
archiveFile->diskFileInfo.path = selectRset.columnString("DISK_FILE_PATH"); archiveFile->diskFileInfo.path = selectRset.columnString("DISK_FILE_PATH");
archiveFile->diskFileInfo.owner = selectRset.columnString("DISK_FILE_UID"); archiveFile->diskFileInfo.owner_uid = selectRset.columnUint64("DISK_FILE_UID");
archiveFile->diskFileInfo.group = selectRset.columnString("DISK_FILE_GID"); archiveFile->diskFileInfo.gid = selectRset.columnUint64("DISK_FILE_GID");
archiveFile->fileSize = selectRset.columnUint64("SIZE_IN_BYTES"); archiveFile->fileSize = selectRset.columnUint64("SIZE_IN_BYTES");
archiveFile->checksumType = selectRset.columnString("CHECKSUM_TYPE"); archiveFile->checksumType = selectRset.columnString("CHECKSUM_TYPE");
archiveFile->checksumValue = selectRset.columnString("CHECKSUM_VALUE"); archiveFile->checksumValue = selectRset.columnString("CHECKSUM_VALUE");
...@@ -482,8 +480,8 @@ void MysqlCatalogue::deleteArchiveFile(const std::string &diskInstanceName, cons ...@@ -482,8 +480,8 @@ void MysqlCatalogue::deleteArchiveFile(const std::string &diskInstanceName, cons
.add("requestDiskInstance", diskInstanceName) .add("requestDiskInstance", diskInstanceName)
.add("diskFileId", archiveFile->diskFileId) .add("diskFileId", archiveFile->diskFileId)
.add("diskFileInfo.path", archiveFile->diskFileInfo.path) .add("diskFileInfo.path", archiveFile->diskFileInfo.path)
.add("diskFileInfo.owner", archiveFile->diskFileInfo.owner) .add("diskFileInfo.owner_uid", archiveFile->diskFileInfo.owner_uid)
.add("diskFileInfo.group", archiveFile->diskFileInfo.group) .add("diskFileInfo.gid", archiveFile->diskFileInfo.gid)
.add("fileSize", std::to_string(archiveFile->fileSize)) .add("fileSize", std::to_string(archiveFile->fileSize))
.add("checksumType", archiveFile->checksumType) .add("checksumType", archiveFile->checksumType)
.add("checksumValue", archiveFile->checksumValue) .add("checksumValue", archiveFile->checksumValue)
...@@ -547,8 +545,8 @@ void MysqlCatalogue::deleteArchiveFile(const std::string &diskInstanceName, cons ...@@ -547,8 +545,8 @@ void MysqlCatalogue::deleteArchiveFile(const std::string &diskInstanceName, cons
.add("diskInstance", archiveFile->diskInstance) .add("diskInstance", archiveFile->diskInstance)
.add("diskFileId", archiveFile->diskFileId) .add("diskFileId", archiveFile->diskFileId)
.add("diskFileInfo.path", archiveFile->diskFileInfo.path) .add("diskFileInfo.path", archiveFile->diskFileInfo.path)
.add("diskFileInfo.owner", archiveFile->diskFileInfo.owner) .add("diskFileInfo.owner_uid", archiveFile->diskFileInfo.owner_uid)
.add("diskFileInfo.group", archiveFile->diskFileInfo.group) .add("diskFileInfo.gid", archiveFile->diskFileInfo.gid)
.add("fileSize", std::to_string(archiveFile->fileSize)) .add("fileSize", std::to_string(archiveFile->fileSize))
.add("checksumType", archiveFile->checksumType) .add("checksumType", archiveFile->checksumType)
.add("checksumValue", archiveFile->checksumValue) .add("checksumValue", archiveFile->checksumValue)
......
...@@ -269,8 +269,7 @@ common::dataStructures::Tape OracleCatalogue::selectTapeForUpdate(rdbms::Conn &c ...@@ -269,8 +269,7 @@ common::dataStructures::Tape OracleCatalogue::selectTapeForUpdate(rdbms::Conn &c
tape.comment = rset.columnString("USER_COMMENT"); tape.comment = rset.columnString("USER_COMMENT");
common::dataStructures::UserIdentity creatorUI; //std::string creatorUIname = rset.columnString("CREATION_LOG_USER_NAME");
creatorUI.name = rset.columnString("CREATION_LOG_USER_NAME");
common::dataStructures::EntryLog creationLog; common::dataStructures::EntryLog creationLog;
creationLog.username = rset.columnString("CREATION_LOG_USER_NAME"); creationLog.username = rset.columnString("CREATION_LOG_USER_NAME");
...@@ -279,8 +278,7 @@ common::dataStructures::Tape OracleCatalogue::selectTapeForUpdate(rdbms::Conn &c ...@@ -279,8 +278,7 @@ common::dataStructures::Tape OracleCatalogue::selectTapeForUpdate(rdbms::Conn &c
tape.creationLog = creationLog; tape.creationLog = creationLog;
common::dataStructures::UserIdentity updaterUI; //std::string updaterUIname = rset.columnString("LAST_UPDATE_USER_NAME");
updaterUI.name = rset.columnString("LAST_UPDATE_USER_NAME");
common::dataStructures::EntryLog updateLog; common::dataStructures::EntryLog updateLog;
updateLog.username = rset.columnString("LAST_UPDATE_USER_NAME"); updateLog.username = rset.columnString("LAST_UPDATE_USER_NAME");
...@@ -537,8 +535,8 @@ void OracleCatalogue::idempotentBatchInsertArchiveFiles(rdbms::Conn &conn, const ...@@ -537,8 +535,8 @@ void OracleCatalogue::idempotentBatchInsertArchiveFiles(rdbms::Conn &conn, const
archiveFileBatch.diskInstance.setFieldLenToValueLen(i, event.diskInstance); archiveFileBatch.diskInstance.setFieldLenToValueLen(i, event.diskInstance);
archiveFileBatch.diskFileId.setFieldLenToValueLen(i, event.diskFileId); archiveFileBatch.diskFileId.setFieldLenToValueLen(i, event.diskFileId);
archiveFileBatch.diskFilePath.setFieldLenToValueLen(i, event.diskFilePath); archiveFileBatch.diskFilePath.setFieldLenToValueLen(i, event.diskFilePath);
archiveFileBatch.diskFileUser.setFieldLenToValueLen(i, event.diskFileUser); archiveFileBatch.diskFileUser.setFieldLenToValueLen(i, event.diskFileOwnerUid);
archiveFileBatch.diskFileGroup.setFieldLenToValueLen(i, event.diskFileGroup); archiveFileBatch.diskFileGroup.setFieldLenToValueLen(i, event.diskFileGid);
archiveFileBatch.size.setFieldLenToValueLen(i, event.size); archiveFileBatch.size.setFieldLenToValueLen(i, event.size);
archiveFileBatch.checksumType.setFieldLenToValueLen(i, event.checksumType); archiveFileBatch.checksumType.setFieldLenToValueLen(i, event.checksumType);
archiveFileBatch.checksumValue.setFieldLenToValueLen(i, event.checksumValue); archiveFileBatch.checksumValue.setFieldLenToValueLen(i, event.checksumValue);
...@@ -555,8 +553,8 @@ void OracleCatalogue::idempotentBatchInsertArchiveFiles(rdbms::Conn &conn, const ...@@ -555,8 +553,8 @@ void OracleCatalogue::idempotentBatchInsertArchiveFiles(rdbms::Conn &conn, const
archiveFileBatch.diskInstance.setFieldValue(i, event.diskInstance); archiveFileBatch.diskInstance.setFieldValue(i, event.diskInstance);
archiveFileBatch.diskFileId.setFieldValue(i, event.diskFileId); archiveFileBatch.diskFileId.setFieldValue(i, event.diskFileId);
archiveFileBatch.diskFilePath.setFieldValue(i, event.diskFilePath); archiveFileBatch.diskFilePath.setFieldValue(i, event.diskFilePath);
archiveFileBatch.diskFileUser.setFieldValue(i, event.diskFileUser); archiveFileBatch.diskFileUser.setFieldValue(i, event.diskFileOwnerUid);
archiveFileBatch.diskFileGroup.setFieldValue(i, event.diskFileGroup); archiveFileBatch.diskFileGroup.setFieldValue(i, event.diskFileGid);
archiveFileBatch.size.setFieldValue(i, event.size); archiveFileBatch.size.setFieldValue(i, event.size);
archiveFileBatch.checksumType.setFieldValue(i, event.checksumType); archiveFileBatch.checksumType.setFieldValue(i, event.checksumType);
archiveFileBatch.checksumValue.setFieldValue(i, event.checksumValue); archiveFileBatch.checksumValue.setFieldValue(i, event.checksumValue);
...@@ -825,8 +823,8 @@ void OracleCatalogue::deleteArchiveFile(const std::string &diskInstanceName, con ...@@ -825,8 +823,8 @@ void OracleCatalogue::deleteArchiveFile(const std::string &diskInstanceName, con
archiveFile->diskInstance = selectRset.columnString("DISK_INSTANCE_NAME"); archiveFile->diskInstance = selectRset.columnString("DISK_INSTANCE_NAME");
archiveFile->diskFileId = selectRset.columnString("DISK_FILE_ID"); archiveFile->diskFileId = selectRset.columnString("DISK_FILE_ID");
archiveFile->diskFileInfo.path = selectRset.columnString("DISK_FILE_PATH"); archiveFile->diskFileInfo.path = selectRset.columnString("DISK_FILE_PATH");
archiveFile->diskFileInfo.owner = selectRset.columnString("DISK_FILE_UID"); archiveFile->diskFileInfo.owner_uid = selectRset.columnUint64("DISK_FILE_UID");
archiveFile->diskFileInfo.group = selectRset.columnString("DISK_FILE_GID"); archiveFile->diskFileInfo.gid = selectRset.columnUint64("DISK_FILE_GID");
archiveFile->fileSize = selectRset.columnUint64("SIZE_IN_BYTES"); archiveFile->fileSize = selectRset.columnUint64("SIZE_IN_BYTES");
archiveFile->checksumType = selectRset.columnString("CHECKSUM_TYPE"); archiveFile->checksumType = selectRset.columnString("CHECKSUM_TYPE");
archiveFile->checksumValue = selectRset.columnString("CHECKSUM_VALUE"); archiveFile->checksumValue = selectRset.columnString("CHECKSUM_VALUE");
...@@ -870,8 +868,8 @@ void OracleCatalogue::deleteArchiveFile(const std::string &diskInstanceName, con ...@@ -870,8 +868,8 @@ void OracleCatalogue::deleteArchiveFile(const std::string &diskInstanceName, con
.add("requestDiskInstance", diskInstanceName) .add("requestDiskInstance", diskInstanceName)
.add("diskFileId", archiveFile->diskFileId) .add("diskFileId", archiveFile->diskFileId)
.add("diskFileInfo.path", archiveFile->diskFileInfo.path) .add("diskFileInfo.path", archiveFile->diskFileInfo.path)
.add("diskFileInfo.owner", archiveFile->diskFileInfo.owner) .add("diskFileInfo.owner_uid", archiveFile->diskFileInfo.owner_uid)
.add("diskFileInfo.group", archiveFile->diskFileInfo.group) .add("diskFileInfo.gid", archiveFile->diskFileInfo.gid)
.add("fileSize", std::to_string(archiveFile->fileSize)) .add("fileSize", std::to_string(archiveFile->fileSize))
.add("checksumType", archiveFile->checksumType) .add("checksumType", archiveFile->checksumType)
.add("checksumValue", archiveFile->checksumValue) .add("checksumValue", archiveFile->checksumValue)
...@@ -932,8 +930,8 @@ void OracleCatalogue::deleteArchiveFile(const std::string &diskInstanceName, con ...@@ -932,8 +930,8 @@ void OracleCatalogue::deleteArchiveFile(const std::string &diskInstanceName, con
.add("diskInstance", archiveFile->diskInstance) .add("diskInstance", archiveFile->diskInstance)
.add("diskFileId", archiveFile->diskFileId) .add("diskFileId", archiveFile->diskFileId)
.add("diskFileInfo.path", archiveFile->diskFileInfo.path) .add("diskFileInfo.path", archiveFile->diskFileInfo.path)
.add("diskFileInfo.owner", archiveFile->diskFileInfo.owner) .add("diskFileInfo.owner_uid", archiveFile->diskFileInfo.owner_uid)
.add("diskFileInfo.group", archiveFile->diskFileInfo.group) .add("diskFileInfo.gid", archiveFile->diskFileInfo.gid)
.add("fileSize", std::to_string(archiveFile->fileSize)) .add("fileSize", std::to_string(archiveFile->fileSize))
.add("checksumType", archiveFile->checksumType) .add("checksumType", archiveFile->checksumType)
.add("checksumValue", archiveFile->checksumValue) .add("checksumValue", archiveFile->checksumValue)
......
...@@ -260,8 +260,7 @@ common::dataStructures::Tape PostgresCatalogue::selectTapeForUpdate(rdbms::Conn ...@@ -260,8 +260,7 @@ common::dataStructures::Tape PostgresCatalogue::selectTapeForUpdate(rdbms::Conn
tape.comment = rset.columnString("USER_COMMENT"); tape.comment = rset.columnString("USER_COMMENT");
common::dataStructures::UserIdentity creatorUI; //std::string creatorUIname = rset.columnString("CREATION_LOG_USER_NAME");
creatorUI.name = rset.columnString("CREATION_LOG_USER_NAME");
common::dataStructures::EntryLog creationLog; common::dataStructures::EntryLog creationLog;
creationLog.username = rset.columnString("CREATION_LOG_USER_NAME"); creationLog.username = rset.columnString("CREATION_LOG_USER_NAME");
...@@ -270,8 +269,7 @@ common::dataStructures::Tape PostgresCatalogue::selectTapeForUpdate(rdbms::Conn ...@@ -270,8 +269,7 @@ common::dataStructures::Tape PostgresCatalogue::selectTapeForUpdate(rdbms::Conn
tape.creationLog = creationLog; tape.creationLog = creationLog;
common::dataStructures::UserIdentity updaterUI; //std::string updaterUIname = rset.columnString("LAST_UPDATE_USER_NAME");
updaterUI.name = rset.columnString("LAST_UPDATE_USER_NAME");
common::dataStructures::EntryLog updateLog; common::dataStructures::EntryLog updateLog;
updateLog.username = rset.columnString("LAST_UPDATE_USER_NAME"); updateLog.username = rset.columnString("LAST_UPDATE_USER_NAME");
...@@ -506,8 +504,8 @@ void PostgresCatalogue::idempotentBatchInsertArchiveFiles(rdbms::Conn &conn, ...@@ -506,8 +504,8 @@ void PostgresCatalogue::idempotentBatchInsertArchiveFiles(rdbms::Conn &conn,
archiveFileBatch.diskInstance.setFieldValue(i, event.diskInstance); archiveFileBatch.diskInstance.setFieldValue(i, event.diskInstance);
archiveFileBatch.diskFileId.setFieldValue(i, event.diskFileId); archiveFileBatch.diskFileId.setFieldValue(i, event.diskFileId);
archiveFileBatch.diskFilePath.setFieldValue(i, event.diskFilePath); archiveFileBatch.diskFilePath.setFieldValue(i, event.diskFilePath);
archiveFileBatch.diskFileUser.setFieldValue(i, event.diskFileUser); archiveFileBatch.diskFileUser.setFieldValue(i, event.diskFileOwnerUid);
archiveFileBatch.diskFileGroup.setFieldValue(i, event.diskFileGroup); archiveFileBatch.diskFileGroup.setFieldValue(i, event.diskFileGid);
archiveFileBatch.size.setFieldValue(i, event.size); archiveFileBatch.size.setFieldValue(i, event.size);
archiveFileBatch.checksumType.setFieldValue(i, event.checksumType); archiveFileBatch.checksumType.setFieldValue(i, event.checksumType);
archiveFileBatch.checksumValue.setFieldValue(i, event.checksumValue); archiveFileBatch.checksumValue.setFieldValue(i, event.checksumValue);
...@@ -756,8 +754,8 @@ void PostgresCatalogue::deleteArchiveFile(const std::string &diskInstanceName, c ...@@ -756,8 +754,8 @@ void PostgresCatalogue::deleteArchiveFile(const std::string &diskInstanceName, c
archiveFile->diskInstance = selectRset.columnString("DISK_INSTANCE_NAME"); archiveFile->diskInstance = selectRset.columnString("DISK_INSTANCE_NAME");
archiveFile->diskFileId = selectRset.columnString("DISK_FILE_ID"); archiveFile->diskFileId = selectRset.columnString("DISK_FILE_ID");
archiveFile->diskFileInfo.path = selectRset.columnString("DISK_FILE_PATH"); archiveFile->diskFileInfo.path = selectRset.columnString("DISK_FILE_PATH");
archiveFile->diskFileInfo.owner = selectRset.columnString("DISK_FILE_UID"); archiveFile->diskFileInfo.owner_uid = selectRset.columnUint64("DISK_FILE_UID");
archiveFile->diskFileInfo.group = selectRset.columnString("DISK_FILE_GID"); archiveFile->diskFileInfo.gid = selectRset.columnUint64("DISK_FILE_GID");
archiveFile->fileSize = selectRset.columnUint64("SIZE_IN_BYTES"); archiveFile->fileSize = selectRset.columnUint64("SIZE_IN_BYTES");
archiveFile->checksumType = selectRset.columnString("CHECKSUM_TYPE"); archiveFile->checksumType = selectRset.columnString("CHECKSUM_TYPE");
archiveFile->checksumValue = selectRset.columnString("CHECKSUM_VALUE"); archiveFile->checksumValue = selectRset.columnString("CHECKSUM_VALUE");
...@@ -801,8 +799,8 @@ void PostgresCatalogue::deleteArchiveFile(const std::string &diskInstanceName, c ...@@ -801,8 +799,8 @@ void PostgresCatalogue::deleteArchiveFile(const std::string &diskInstanceName, c
.add("requestDiskInstance", diskInstanceName) .add("requestDiskInstance", diskInstanceName)
.add("diskFileId", archiveFile->diskFileId) .add("diskFileId", archiveFile->diskFileId)
.add("diskFileInfo.path", archiveFile->diskFileInfo.path) .add("diskFileInfo.path", archiveFile->diskFileInfo.path)
.add("diskFileInfo.owner", archiveFile->diskFileInfo.owner) .add("diskFileInfo.owner_uid", archiveFile->diskFileInfo.owner_uid)
.add("diskFileInfo.group", archiveFile->diskFileInfo.group) .add("diskFileInfo.gid", archiveFile->diskFileInfo.gid)
.add("fileSize", std::to_string(archiveFile->fileSize)) .add("fileSize", std::to_string(archiveFile->fileSize))
.add("checksumType", archiveFile->checksumType) .add("checksumType", archiveFile->checksumType)
.add("checksumValue", archiveFile->checksumValue) .add("checksumValue", archiveFile->checksumValue)
...@@ -865,8 +863,8 @@ void PostgresCatalogue::deleteArchiveFile(const std::string &diskInstanceName, c ...@@ -865,8 +863,8 @@ void PostgresCatalogue::deleteArchiveFile(const std::string &diskInstanceName, c
.add("diskInstance", archiveFile->diskInstance) .add("diskInstance", archiveFile->diskInstance)
.add("diskFileId", archiveFile->diskFileId) .add("diskFileId", archiveFile->diskFileId)
.add("diskFileInfo.path", archiveFile->diskFileInfo.path) .add("diskFileInfo.path", archiveFile->diskFileInfo.path)
.add("diskFileInfo.owner", archiveFile->diskFileInfo.owner) .add("diskFileInfo.owner_uid", archiveFile->diskFileInfo.owner_uid)
.add("diskFileInfo.group", archiveFile->diskFileInfo.group) .add("diskFileInfo.gid", archiveFile->diskFileInfo.gid)
.add("fileSize", std::to_string(archiveFile->fileSize)) .add("fileSize", std::to_string(archiveFile->fileSize))
.add("checksumType", archiveFile->checksumType) .add("checksumType", archiveFile->checksumType)
.add("checksumValue", archiveFile->checksumValue) .add("checksumValue", archiveFile->checksumValue)
......
...@@ -774,7 +774,7 @@ bool RdbmsCatalogue::diskFilePathExists(rdbms::Conn &conn, const std::string &di ...@@ -774,7 +774,7 @@ bool RdbmsCatalogue::diskFilePathExists(rdbms::Conn &conn, const std::string &di
// diskFileUserExists // diskFileUserExists
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool RdbmsCatalogue::diskFileUserExists(rdbms::Conn &conn, const std::string &diskInstanceName, bool RdbmsCatalogue::diskFileUserExists(rdbms::Conn &conn, const std::string &diskInstanceName,
const std::string &diskFileUser) const { uint32_t diskFileOwnerUid) const {
try { try {
const char *const sql = const char *const sql =
"SELECT " "SELECT "
...@@ -787,7 +787,7 @@ bool RdbmsCatalogue::diskFileUserExists(rdbms::Conn &conn, const std::string &di ...@@ -787,7 +787,7 @@ bool RdbmsCatalogue::diskFileUserExists(rdbms::Conn &conn, const std::string &di
"DISK_FILE_UID = :DISK_FILE_UID"; "DISK_FILE_UID = :DISK_FILE_UID";
auto stmt = conn.createStmt(sql); auto stmt = conn.createStmt(sql);
stmt.bindString(":DISK_INSTANCE_NAME", diskInstanceName); stmt.bindString(":DISK_INSTANCE_NAME", diskInstanceName);
stmt.bindString(":DISK_FILE_UID", diskFileUser); stmt.bindUint64(":DISK_FILE_UID", diskFileOwnerUid);
auto rset = stmt.executeQuery(); auto rset = stmt.executeQuery();
return rset.next(); return rset.next();
} catch(exception::UserError &) { } catch(exception::UserError &) {
...@@ -802,7 +802,7 @@ bool RdbmsCatalogue::diskFileUserExists(rdbms::Conn &conn, const std::string &di ...@@ -802,7 +802,7 @@ bool RdbmsCatalogue::diskFileUserExists(rdbms::Conn &conn, const std::string &di
// diskFileGroupExists // diskFileGroupExists
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool RdbmsCatalogue::diskFileGroupExists(rdbms::Conn &conn, const std::string &diskInstanceName, bool RdbmsCatalogue::diskFileGroupExists(rdbms::Conn &conn, const std::string &diskInstanceName,
const std::string &diskFileGroup) const { uint32_t diskFileGid) const {
try { try {
const char *const sql = const char *const sql =
"SELECT " "SELECT "
...@@ -815,7 +815,7 @@ bool RdbmsCatalogue::diskFileGroupExists(rdbms::Conn &conn, const std::string &d ...@@ -815,7 +815,7 @@ bool RdbmsCatalogue::diskFileGroupExists(rdbms::Conn &conn, const std::string &d
"DISK_FILE_GID = :DISK_FILE_GID"; "DISK_FILE_GID = :DISK_FILE_GID";
auto stmt = conn.createStmt(sql); auto stmt = conn.createStmt(sql);
stmt.bindString(":DISK_INSTANCE_NAME", diskInstanceName); stmt.bindString(":DISK_INSTANCE_NAME", diskInstanceName);
stmt.bindString(":DISK_FILE_GID", diskFileGroup); stmt.bindUint64(":DISK_FILE_GID", diskFileGid);
auto rset = stmt.executeQuery(); auto rset = stmt.executeQuery();
return rset.next(); return rset.next();
} catch(exception::UserError &) { } catch(exception::UserError &) {
...@@ -4247,8 +4247,8 @@ void RdbmsCatalogue::insertArchiveFile(rdbms::Conn &conn, const ArchiveFileRow & ...@@ -4247,8 +4247,8 @@ void RdbmsCatalogue::insertArchiveFile(rdbms::Conn &conn, const ArchiveFileRow &
stmt.bindString(":DISK_INSTANCE_NAME", row.diskInstance); stmt.bindString(":DISK_INSTANCE_NAME", row.diskInstance);
stmt.bindString(":DISK_FILE_ID", row.diskFileId); stmt.bindString(":DISK_FILE_ID", row.diskFileId);
stmt.bindString(":DISK_FILE_PATH", row.diskFilePath); stmt.bindString(":DISK_FILE_PATH", row.diskFilePath);
stmt.bindString(":DISK_FILE_UID", row.diskFileUser); stmt.bindUint64(":DISK_FILE_UID", row.diskFileOwnerUid);
stmt.bindString(":DISK_FILE_GID", row.diskFileGroup); stmt.bindUint64(":DISK_FILE_GID", row.diskFileGid);
stmt.bindUint64(":SIZE_IN_BYTES", row.size); stmt.bindUint64(":SIZE_IN_BYTES", row.size);
stmt.bindString(":CHECKSUM_TYPE", row.checksumType); stmt.bindString(":CHECKSUM_TYPE", row.checksumType);
stmt.bindString(":CHECKSUM_VALUE", row.checksumValue); stmt.bindString(":CHECKSUM_VALUE", row.checksumValue);
...@@ -4279,15 +4279,15 @@ void RdbmsCatalogue::checkTapeFileSearchCriteria(const TapeFileSearchCriteria &s ...@@ -4279,15 +4279,15 @@ void RdbmsCatalogue::checkTapeFileSearchCriteria(const TapeFileSearchCriteria &s
} }
} }
if(searchCriteria.diskFileGroup && !searchCriteria.diskInstance) { if(searchCriteria.diskFileGid && !searchCriteria.diskInstance) {
throw exception::UserError(std::string("Disk file group ") + searchCriteria.diskFileGroup.value() + " is ambiguous " throw exception::UserError(std::string("Disk file group ") + std::to_string(searchCriteria.diskFileGid.value()) +
"without disk instance name"); " is ambiguous without disk instance name");
} }
if(searchCriteria.diskInstance && searchCriteria.diskFileGroup) { if(searchCriteria.diskInstance && searchCriteria.diskFileGid) {
if(!diskFileGroupExists(conn, searchCriteria.diskInstance.value(), searchCriteria.diskFileGroup.value())) { if(!diskFileGroupExists(conn, searchCriteria.diskInstance.value(), searchCriteria.diskFileGid.value())) {
throw exception::UserError(std::string("Disk file group ") + searchCriteria.diskInstance.value() + "::" + throw exception::UserError(std::string("Disk file group ") + searchCriteria.diskInstance.value() + "::" +
searchCriteria.diskFileGroup.value() + " does not exist"); std::to_string(searchCriteria.diskFileGid.value()) + " does not exist");
} }
} }
...@@ -4315,15 +4315,15 @@ void RdbmsCatalogue::checkTapeFileSearchCriteria(const TapeFileSearchCriteria &s ...@@ -4315,15 +4315,15 @@ void RdbmsCatalogue::checkTapeFileSearchCriteria(const TapeFileSearchCriteria &s
} }
} }
if(searchCriteria.diskFileUser && !searchCriteria.diskInstance) { if(searchCriteria.diskFileOwnerUid && !searchCriteria.diskInstance) {