Commit 6cb7fb73 authored by Cedric Caffy's avatar Cedric Caffy
Browse files

[catalogue] Removed the column FILE_RECYCLE_LOG.LOGICAL_SIZE_IN_BYTES

parent 4c2ab2aa
......@@ -383,7 +383,6 @@ CREATE TABLE FILE_RECYCLE_LOG(
VID VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_VID_NN NOT NULL,
FSEQ BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_FSEQ_NN NOT NULL,
BLOCK_ID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_BID_NN NOT NULL,
LOGICAL_SIZE_IN_BYTES BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_LSIB_NN NOT NULL,
COPY_NB TINYINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_COPY_NB_NN NOT NULL,
TAPE_FILE_CREATION_TIME BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_TFCT_NN NOT NULL,
ARCHIVE_FILE_ID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_AFI_NN NOT NULL,
......
......@@ -415,7 +415,6 @@ CREATE TABLE FILE_RECYCLE_LOG(
VID VARCHAR2(100) CONSTRAINT FILE_RECYCLE_LOG_VID_NN NOT NULL,
FSEQ NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_FSEQ_NN NOT NULL,
BLOCK_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_BID_NN NOT NULL,
LOGICAL_SIZE_IN_BYTES NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_LSIB_NN NOT NULL,
COPY_NB NUMERIC(3, 0) CONSTRAINT FILE_RECYCLE_LOG_COPY_NB_NN NOT NULL,
TAPE_FILE_CREATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_TFCT_NN NOT NULL,
ARCHIVE_FILE_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_AFI_NN NOT NULL,
......
......@@ -397,7 +397,6 @@ CREATE TABLE FILE_RECYCLE_LOG(
VID VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_VID_NN NOT NULL,
FSEQ NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_FSEQ_NN NOT NULL,
BLOCK_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_BID_NN NOT NULL,
LOGICAL_SIZE_IN_BYTES NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_LSIB_NN NOT NULL,
COPY_NB NUMERIC(3, 0) CONSTRAINT FILE_RECYCLE_LOG_COPY_NB_NN NOT NULL,
TAPE_FILE_CREATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_TFCT_NN NOT NULL,
ARCHIVE_FILE_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_AFI_NN NOT NULL,
......
......@@ -369,7 +369,6 @@ CREATE TABLE FILE_RECYCLE_LOG(
VID VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_VID_NN NOT NULL,
FSEQ INTEGER CONSTRAINT FILE_RECYCLE_LOG_FSEQ_NN NOT NULL,
BLOCK_ID INTEGER CONSTRAINT FILE_RECYCLE_LOG_BID_NN NOT NULL,
LOGICAL_SIZE_IN_BYTES INTEGER CONSTRAINT FILE_RECYCLE_LOG_LSIB_NN NOT NULL,
COPY_NB INTEGER CONSTRAINT FILE_RECYCLE_LOG_COPY_NB_NN NOT NULL,
TAPE_FILE_CREATION_TIME INTEGER CONSTRAINT FILE_RECYCLE_LOG_TFCT_NN NOT NULL,
ARCHIVE_FILE_ID INTEGER CONSTRAINT FILE_RECYCLE_LOG_AFI_NN NOT NULL,
......
......@@ -7373,7 +7373,6 @@ namespace catalogue{
" VID VARCHAR2(100) CONSTRAINT FILE_RECYCLE_LOG_VID_NN NOT NULL,"
" FSEQ NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_FSEQ_NN NOT NULL,"
" BLOCK_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_BID_NN NOT NULL,"
" LOGICAL_SIZE_IN_BYTES NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_LSIB_NN NOT NULL,"
" COPY_NB NUMERIC(3, 0) CONSTRAINT FILE_RECYCLE_LOG_COPY_NB_NN NOT NULL,"
" TAPE_FILE_CREATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_TFCT_NN NOT NULL,"
" ARCHIVE_FILE_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_AFI_NN NOT NULL,"
......@@ -7794,7 +7793,6 @@ namespace catalogue{
" VID VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_VID_NN NOT NULL,"
" FSEQ BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_FSEQ_NN NOT NULL,"
" BLOCK_ID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_BID_NN NOT NULL,"
" LOGICAL_SIZE_IN_BYTES BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_LSIB_NN NOT NULL,"
" COPY_NB TINYINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_COPY_NB_NN NOT NULL,"
" TAPE_FILE_CREATION_TIME BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_TFCT_NN NOT NULL,"
" ARCHIVE_FILE_ID BIGINT UNSIGNED CONSTRAINT FILE_RECYCLE_LOG_AFI_NN NOT NULL,"
......@@ -8200,7 +8198,6 @@ namespace catalogue{
" VID VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_VID_NN NOT NULL,"
" FSEQ INTEGER CONSTRAINT FILE_RECYCLE_LOG_FSEQ_NN NOT NULL,"
" BLOCK_ID INTEGER CONSTRAINT FILE_RECYCLE_LOG_BID_NN NOT NULL,"
" LOGICAL_SIZE_IN_BYTES INTEGER CONSTRAINT FILE_RECYCLE_LOG_LSIB_NN NOT NULL,"
" COPY_NB INTEGER CONSTRAINT FILE_RECYCLE_LOG_COPY_NB_NN NOT NULL,"
" TAPE_FILE_CREATION_TIME INTEGER CONSTRAINT FILE_RECYCLE_LOG_TFCT_NN NOT NULL,"
" ARCHIVE_FILE_ID INTEGER CONSTRAINT FILE_RECYCLE_LOG_AFI_NN NOT NULL,"
......@@ -8632,7 +8629,6 @@ namespace catalogue{
" VID VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_VID_NN NOT NULL,"
" FSEQ NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_FSEQ_NN NOT NULL,"
" BLOCK_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_BID_NN NOT NULL,"
" LOGICAL_SIZE_IN_BYTES NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_LSIB_NN NOT NULL,"
" COPY_NB NUMERIC(3, 0) CONSTRAINT FILE_RECYCLE_LOG_COPY_NB_NN NOT NULL,"
" TAPE_FILE_CREATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_TFCT_NN NOT NULL,"
" ARCHIVE_FILE_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_AFI_NN NOT NULL,"
......
......@@ -15867,7 +15867,6 @@ TEST_P(cta_catalogue_CatalogueTest, moveFilesToRecycleLog) {
ASSERT_EQ(i,deletedArchiveFile.fSeq);
ASSERT_EQ(i * 100,deletedArchiveFile.blockId);
ASSERT_EQ(1, deletedArchiveFile.copyNb);
ASSERT_EQ(archiveFileSize,deletedArchiveFile.logicalSizeInBytes);
}
//Let's try the deletion of the files from the recycle-bin.
......@@ -16102,7 +16101,6 @@ TEST_P(cta_catalogue_CatalogueTest, filesArePutInTheFileRecycleLogInsteadOfBeing
ASSERT_EQ(fileRecycleLog.vid,tape1.vid);
ASSERT_EQ(fileRecycleLog.fSeq,fileWrittenPtr->fSeq);
ASSERT_EQ(fileRecycleLog.blockId,fileWrittenPtr->blockId);
ASSERT_EQ(fileRecycleLog.logicalSizeInBytes,fileWrittenPtr->size);
ASSERT_EQ(fileRecycleLog.copyNb,fileWrittenPtr->copyNb);
ASSERT_EQ(fileRecycleLog.archiveFileId,fileWrittenPtr->archiveFileId);
ASSERT_EQ(fileRecycleLog.diskInstanceName,fileWrittenPtr->diskInstance);
......
......@@ -30,7 +30,6 @@ namespace cta { namespace catalogue {
std::string vid;
uint64_t fSeq;
uint64_t blockId;
uint64_t logicalSizeInBytes;
uint8_t copyNb;
time_t tapeFileCreationTime;
uint64_t archiveFileId;
......
......@@ -771,7 +771,6 @@ std::list<cta::catalogue::InsertFileRecycleLog> OracleCatalogue::insertOldCopies
"TAPE_FILE.VID AS VID,"
"TAPE_FILE.FSEQ AS FSEQ,"
"TAPE_FILE.BLOCK_ID AS BLOCK_ID,"
"TAPE_FILE.LOGICAL_SIZE_IN_BYTES AS LOGICAL_SIZE_IN_BYTES,"
"TAPE_FILE.COPY_NB AS COPY_NB,"
"TAPE_FILE.CREATION_TIME AS TAPE_FILE_CREATION_TIME,"
"TAPE_FILE.ARCHIVE_FILE_ID AS ARCHIVE_FILE_ID "
......@@ -790,7 +789,6 @@ std::list<cta::catalogue::InsertFileRecycleLog> OracleCatalogue::insertOldCopies
fileRecycleLog.vid = rset.columnString("VID");
fileRecycleLog.fSeq = rset.columnUint64("FSEQ");
fileRecycleLog.blockId = rset.columnUint64("BLOCK_ID");
fileRecycleLog.logicalSizeInBytes = rset.columnUint64("LOGICAL_SIZE_IN_BYTES");
fileRecycleLog.copyNb = rset.columnUint8("COPY_NB");
fileRecycleLog.tapeFileCreationTime = rset.columnUint64("TAPE_FILE_CREATION_TIME");
fileRecycleLog.archiveFileId = rset.columnUint64("ARCHIVE_FILE_ID");
......
......@@ -680,7 +680,6 @@ std::list<cta::catalogue::InsertFileRecycleLog> PostgresCatalogue::insertOldCopi
"TAPE_FILE.VID AS VID,"
"TAPE_FILE.FSEQ AS FSEQ,"
"TAPE_FILE.BLOCK_ID AS BLOCK_ID,"
"TAPE_FILE.LOGICAL_SIZE_IN_BYTES AS LOGICAL_SIZE_IN_BYTES,"
"TAPE_FILE.COPY_NB AS COPY_NB,"
"TAPE_FILE.CREATION_TIME AS TAPE_FILE_CREATION_TIME,"
"TAPE_FILE.ARCHIVE_FILE_ID AS ARCHIVE_FILE_ID "
......@@ -699,7 +698,6 @@ std::list<cta::catalogue::InsertFileRecycleLog> PostgresCatalogue::insertOldCopi
fileRecycleLog.vid = rset.columnString("VID");
fileRecycleLog.fSeq = rset.columnUint64("FSEQ");
fileRecycleLog.blockId = rset.columnUint64("BLOCK_ID");
fileRecycleLog.logicalSizeInBytes = rset.columnUint64("LOGICAL_SIZE_IN_BYTES");
fileRecycleLog.copyNb = rset.columnUint8("COPY_NB");
fileRecycleLog.tapeFileCreationTime = rset.columnUint64("TAPE_FILE_CREATION_TIME");
fileRecycleLog.archiveFileId = rset.columnUint64("ARCHIVE_FILE_ID");
......
......@@ -8571,7 +8571,6 @@ void RdbmsCatalogue::copyArchiveFileToFileRecycleLog(rdbms::Conn & conn, const c
fileRecycleLog.vid = tapeFile.vid;
fileRecycleLog.fSeq = tapeFile.fSeq;
fileRecycleLog.blockId = tapeFile.blockId;
fileRecycleLog.logicalSizeInBytes = tapeFile.fileSize;
fileRecycleLog.copyNb = tapeFile.copyNb;
fileRecycleLog.tapeFileCreationTime = tapeFile.creationTime;
fileRecycleLog.archiveFileId = archiveFile.archiveFileID;
......@@ -8599,7 +8598,6 @@ void RdbmsCatalogue::insertFileInFileRecycleLog(rdbms::Conn& conn, const InsertF
"VID,"
"FSEQ,"
"BLOCK_ID,"
"LOGICAL_SIZE_IN_BYTES,"
"COPY_NB,"
"TAPE_FILE_CREATION_TIME,"
"ARCHIVE_FILE_ID,"
......@@ -8623,7 +8621,6 @@ void RdbmsCatalogue::insertFileInFileRecycleLog(rdbms::Conn& conn, const InsertF
":VID,"
":FSEQ,"
":BLOCK_ID,"
":LOGICAL_SIZE_IN_BYTES,"
":COPY_NB,"
":TAPE_FILE_CREATION_TIME,"
":ARCHIVE_FILE_ID,"
......@@ -8651,7 +8648,6 @@ void RdbmsCatalogue::insertFileInFileRecycleLog(rdbms::Conn& conn, const InsertF
stmt.bindString(":VID",fileRecycleLog.vid);
stmt.bindUint64(":FSEQ",fileRecycleLog.fSeq);
stmt.bindUint64(":BLOCK_ID",fileRecycleLog.blockId);
stmt.bindUint64(":LOGICAL_SIZE_IN_BYTES",fileRecycleLog.logicalSizeInBytes);
stmt.bindUint8(":COPY_NB",fileRecycleLog.copyNb);
stmt.bindUint64(":TAPE_FILE_CREATION_TIME",fileRecycleLog.tapeFileCreationTime);
stmt.bindString(":DISK_FILE_PATH",fileRecycleLog.diskFilePath);
......@@ -8777,7 +8773,6 @@ std::list<InsertFileRecycleLog> RdbmsCatalogue::insertOldCopiesOfFilesIfAnyOnFil
"TAPE_FILE.VID AS VID,"
"TAPE_FILE.FSEQ AS FSEQ,"
"TAPE_FILE.BLOCK_ID AS BLOCK_ID,"
"TAPE_FILE.LOGICAL_SIZE_IN_BYTES AS LOGICAL_SIZE_IN_BYTES,"
"TAPE_FILE.COPY_NB AS COPY_NB,"
"TAPE_FILE.CREATION_TIME AS TAPE_FILE_CREATION_TIME,"
"TAPE_FILE.ARCHIVE_FILE_ID AS ARCHIVE_FILE_ID "
......@@ -8798,7 +8793,6 @@ std::list<InsertFileRecycleLog> RdbmsCatalogue::insertOldCopiesOfFilesIfAnyOnFil
fileRecycleLog.vid = rset.columnString("VID");
fileRecycleLog.fSeq = rset.columnUint64("FSEQ");
fileRecycleLog.blockId = rset.columnUint64("BLOCK_ID");
fileRecycleLog.logicalSizeInBytes = rset.columnUint64("LOGICAL_SIZE_IN_BYTES");
fileRecycleLog.copyNb = rset.columnUint8("COPY_NB");
fileRecycleLog.tapeFileCreationTime = rset.columnUint64("TAPE_FILE_CREATION_TIME");
fileRecycleLog.archiveFileId = rset.columnUint64("ARCHIVE_FILE_ID");
......
......@@ -41,7 +41,6 @@ RdbmsCatalogueGetFileRecycleLogItor::RdbmsCatalogueGetFileRecycleLogItor(
"FILE_RECYCLE_LOG.VID AS VID,"
"FILE_RECYCLE_LOG.FSEQ AS FSEQ,"
"FILE_RECYCLE_LOG.BLOCK_ID AS BLOCK_ID,"
"FILE_RECYCLE_LOG.LOGICAL_SIZE_IN_BYTES AS LOGICAL_SIZE_IN_BYTES,"
"FILE_RECYCLE_LOG.COPY_NB AS COPY_NB,"
"FILE_RECYCLE_LOG.TAPE_FILE_CREATION_TIME AS TAPE_FILE_CREATION_TIME,"
"FILE_RECYCLE_LOG.ARCHIVE_FILE_ID AS ARCHIVE_FILE_ID,"
......@@ -174,7 +173,6 @@ common::dataStructures::FileRecycleLog RdbmsCatalogueGetFileRecycleLogItor::popu
fileRecycleLog.vid = m_rset.columnString("VID");
fileRecycleLog.fSeq = m_rset.columnUint64("FSEQ");
fileRecycleLog.blockId = m_rset.columnUint64("BLOCK_ID");
fileRecycleLog.logicalSizeInBytes = m_rset.columnUint64("LOGICAL_SIZE_IN_BYTES");
fileRecycleLog.copyNb = m_rset.columnUint8("COPY_NB");
fileRecycleLog.tapeFileCreationTime = m_rset.columnUint64("TAPE_FILE_CREATION_TIME");
fileRecycleLog.archiveFileId = m_rset.columnUint64("ARCHIVE_FILE_ID");
......
......@@ -348,7 +348,6 @@ CREATE TABLE FILE_RECYCLE_LOG(
VID VARCHAR(100) CONSTRAINT FILE_RECYCLE_LOG_VID_NN NOT NULL,
FSEQ UINT64TYPE CONSTRAINT FILE_RECYCLE_LOG_FSEQ_NN NOT NULL,
BLOCK_ID UINT64TYPE CONSTRAINT FILE_RECYCLE_LOG_BID_NN NOT NULL,
LOGICAL_SIZE_IN_BYTES UINT64TYPE CONSTRAINT FILE_RECYCLE_LOG_LSIB_NN NOT NULL,
COPY_NB UINT8TYPE CONSTRAINT FILE_RECYCLE_LOG_COPY_NB_NN NOT NULL,
TAPE_FILE_CREATION_TIME UINT64TYPE CONSTRAINT FILE_RECYCLE_LOG_TFCT_NN NOT NULL,
ARCHIVE_FILE_ID UINT64TYPE CONSTRAINT FILE_RECYCLE_LOG_AFI_NN NOT NULL,
......
......@@ -31,7 +31,6 @@ CREATE TABLE FILE_RECYCLE_LOG(
VID VARCHAR2(100) CONSTRAINT FILE_RECYCLE_LOG_VID_NN NOT NULL,
FSEQ NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_FSEQ_NN NOT NULL,
BLOCK_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_BID_NN NOT NULL,
LOGICAL_SIZE_IN_BYTES NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_LSIB_NN NOT NULL,
COPY_NB NUMERIC(3, 0) CONSTRAINT FILE_RECYCLE_LOG_COPY_NB_NN NOT NULL,
TAPE_FILE_CREATION_TIME NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_TFCT_NN NOT NULL,
ARCHIVE_FILE_ID NUMERIC(20, 0) CONSTRAINT FILE_RECYCLE_LOG_AFI_NN NOT NULL,
......@@ -69,8 +68,6 @@ INSERT INTO FILE_RECYCLE_LOG (
FILE_RECYCLE_LOG_ID,
VID,
FSEQ,
BLOCK_ID,
LOGICAL_SIZE_IN_BYTES,
COPY_NB,
TAPE_FILE_CREATION_TIME,
ARCHIVE_FILE_ID,
......@@ -93,7 +90,6 @@ INSERT INTO FILE_RECYCLE_LOG (
TAPE_FILE.VID,
TAPE_FILE.FSEQ,
TAPE_FILE.BLOCK_ID,
TAPE_FILE.LOGICAL_SIZE_IN_BYTES,
TAPE_FILE.COPY_NB,
TAPE_FILE.CREATION_TIME,
TAPE_FILE.ARCHIVE_FILE_ID,
......@@ -129,7 +125,6 @@ INSERT INTO FILE_RECYCLE_LOG (
VID,
FSEQ,
BLOCK_ID,
LOGICAL_SIZE_IN_BYTES,
COPY_NB,
TAPE_FILE_CREATION_TIME,
ARCHIVE_FILE_ID,
......@@ -153,7 +148,6 @@ INSERT INTO FILE_RECYCLE_LOG (
TAPE_FILE_RECYCLE_BIN.VID,
TAPE_FILE_RECYCLE_BIN.FSEQ,
TAPE_FILE_RECYCLE_BIN.BLOCK_ID,
TAPE_FILE_RECYCLE_BIN.LOGICAL_SIZE_IN_BYTES,
TAPE_FILE_RECYCLE_BIN.COPY_NB,
TAPE_FILE_RECYCLE_BIN.CREATION_TIME,
TAPE_FILE_RECYCLE_BIN.ARCHIVE_FILE_ID,
......
......@@ -30,7 +30,12 @@ struct FileRecycleLog {
std::string vid;
uint64_t fSeq;
uint64_t blockId;
uint64_t logicalSizeInBytes;
/**
* The TAPE_FILE.LOGICAL_SIZE_IN_BYTES column contains the same information as the ARCHIVE_FILE.
* https://gitlab.cern.ch/cta/CTA/-/issues/412
* Therefore, we don't have to save it in the FileRecycleLog
*/
/*uint64_t logicalSizeInBytes;*/
uint8_t copyNb;
time_t tapeFileCreationTime;
uint64_t archiveFileId;
......
......@@ -95,7 +95,6 @@ int RecycleTapeFileLsStream::fillBuffer(XrdSsiPb::OStreamBuffer<Data> *streambuf
recycleLogToReturn->set_vid(fileRecycleLog.vid);
recycleLogToReturn->set_fseq(fileRecycleLog.fSeq);
recycleLogToReturn->set_block_id(fileRecycleLog.blockId);
recycleLogToReturn->set_logical_size_in_bytes(fileRecycleLog.logicalSizeInBytes);
recycleLogToReturn->set_copy_nb(fileRecycleLog.copyNb);
recycleLogToReturn->set_tape_file_creation_time(fileRecycleLog.tapeFileCreationTime);
recycleLogToReturn->set_archive_file_id(fileRecycleLog.archiveFileId);
......
Markdown is supported
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