Commit d5189b90 authored by Steven Murray's avatar Steven Murray
Browse files

Fixed bug where tapeFileId was mixed with tapePath

parent 9a7deaa7
/* This file was generated by ./AggregatorDlfMessagesCodeGenerator on Thu Feb 19 22:20:00 CET 2009
/* This file was generated by ./AggregatorDlfMessagesCodeGenerator on Fri Feb 20 11:23:11 CET 2009
*/
/******************************************************************************
......
/* This file was generated by ./AggregatorDlfMessagesCodeGenerator on Thu Feb 19 22:20:00 CET 2009
/* This file was generated by ./AggregatorDlfMessagesCodeGenerator on Fri Feb 20 11:23:11 CET 2009
*/
/******************************************************************************
......
......@@ -41,6 +41,7 @@ const int MAXINITMIGFILES = 2;
const uint32_t MIGRATEUMASK = 022;
const size_t MSGBUFSIZ = 1024;
const uint32_t RECALLUMASK = 077;
const char RECORDFORMAT[2] = "F";
const int RTCPDNETRWTIMEOUT = 5;
const int RTCPDCALLBACKTIMEOUT = 5;
const int RTCPDPINGTIMEOUT = 10;
......
......@@ -45,9 +45,8 @@
// getVolumeFromGateway
//-----------------------------------------------------------------------------
bool castor::tape::aggregator::GatewayTxRx::getVolumeFromGateway(
const char (&gatewayHost)[CA_MAXHOSTNAMELEN+1],
const unsigned short gatewayPort, const uint32_t volReqId,
char (&vid)[CA_MAXVIDLEN+1], uint32_t &mode,
const char *gatewayHost, const unsigned short gatewayPort,
const uint32_t volReqId, char (&vid)[CA_MAXVIDLEN+1], uint32_t &mode,
char (&label)[CA_MAXLBLTYPLEN+1], char (&density)[CA_MAXDENLEN+1])
throw(castor::exception::Exception) {
......@@ -208,12 +207,11 @@ bool castor::tape::aggregator::GatewayTxRx::getVolumeFromGateway(
// getFileToMigrateFromGateway
//-----------------------------------------------------------------------------
bool castor::tape::aggregator::GatewayTxRx::getFileToMigrateFromGateway(
const char (&gatewayHost)[CA_MAXHOSTNAMELEN+1],
const unsigned short gatewayPort, const uint32_t transactionId,
char (&filePath)[CA_MAXPATHLEN+1], char (&nsHost)[CA_MAXHOSTNAMELEN+1],
uint64_t &fileId, uint32_t &tapeFileSeq, uint64_t &fileSize,
char (&lastKnownFileName)[CA_MAXPATHLEN+1], uint64_t &lastModificationTime)
throw(castor::exception::Exception) {
const char *gatewayHost, const unsigned short gatewayPort,
const uint32_t transactionId, char (&filePath)[CA_MAXPATHLEN+1],
char (&nsHost)[CA_MAXHOSTNAMELEN+1], uint64_t &fileId, uint32_t &tapeFileSeq,
uint64_t &fileSize, char (&lastKnownFileName)[CA_MAXPATHLEN+1],
uint64_t &lastModificationTime) throw(castor::exception::Exception) {
bool thereIsAFileToMigrate = false;
......@@ -375,10 +373,9 @@ bool castor::tape::aggregator::GatewayTxRx::getFileToMigrateFromGateway(
// getFileToRecallFromGateway
//-----------------------------------------------------------------------------
bool castor::tape::aggregator::GatewayTxRx::getFileToRecallFromGateway(
const char (&gatewayHost)[CA_MAXHOSTNAMELEN+1],
const unsigned short gatewayPort, const uint32_t transactionId,
char (&filePath)[CA_MAXPATHLEN+1], char (&nsHost)[CA_MAXHOSTNAMELEN+1],
uint64_t &fileId, uint32_t &tapeFileSeq)
const char *gatewayHost, const unsigned short gatewayPort,
const uint32_t transactionId, char (&filePath)[CA_MAXPATHLEN+1],
char (&nsHost)[CA_MAXHOSTNAMELEN+1], uint64_t &fileId, uint32_t &tapeFileSeq)
throw(castor::exception::Exception) {
bool thereIsAFileToRecall = false;
......@@ -538,9 +535,8 @@ bool castor::tape::aggregator::GatewayTxRx::getFileToRecallFromGateway(
// notifyGatewayOfFileMigrated
//-----------------------------------------------------------------------------
void castor::tape::aggregator::GatewayTxRx::notifyGatewayOfFileMigrated(
const char (&gatewayHost)[CA_MAXHOSTNAMELEN+1],
const unsigned short gatewayPort, const uint32_t transactionId)
throw(castor::exception::Exception) {
const char *gatewayHost, const unsigned short gatewayPort,
const uint32_t transactionId) throw(castor::exception::Exception) {
}
......@@ -548,9 +544,8 @@ void castor::tape::aggregator::GatewayTxRx::notifyGatewayOfFileMigrated(
// notifyGatewayOfFileRecalled
//-----------------------------------------------------------------------------
void castor::tape::aggregator::GatewayTxRx::notifyGatewayOfFileRecalled(
const char (&gatewayHost)[CA_MAXHOSTNAMELEN+1],
const unsigned short gatewayPort, const uint32_t transactionId)
throw(castor::exception::Exception) {
const char *gatewayHost, const unsigned short gatewayPort,
const uint32_t transactionId) throw(castor::exception::Exception) {
}
......@@ -558,9 +553,8 @@ void castor::tape::aggregator::GatewayTxRx::notifyGatewayOfFileRecalled(
// notifyGatewayOfEnd
//-----------------------------------------------------------------------------
void castor::tape::aggregator::GatewayTxRx::notifyGatewayOfEnd(
const char (&gatewayHost)[CA_MAXHOSTNAMELEN+1],
const unsigned short gatewayPort, const uint32_t transactionId)
throw(castor::exception::Exception) {
const char *gatewayHost, const unsigned short gatewayPort,
const uint32_t transactionId) throw(castor::exception::Exception) {
// Prepare the request
tapegateway::EndNotification request;
......
......@@ -56,9 +56,8 @@ public:
* @return True if there is a volume to mount.
*/
static bool getVolumeFromGateway(
const char (&gatewayHost)[CA_MAXHOSTNAMELEN+1],
const unsigned short gatewayPort, const uint32_t volReqId,
char (&vid)[CA_MAXVIDLEN+1], uint32_t &mode,
const char *gatewayHost, const unsigned short gatewayPort,
const uint32_t volReqId, char (&vid)[CA_MAXVIDLEN+1], uint32_t &mode,
char (&label)[CA_MAXLBLTYPLEN+1], char (&density)[CA_MAXDENLEN+1])
throw(castor::exception::Exception);
......@@ -80,10 +79,10 @@ public:
* @return True if there is a file to migrate.
*/
static bool getFileToMigrateFromGateway(
const char (&gatewayHost)[CA_MAXHOSTNAMELEN+1],
const unsigned short gatewayPort, const uint32_t transactionId,
char (&filePath)[CA_MAXPATHLEN+1], char (&nsHost)[CA_MAXHOSTNAMELEN+1],
uint64_t &fileId, uint32_t &tapeFileSeq, uint64_t &fileSize,
const char *gatewayHost, const unsigned short gatewayPort,
const uint32_t transactionId, char (&filePath)[CA_MAXPATHLEN+1],
char (&nsHost)[CA_MAXHOSTNAMELEN+1], uint64_t &fileId,
uint32_t &tapeFileSeq, uint64_t &fileSize,
char (&lastKnownFileName)[CA_MAXPATHLEN+1], uint64_t &lastModificationTime)
throw(castor::exception::Exception);
......@@ -100,11 +99,10 @@ public:
* @return True if there is a file to recall.
*/
static bool getFileToRecallFromGateway(
const char (&gatewayHost)[CA_MAXHOSTNAMELEN+1],
const unsigned short gatewayPort, const uint32_t transactionId,
char (&filePath)[CA_MAXPATHLEN+1], char (&nsHost)[CA_MAXHOSTNAMELEN+1],
uint64_t &fileId, uint32_t &tapeFileSeq)
throw(castor::exception::Exception);
const char *gatewayHost, const unsigned short gatewayPort,
const uint32_t transactionId, char (&filePath)[CA_MAXPATHLEN+1],
char (&nsHost)[CA_MAXHOSTNAMELEN+1], uint64_t &fileId,
uint32_t &tapeFileSeq) throw(castor::exception::Exception);
/**
* Notifies the tape gateway of the successful migration of a file to tape.
......@@ -114,9 +112,8 @@ public:
* @param transactionId The transaction ID to be sent to the tape gateway.
*/
static void notifyGatewayOfFileMigrated(
const char (&gatewayHost)[CA_MAXHOSTNAMELEN+1],
const unsigned short gatewayPort, const uint32_t transactionId)
throw(castor::exception::Exception);
const char *gatewayHost, const unsigned short gatewayPort,
const uint32_t transactionId) throw(castor::exception::Exception);
/**
* Notifies the tape gateway of the successful recall of a file from tape.
......@@ -125,8 +122,7 @@ public:
* @param gatewayPort The tape gateway port number.
* @param transactionId The transaction ID to be sent to the tape gateway.
*/
static void notifyGatewayOfFileRecalled(
const char (&gatewayHost)[CA_MAXHOSTNAMELEN+1],
static void notifyGatewayOfFileRecalled(const char *gatewayHost,
const unsigned short gatewayPort, const uint32_t transactionId)
throw(castor::exception::Exception);
......@@ -138,8 +134,7 @@ public:
* @param gatewayPort The tape gateway port number.
* @param transactionId The transaction ID to be sent to the tape gateway.
*/
static void notifyGatewayOfEnd(
const char (&gatewayHost)[CA_MAXHOSTNAMELEN+1],
static void notifyGatewayOfEnd(const char *gatewayHost,
const unsigned short gatewayPort, const uint32_t transactionId)
throw(castor::exception::Exception);
......
......@@ -539,16 +539,15 @@ void castor::tape::aggregator::RtcpTxRx::receiveRcpJobRqst(
//-----------------------------------------------------------------------------
// giveRequestForMoreWorkToRtcpd
// offerMoreWorkToRtcpd
//-----------------------------------------------------------------------------
void castor::tape::aggregator::RtcpTxRx::giveRequestForMoreWorkToRtcpd(
void castor::tape::aggregator::RtcpTxRx::offerMoreWorkToRtcpd(
const int socketFd, const int netReadWriteTimeout, const uint32_t volReqId)
throw(castor::exception::Exception) {
RtcpFileRqstErrMsgBody request;
Utils::setBytes(request, '\0');
Utils::copyString(request.recfm, "F");
request.volReqId = volReqId;
request.jobId = -1;
......@@ -580,8 +579,9 @@ void castor::tape::aggregator::RtcpTxRx::giveRequestForMoreWorkToRtcpd(
//-----------------------------------------------------------------------------
void castor::tape::aggregator::RtcpTxRx::giveFileToRtcpd(
const int socketFd, const int netReadWriteTimeout, const uint32_t volReqId,
const char *const filePath, const char *const tapePath, const uint32_t umask)
throw(castor::exception::Exception) {
const char *const filePath, const char *const tapePath,
const char *const recordFormat, const char *const tapeFileId,
const uint32_t umask) throw(castor::exception::Exception) {
RtcpFileRqstErrMsgBody request;
......@@ -590,7 +590,8 @@ void castor::tape::aggregator::RtcpTxRx::giveFileToRtcpd(
Utils::setBytes(request, '\0');
Utils::copyString(request.filePath, filePath);
Utils::copyString(request.tapePath, tapePath);
Utils::copyString(request.recfm, "F");
Utils::copyString(request.recfm, recordFormat);
Utils::copyString(request.fid, tapeFileId);
request.volReqId = volReqId;
request.jobId = -1;
......
......@@ -115,14 +115,13 @@ public:
throw(castor::exception::Exception);
/**
* Gives a request for more work to RTCPD by sending and receiving the
* necessary messages.
* Offers RTCPD more work by sending and receiving the necessary messages.
*
* A request for more work is infact a file list with one special file
* request which does not contain any file information, but instead contains
* a flag indicating a request for more work.
*/
static void giveRequestForMoreWorkToRtcpd(const int socketFd,
static void offerMoreWorkToRtcpd(const int socketFd,
const int netReadWriteTimeout, const uint32_t volReqId)
throw(castor::exception::Exception);
......@@ -134,6 +133,8 @@ public:
* @param netReadWriteTimeout The timeout to be applied when performing
* @param filePath The file path.
* @param tapePath The tape path.
* @param recordFormat The record format.
* @param tapeFileId The tape file ID.
* @param umask The umask of the file.
* @param requestMoreWork Set to true if RTCPD should be told that there is
* a possibility of more work in the future.
......@@ -142,8 +143,8 @@ public:
static void giveFileToRtcpd(const int socketFd,
const int netReadWriteTimeout, const uint32_t volReqId,
const char *const filePath, const char *const tapePath,
const uint32_t umask)
throw(castor::exception::Exception);
const char *const recordFormat, const char *const tapeFileId,
const uint32_t umask) throw(castor::exception::Exception);
/**
* Receives a message header.
......
......@@ -133,12 +133,12 @@ bool castor::tape::aggregator::TapeDiskRqstHandler::rtcpFileReqHandler(
castor::dlf::dlf_writep(cuuid, DLF_LVL_SYSTEM,
AGGREGATOR_FILE_TO_MIGRATE, params);
char tapePath[CA_MAXPATHLEN+1];
Utils::toHex(fileId, tapePath);
RtcpTxRx::giveFileToRtcpd(socketFd, RTCPDNETRWTIMEOUT,
volReqId, filePath, tapePath, MIGRATEUMASK);
char tapeFileId[CA_MAXPATHLEN+1];
Utils::toHex(fileId, tapeFileId);
RtcpTxRx::giveFileToRtcpd(socketFd, RTCPDNETRWTIMEOUT, volReqId,
filePath, "", RECORDFORMAT, tapeFileId, MIGRATEUMASK);
RtcpTxRx::giveRequestForMoreWorkToRtcpd(socketFd, RTCPDNETRWTIMEOUT,
RtcpTxRx::offerMoreWorkToRtcpd(socketFd, RTCPDNETRWTIMEOUT,
volReqId);
RtcpTxRx::tellRtcpdEndOfFileList(socketFd, RTCPDNETRWTIMEOUT);
......
......@@ -457,15 +457,14 @@ void castor::tape::aggregator::VdqmRequestHandlerThread::coordinateRemoteCopy(
rtcpVolume.density)) {
castor::dlf::Param params[] = {
castor::dlf::Param("volReqId" , volReqId ),
castor::dlf::Param("gatewayHost", gatewayHost ),
castor::dlf::Param("gatewayPort", gatewayPort ),
castor::dlf::Param("vid" , rtcpVolume.vid ),
castor::dlf::Param("mode" , rtcpVolume.mode ),
castor::dlf::Param("label" , rtcpVolume.label),
castor::dlf::Param("volReqId" , volReqId ),
castor::dlf::Param("gatewayHost", gatewayHost ),
castor::dlf::Param("gatewayPort", gatewayPort ),
castor::dlf::Param("vid" , rtcpVolume.vid ),
castor::dlf::Param("mode" , rtcpVolume.mode ),
castor::dlf::Param("label" , rtcpVolume.label ),
castor::dlf::Param("density" , rtcpVolume.density)};
castor::dlf::dlf_writep(cuuid, DLF_LVL_SYSTEM,
AGGREGATOR_VOLUME, params);
castor::dlf::dlf_writep(cuuid, DLF_LVL_SYSTEM, AGGREGATOR_VOLUME, params);
// Else there is no volume
} else {
......@@ -474,8 +473,8 @@ void castor::tape::aggregator::VdqmRequestHandlerThread::coordinateRemoteCopy(
castor::dlf::Param("volReqId" , volReqId ),
castor::dlf::Param("gatewayHost", gatewayHost),
castor::dlf::Param("gatewayPort", gatewayPort)};
castor::dlf::dlf_writep(cuuid, DLF_LVL_SYSTEM,
AGGREGATOR_NO_VOLUME, params);
castor::dlf::dlf_writep(cuuid, DLF_LVL_SYSTEM, AGGREGATOR_NO_VOLUME,
params);
return;
}
......@@ -529,25 +528,27 @@ void castor::tape::aggregator::VdqmRequestHandlerThread::coordinateRemoteCopy(
RtcpTxRx::giveVolumeToRtcpd(rtcpdInitialSocketFd.get(), RTCPDNETRWTIMEOUT,
rtcpVolume);
char tapePath[CA_MAXPATHLEN+1];
Utils::toHex(fileId, tapePath);
RtcpTxRx::giveFileToRtcpd(rtcpdInitialSocketFd.get(), RTCPDNETRWTIMEOUT,
volReqId, filePath, tapePath, MIGRATEUMASK);
char tapeFileId[CA_MAXPATHLEN+1];
Utils::toHex(fileId, tapeFileId);
RtcpTxRx::giveFileToRtcpd(rtcpdInitialSocketFd.get(), RTCPDNETRWTIMEOUT,
volReqId, filePath, "", RECORDFORMAT, tapeFileId, MIGRATEUMASK);
RtcpTxRx::giveRequestForMoreWorkToRtcpd(rtcpdInitialSocketFd.get(),
RtcpTxRx::offerMoreWorkToRtcpd(rtcpdInitialSocketFd.get(),
RTCPDNETRWTIMEOUT, volReqId);
RtcpTxRx::tellRtcpdEndOfFileList(rtcpdInitialSocketFd.get(), RTCPDNETRWTIMEOUT);
RtcpTxRx::tellRtcpdEndOfFileList(rtcpdInitialSocketFd.get(),
RTCPDNETRWTIMEOUT);
// Else recalling
} else {
RtcpTxRx::giveVolumeToRtcpd(rtcpdInitialSocketFd.get(), RTCPDNETRWTIMEOUT,
rtcpVolume);
RtcpTxRx::giveRequestForMoreWorkToRtcpd(rtcpdInitialSocketFd.get(),
RtcpTxRx::offerMoreWorkToRtcpd(rtcpdInitialSocketFd.get(),
RTCPDNETRWTIMEOUT, volReqId);
RtcpTxRx::tellRtcpdEndOfFileList(rtcpdInitialSocketFd.get(), RTCPDNETRWTIMEOUT);
RtcpTxRx::tellRtcpdEndOfFileList(rtcpdInitialSocketFd.get(),
RTCPDNETRWTIMEOUT);
}
processRtcpdSockets(cuuid, volReqId, gatewayHost, gatewayPort,
......
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