Commit 1911f778 authored by David COME's avatar David COME
Browse files

Updated some comments

parent 71a7728a
......@@ -46,19 +46,7 @@ public:
/**
* Destructor.
*
* This destructor should be virtual, but it is temporarily not in order to
* keep the system running ableit with file descriptor leaks.
*
* When this destructor is made virtual, please uncomment the following
* unit test in order to prove that file descriptors are being closed
* correctly.
*
* File: castor/tape/reactor/ZMQReactorTest.cpp
* Test: TEST_F(castor_tape_reactor_ZMQReactorTest, closeFd)
* Valrgind command-line: valgrind --track-fds=yes test/castorUnitTests
*/
//~ZMQPollEventHandler() throw();
virtual ~ZMQPollEventHandler() throw() = 0;
/**
......
......@@ -141,6 +141,17 @@ public:
to.write(m_data + writePosition, m_size - writePosition);
}
}
/*
Example for the Adler32
* unsigned long chck = Pyaload::zeroAdler32();
* while() {
* payload.read(from);
* chck = payload.adler32(chck);
* }
*/
/**
* Compute adler32 checksum on the current data hold.
* @param previous The previous adler32 checksum from all previous datablock
......@@ -149,6 +160,10 @@ public:
unsigned long adler32(unsigned long previous){
return ::adler32(previous,m_data,m_size);
}
/**
* Return the initial value for computing Adler32 checksum
*/
static unsigned long zeroAdler32() {
return ::adler32(0L,Z_NULL,0);
}
......
......@@ -24,7 +24,9 @@
#include "castor/tape/tapeserver/daemon/TapeWriteSingleThread.hpp"
//------------------------------------------------------------------------------
//constructor
//------------------------------------------------------------------------------
castor::tape::tapeserver::daemon::TapeWriteSingleThread::TapeWriteSingleThread(
castor::tape::tapeserver::drives::DriveInterface & drive,
castor::legacymsg::RmcProxy & rmc,
......@@ -39,12 +41,16 @@ castor::tape::tapeserver::drives::DriveInterface & drive,
m_drive(drive), m_reportPacker(repPacker),
m_lastFseq(-1),
m_compress(true) {}
//------------------------------------------------------------------------------
//setlastFseq
//------------------------------------------------------------------------------
void castor::tape::tapeserver::daemon::TapeWriteSingleThread::
setlastFseq(uint64_t lastFseq){
m_lastFseq=lastFseq;
}
//------------------------------------------------------------------------------
//openWriteSession
//------------------------------------------------------------------------------
std::auto_ptr<castor::tape::tapeFile::WriteSession>
castor::tape::tapeserver::daemon::TapeWriteSingleThread::openWriteSession() {
using castor::log::LogContext;
......@@ -75,7 +81,9 @@ castor::tape::tapeserver::daemon::TapeWriteSingleThread::openWriteSession() {
}
return writeSession;
}
//------------------------------------------------------------------------------
//tapeFlush
//------------------------------------------------------------------------------
void castor::tape::tapeserver::daemon::TapeWriteSingleThread::
tapeFlush(const std::string& message,uint64_t bytes,uint64_t files,
utils::Timer & timer)
......@@ -91,7 +99,9 @@ tapeFlush(const std::string& message,uint64_t bytes,uint64_t files,
m_stats.flushTime += flushTime;
}
//------------------------------------------------------------------------------
//run
//------------------------------------------------------------------------------
void castor::tape::tapeserver::daemon::TapeWriteSingleThread::run() {
m_logContext.pushOrReplace(log::Param("thread", "TapeWrite"));
castor::tape::utils::Timer timer, totalTimer;
......@@ -100,6 +110,8 @@ void castor::tape::tapeserver::daemon::TapeWriteSingleThread::run() {
// Set capabilities allowing rawio (and hence arbitrary SCSI commands)
// through the st driver file descriptor.
setCapabilities();
//pair of brackets to create an artficial scope for the tape cleaning
{
//log and notify
m_logContext.log(LOG_INFO, "Starting tape write thread");
......
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