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

Data-transfer heartbeat is now passed through to CatalogueTransferSession

parent 6e39b2e0
......@@ -409,3 +409,12 @@ bool castor::tape::tapeserver::daemon::CatalogueTransferSession::
tapeIsBeingMounted() const throw() {
return TRANSFERSTATE_WAIT_MOUNTED == m_state;
}
//-----------------------------------------------------------------------------
// receivedHeartbeat
//-----------------------------------------------------------------------------
void castor::tape::tapeserver::daemon::CatalogueTransferSession::
receivedHeartbeat(const uint64_t nbBlocksMoved) {
log::Param params[] = {log::Param("nbBlocksMoved", nbBlocksMoved)};
m_log(LOG_DEBUG, "CatalogueTransferSession received heartbeat", params);
}
......@@ -98,7 +98,7 @@ public:
castor::legacymsg::RtcpJobRqstMsgBody getVdqmJob() const;
/**
* Notifies the tape-drive catalogue entry that a recall job has been received
* Notifies the catalogue that a recall job has been received
* for the tape drive.
*
* @param vid The volume identifier of the tape to be mounted for recall.
......@@ -118,7 +118,7 @@ public:
void checkUserCanRecallFromTape(const std::string &vid);
/**
* Notifies the tape-drive catalogue entry that a migration job has been
* Notifies the catalogue that a migration job has been
* received for the tape drive.
*
* @param vid The volume identifier of the tape to be mounted for migration.
......@@ -166,7 +166,7 @@ public:
pid_t getPid() const throw();
/**
* Notifies the tape-drive catalogue entry that the specified tape has been
* Notifies the catalogue that the specified tape has been
* mounted for migration in the tape drive.
*
* @param vid The volume identifier of the tape.
......@@ -174,7 +174,7 @@ public:
void tapeMountedForMigration(const std::string &vid);
/**
* Notifies the tape-drive catalogue entry that the specified tape has been
* Notifies the catalogue that the specified tape has been
* mounted for recall in the tape drive.
*
* @param vid The volume identifier of the tape.
......@@ -188,6 +188,15 @@ public:
*/
bool tapeIsBeingMounted() const throw();
/**
* Notifies the catalogue that a heartbeat message has been
* received from the data-transfer session.
*
* @param nbBlocksMoved Delta value specifying the number of data blocks moved
* since the last heartbeat message.
*/
void receivedHeartbeat(const uint64_t nbBlocksMoved);
protected:
/**
......
......@@ -229,7 +229,7 @@ castor::messages::Frame castor::tape::tapeserver::daemon::TapeMessageHandler::
}
//------------------------------------------------------------------------------
// handleHeartbeatMsg
// handleHeartbeat
//------------------------------------------------------------------------------
castor::messages::Frame castor::tape::tapeserver::daemon::TapeMessageHandler::
handleHeartbeat(const messages::Frame &rqst) {
......@@ -239,6 +239,10 @@ castor::messages::Frame castor::tape::tapeserver::daemon::TapeMessageHandler::
castor::messages::Heartbeat rqstBody;
rqst.parseBodyIntoProtocolBuffer(rqstBody);
CatalogueDrive &drive =
m_driveCatalogue.findDrive(rqstBody.unitname());
drive.getTransferSession().receivedHeartbeat(rqstBody.nbblocksmoved());
const messages::Frame reply = createReturnValueFrame(0);
return reply;
} catch(castor::exception::Exception &ne) {
......
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