Commit 7fa2ecdf authored by Steven Murray's avatar Steven Murray
Browse files

Added placeholder for the "TO BE USED" member "BridgeProtocolEngine::m_pendingTransferIds"

parent d3530081
......@@ -356,37 +356,40 @@ void castor::tape::aggregator::BridgeProtocolEngine::run()
void castor::tape::aggregator::BridgeProtocolEngine::runMigrationSession()
throw(castor::exception::Exception) {
char migrationFilePath[CA_MAXPATHLEN+1];
utils::setBytes(migrationFilePath, '\0');
char migrationFileNsHost[CA_MAXHOSTNAMELEN+1];
utils::setBytes(migrationFileNsHost, '\0');
uint64_t migrationFileId = 0;
int32_t migrationFileTapeFileSeq = 0;
uint64_t migrationFileSize = 0;
char migrationFileLastKnownFilename[CA_MAXPATHLEN+1];
utils::setBytes(migrationFileLastKnownFilename, '\0');
uint64_t migrationFileLastModificationTime = 0;
int32_t positionCommandCode = 0;
char tapePath[CA_MAXPATHLEN+1];
utils::setBytes(tapePath, '\0');
int32_t tapeFseq;
char filePath[CA_MAXPATHLEN+1];
char fileNsHost[CA_MAXHOSTNAMELEN+1];
char fileLastKnownFilename[CA_MAXPATHLEN+1];
char tapePath[CA_MAXPATHLEN+1];
unsigned char (blockId)[4];
utils::setBytes(blockId, '\0');
utils::setBytes(filePath , '\0');
utils::setBytes(fileNsHost , '\0');
utils::setBytes(fileLastKnownFilename, '\0');
utils::setBytes(tapePath , '\0');
utils::setBytes(blockId , '\0');
uint64_t fileId = 0;
int32_t fileTapeFileSeq = 0;
uint64_t fileSize = 0;
uint64_t fileLastModificationTime = 0;
int32_t positionCommandCode = 0;
// Get first file to migrate from tape gateway
const bool thereIsAFileToMigrate =
GatewayTxRx::getFileToMigrateFromGateway(m_cuuid, m_volReqId,
m_gatewayHost, m_gatewayPort, migrationFilePath, migrationFileNsHost,
migrationFileId, migrationFileTapeFileSeq, migrationFileSize,
migrationFileLastKnownFilename, migrationFileLastModificationTime,
positionCommandCode);
m_gatewayHost, m_gatewayPort, filePath, fileNsHost, fileId,
fileTapeFileSeq, fileSize, fileLastKnownFilename,
fileLastModificationTime, positionCommandCode);
// Return if there is no file to migrate
if(!thereIsAFileToMigrate) {
return;
}
tapeFseq=migrationFileTapeFileSeq;
// Remember the file transaction ID and get its unique index to be passed to
// RTCPD through the "rtcpFileRequest.disk_fseq" message field
// TO BE DONE!!!!!!
// Give volume to RTCPD
RtcpTapeRqstErrMsgBody rtcpVolume;
......@@ -407,11 +410,11 @@ void castor::tape::aggregator::BridgeProtocolEngine::runMigrationSession()
// Give file to migrate to RTCPD
char migrationTapeFileId[CA_MAXPATHLEN+1];
utils::toHex(migrationFileId, migrationTapeFileId);
utils::toHex(fileId, migrationTapeFileId);
RtcpTxRx::giveFileToRtcpd(m_cuuid, m_volReqId, m_rtcpdInitialSocketFd,
RTCPDNETRWTIMEOUT, rtcpVolume.mode, migrationFilePath, migrationFileSize,
"", RECORDFORMAT, migrationTapeFileId, MIGRATEUMASK, positionCommandCode,
tapeFseq, migrationFileNsHost, migrationFileId, blockId);
RTCPDNETRWTIMEOUT, rtcpVolume.mode, filePath, fileSize, "", RECORDFORMAT,
migrationTapeFileId, MIGRATEUMASK, positionCommandCode, fileTapeFileSeq,
fileNsHost, fileId, blockId);
// Ask RTCPD to request more work
RtcpTxRx::askRtcpdToRequestMoreWork(m_cuuid, m_volReqId, tapePath,
......
......@@ -26,10 +26,12 @@
#define CASTOR_TAPE_AGGREGATOR_BRIDGEPROTOCOLENGINE
#include "castor/exception/Exception.hpp"
#include "castor/tape/aggregator/Constants.hpp"
#include "castor/tape/aggregator/MessageHeader.hpp"
#include "castor/tape/aggregator/RtcpFileRqstMsgBody.hpp"
#include "castor/tape/aggregator/RtcpTapeRqstMsgBody.hpp"
#include "castor/tape/aggregator/SmartFdList.hpp"
#include "castor/tape/utils/IndexedContainer.hpp"
#include "h/Castor_limits.h"
#include "h/Cuuid.h"
......@@ -182,6 +184,12 @@ private:
*/
MsgBodyCallbackMap m_handlers;
/**
* Indexed container of the file transaction IDs of all the files currently
* being transfered either for recall or migration.
*/
utils::IndexedContainer<uint64_t, MAXPENDINGTRANSFERS> m_pendingTransferIds;
/**
* Accepts an RTCPD connection using the specified listener socket.
*/
......
......@@ -37,6 +37,7 @@ namespace aggregator {
const size_t HDRBUFSIZ = 3 * sizeof(uint32_t);
const int MAXDRIVES = 4;
const int MAXINITMIGFILES = 2;
const int MAXPENDINGTRANSFERS = 1024;
const uint32_t MIGRATEUMASK = 022;
const size_t MSGBUFSIZ = 1024;
const char *const AGGREGATORPROGRAMNAME = "aggregatord";
......
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