SctArchiving::Archiver Class Reference

Class definition of the SCT archiving service. More...

#include <Archiver.h>

Collaboration diagram for SctArchiving::Archiver:

Collaboration graph
[legend]

Public Member Functions

void shutdown ()
void go (unsigned nWorker) throw (IsException)
 The command to start the workers.
const char * getStatus () const throw ()
 Get the status information.
virtual char * status ()
 As for getStatus, but available over IPC.
virtual CORBA::Short busy ()
 busy method available over IPC
virtual CORBA::Short queueLength ()
 queue method available over IPC
void setFifo (bool)
 set true for FIFO, false for FILO - see WorkerGroup for pros and cons!
bool isFifo ()
 set true for FIFO, false for FILO - see WorkerGroup for pros and cons!
virtual void suspendCallbacks (CORBA::Boolean doSuspend)
 call this to suspend callbacks when retrieving to data servers
IPCServer & getArchiverServer () throw ()
 wrap method to get server
virtual void archiveISName (const char *ioNameIS)
 Archive a IONameIS.
virtual void retrieveISName (const char *ioNameIS)
 Retrieve a IONameIS.
virtual void retrieveArchName (const char *archivingName)
 Retrieve a IONameArchiveFile.
virtual void retrieve (const char *runNumber, const char *scanNumber, const char *className, const char *specifier)
 Retrieve objects matching a particular file glob pattern.
virtual CORBA::Short getCompressionLevel ()
 get the gzip compression level
virtual void setCompressionLevel (CORBA::Short level)
 set the gzip compression level
virtual void setRetrieveIsServer (const char *serverName)
 set the retrieval IS server name
virtual void addCommand (boost::shared_ptr< ArchivingCommand > command) const
void incrimentNArchived () throw ()
 Incriment the number of archivals by 1.
void incrimentNRetrieved () throw ()
 Incriment the number of retrievals.
void incrimentNValidated () throw ()
 Incriment the number of validations.
void addISTime (double time) throw ()
 Called to add to time for reading/writing to IS.
void addFileTime (double time) throw ()
 Called to add to time for reading/writing to archive file.
Sct::Archive::IOManagerArchiveArchiver::getIOManagerArchive () const
 get the archive manager
string internal_getRetrieveIsServer () const throw ()
 get the IS server name to retrieve data to
virtual void setPersistentDirectory (const char *newDirectory)
 set new Persistent Directory
char * getRetrieveIsServer () throw ()
 name of ISServer to retrieve to
void recover ()

Static Public Member Functions

static Archiverinstance ()
 Gets a reference to the instance of the Archiver.
static Archiverinitialize (ArchiverArguments args)
 Initialize the Archiver instance with command line arguments
Exceptions:
ConfigurationException if.

static void archive_callback (ISCallbackInfo *isc)
 Static function used as callback to archive data.

Protected Member Functions

 ~Archiver () throw ()
 protected destructor

Private Member Functions

 Archiver (ArchiverArguments args)
 Private constructor from command line arguments.
void subscribe (const string &servername, const string &regexp, ISCallbackInfo::Callback callback)
 subscribe to IS, throwing IsExceptions if there are problems
double getAverageTime (double time) const throw ()

Private Attributes

ArchivingWorkerGroupworkergroup
 pointer to its ArchivingWorkerGroup
std::auto_ptr< ISInfoReceiver > infoReceiver
 pointer to the IS infoReceiver object
long nArchived
long nRetrieved
long nValidated
double isTimeTaken
double fileTimeTaken
boost::recursive_mutex counterMutex
 used to lock access to counters
Sct::Archive::IOManagerArchivem_archive_manager
 iomanager to use for achiving
std::string m_retrieval_is_server
bool m_suspend_callback
ArchiverArguments m_args

Static Private Attributes

static Archiverarchiver
 pointer to singleton used in lazy initialization.

Detailed Description

Class definition of the SCT archiving service.

Author:
Alan Barr
Date:
10 Feb 2004 modified by
Author:
Chris Lester
Date:
July 2004

Definition at line 35 of file Archiver.h.


Constructor & Destructor Documentation

SctArchiving::Archiver::Archiver ArchiverArguments  args  )  [private]
 

Private constructor from command line arguments.

Definition at line 80 of file Archiver.cpp.

References SctArchiving::ArchiverArguments::getCompressionLevel(), SctService::Arguments::getISStatusName(), SctService::Arguments::getOutputISServer(), SctArchiving::ArchiverArguments::getPersistentDirectory(), Sct::SctNames::getRetrievedDataName(), infoReceiver, m_archive_manager, m_args, m_retrieval_is_server, m_suspend_callback, SctService::WorkerGroup< T >::reportTo(), and workergroup.

Referenced by initialize().

Here is the call graph for this function:

SctArchiving::Archiver::~Archiver  )  throw () [protected]
 

protected destructor

Definition at line 103 of file Archiver.cpp.

References SctService::WorkerGroup< T >::busy(), SctService::WorkerGroup< T >::queueSize(), and workergroup.

Here is the call graph for this function:


Member Function Documentation

void SctArchiving::Archiver::addFileTime double  time  )  throw ()
 

Called to add to time for reading/writing to archive file.

Definition at line 236 of file Archiver.cpp.

Referenced by SctArchiving::ArchivePutCommand::execute(), and SctArchiving::ArchiveGetCommand::execute().

void SctArchiving::Archiver::addISTime double  time  )  throw ()
 

Called to add to time for reading/writing to IS.

Definition at line 231 of file Archiver.cpp.

void SctArchiving::Archiver::archive_callback ISCallbackInfo *  isc  )  [static]
 

Static function used as callback to archive data.

Definition at line 123 of file Archiver.cpp.

References instance(), SctArchiving::isControl(), and m_suspend_callback.

Here is the call graph for this function:

void SctArchiving::Archiver::archiveISName const char *  ioNameIS  )  [virtual]
 

Archive a IONameIS.

Definition at line 279 of file Archiver.cpp.

References SctArchiving::isControl(), SctService::WorkerGroup< T >::push(), Sct::Throwable::sendToMrs(), and workergroup.

Here is the call graph for this function:

Sct::Archive::IOManagerArchive& SctArchiving::Archiver::Archiver::getIOManagerArchive  )  const
 

get the archive manager

CORBA::Short SctArchiving::Archiver::busy  )  [virtual]
 

busy method available over IPC

Definition at line 339 of file Archiver.cpp.

References SctService::WorkerGroup< T >::busy(), and workergroup.

Here is the call graph for this function:

IPCServer & SctArchiving::Archiver::getArchiverServer  )  throw ()
 

wrap method to get server

Definition at line 114 of file Archiver.cpp.

CORBA::Short SctArchiving::Archiver::getCompressionLevel  )  [virtual]
 

get the gzip compression level

Definition at line 347 of file Archiver.cpp.

char * SctArchiving::Archiver::getRetrieveIsServer  )  throw ()
 

name of ISServer to retrieve to

Definition at line 165 of file Archiver.cpp.

References Sct::copyStringToCorba(), and internal_getRetrieveIsServer().

Referenced by SctArchiving::IsPutCommand::execute().

Here is the call graph for this function:

const char * SctArchiving::Archiver::getStatus  )  const throw ()
 

Get the status information.

Definition at line 241 of file Archiver.cpp.

References SctService::WorkerGroup< T >::busy(), counterMutex, SctService::WorkerGroup< T >::isFifo(), SctService::WorkerGroup< T >::nWorkers(), SctService::WorkerGroup< T >::queueSize(), and workergroup.

Referenced by status().

Here is the call graph for this function:

void SctArchiving::Archiver::go unsigned  nWorker  )  throw (IsException)
 

The command to start the workers.

Parameters:
nWorker the number of worker threads.

Definition at line 206 of file Archiver.cpp.

void SctArchiving::Archiver::incrimentNArchived  )  throw ()
 

Incriment the number of archivals by 1.

Definition at line 216 of file Archiver.cpp.

References counterMutex, and nArchived.

Referenced by SctArchiving::ArchivePutCommand::execute().

void SctArchiving::Archiver::incrimentNRetrieved  )  throw ()
 

Incriment the number of retrievals.

Definition at line 221 of file Archiver.cpp.

References counterMutex, and nRetrieved.

Referenced by SctArchiving::ArchiveGetCommand::execute().

void SctArchiving::Archiver::incrimentNValidated  )  throw ()
 

Incriment the number of validations.

Definition at line 226 of file Archiver.cpp.

References counterMutex, and nValidated.

Archiver & SctArchiving::Archiver::initialize ArchiverArguments  args  )  [static]
 

Initialize the Archiver instance with command line arguments

Exceptions:
ConfigurationException if.

Definition at line 75 of file Archiver.cpp.

References Archiver(), and archiver.

Here is the call graph for this function:

Archiver & SctArchiving::Archiver::instance  )  [static]
 

Gets a reference to the instance of the Archiver.

If it hasn't been initialized, it calls initialize() first

Definition at line 70 of file Archiver.cpp.

References archiver.

Referenced by archive_callback(), SctArchiving::TransferCommand::execute(), SctArchiving::IsPutCommand::execute(), SctArchiving::ArchivePutCommand::execute(), and SctArchiving::ArchiveGetCommand::execute().

string SctArchiving::Archiver::internal_getRetrieveIsServer  )  const throw ()
 

get the IS server name to retrieve data to

Definition at line 160 of file Archiver.cpp.

References m_retrieval_is_server.

Referenced by getRetrieveIsServer(), and retrieveArchName().

bool SctArchiving::Archiver::isFifo  ) 
 

set true for FIFO, false for FILO - see WorkerGroup for pros and cons!

Definition at line 351 of file Archiver.cpp.

References SctService::WorkerGroup< T >::isFifo(), and workergroup.

Here is the call graph for this function:

CORBA::Short SctArchiving::Archiver::queueLength  )  [virtual]
 

queue method available over IPC

Definition at line 343 of file Archiver.cpp.

References SctService::WorkerGroup< T >::queueSize(), and workergroup.

Here is the call graph for this function:

void SctArchiving::Archiver::retrieve const char *  runNumber,
const char *  scanNumber,
const char *  className,
const char *  specifier
[virtual]
 

Retrieve objects matching a particular file glob pattern.

Definition at line 311 of file Archiver.cpp.

References SctArchiving::ArchiverArguments::getPersistentDirectory(), m_args, retrieveArchName(), and Sct::Throwable::sendToMrs().

Here is the call graph for this function:

void SctArchiving::Archiver::retrieveArchName const char *  archivingName  )  [virtual]
 

Retrieve a IONameArchiveFile.

Definition at line 325 of file Archiver.cpp.

References internal_getRetrieveIsServer(), SctService::WorkerGroup< T >::push(), Sct::Throwable::sendToMrs(), and workergroup.

Referenced by retrieve(), and retrieveISName().

Here is the call graph for this function:

void SctArchiving::Archiver::retrieveISName const char *  ioNameIS  )  [virtual]
 

Retrieve a IONameIS.

need to do this cos IPC dosent guarentee constness

Definition at line 299 of file Archiver.cpp.

References Sct::IOName::getClassName(), Sct::IOName::getUniqueID(), retrieveArchName(), and Sct::Throwable::sendToMrs().

Here is the call graph for this function:

void SctArchiving::Archiver::setCompressionLevel CORBA::Short  level  )  [virtual]
 

set the gzip compression level

Definition at line 359 of file Archiver.cpp.

void SctArchiving::Archiver::setFifo bool   ) 
 

set true for FIFO, false for FILO - see WorkerGroup for pros and cons!

Definition at line 355 of file Archiver.cpp.

References SctService::WorkerGroup< T >::setFifo(), and workergroup.

Here is the call graph for this function:

void SctArchiving::Archiver::setPersistentDirectory const char *  newDirectory  )  [virtual]
 

set new Persistent Directory

Definition at line 173 of file Archiver.cpp.

void SctArchiving::Archiver::setRetrieveIsServer const char *  serverName  )  [virtual]
 

set the retrieval IS server name

Definition at line 169 of file Archiver.cpp.

References m_retrieval_is_server.

char * SctArchiving::Archiver::status  )  [virtual]
 

As for getStatus, but available over IPC.

Makes a new char[] which ipc then deletes.

Parameters:
the status of the IPC request.

Definition at line 271 of file Archiver.cpp.

References counterMutex, and getStatus().

Here is the call graph for this function:

void SctArchiving::Archiver::subscribe const string &  servername,
const string &  regexp,
ISCallbackInfo::Callback  callback
[private]
 

subscribe to IS, throwing IsExceptions if there are problems

Definition at line 184 of file Archiver.cpp.

References SctService::Arguments::getOutputISServer(), and m_args.

Here is the call graph for this function:

void SctArchiving::Archiver::suspendCallbacks CORBA::Boolean  doSuspend  )  [virtual]
 

call this to suspend callbacks when retrieving to data servers

Definition at line 177 of file Archiver.cpp.

References m_suspend_callback.


Field Documentation

Archiver * SctArchiving::Archiver::archiver [static, private]
 

pointer to singleton used in lazy initialization.

Definition at line 43 of file Archiver.h.

Referenced by initialize(), and instance().

boost::recursive_mutex SctArchiving::Archiver::counterMutex [mutable, private]
 

used to lock access to counters

Definition at line 190 of file Archiver.h.

Referenced by getStatus(), incrimentNArchived(), incrimentNRetrieved(), incrimentNValidated(), and status().

std::auto_ptr<ISInfoReceiver> SctArchiving::Archiver::infoReceiver [private]
 

pointer to the IS infoReceiver object

Definition at line 183 of file Archiver.h.

Referenced by Archiver().

Sct::Archive::IOManagerArchive* SctArchiving::Archiver::m_archive_manager [private]
 

iomanager to use for achiving

Definition at line 193 of file Archiver.h.

Referenced by Archiver().

ArchivingWorkerGroup* SctArchiving::Archiver::workergroup [private]
 

pointer to its ArchivingWorkerGroup

Definition at line 175 of file Archiver.h.

Referenced by addCommand(), archiveISName(), Archiver(), busy(), getStatus(), isFifo(), queueLength(), retrieveArchName(), setFifo(), and ~Archiver().


The documentation for this class was generated from the following files:
Generated on Mon Feb 6 14:05:01 2006 for SCT DAQ/DCS Software - C++ by  doxygen 1.4.6