Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Related Pages

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 go (unsigned nWorker) throw (IsException)
 The command to start the workers.

const char * getStatus () const throw ()
 Get the status information.

virtual char * status (ArchivingServiceIStatus *status)
 As for getStatus, but available over IPC.

virtual ilu_ShortInteger busy (ArchivingServiceIStatus *_status)
 busy method available over IPC

virtual ilu_ShortInteger queueLength (ArchivingServiceIStatus *_status)
 queue method available over IPC

virtual void suspendCallbacks (ArchivingServiceIStatus *_status, ilu_Boolean doSuspend)
 call this to suspend callbacks when retrieving to data servers

IPCServer & getArchiverServer () throw ()
 wrap method to get server

virtual void archiveISName (ArchivingServiceIStatus *status, char *ioNameIS)
 Archive a IONameIS.

virtual void retrieveISName (ArchivingServiceIStatus *status, char *ioNameIS)
 Retrieve a IONameIS.

virtual void retrieveArchName (ArchivingServiceIStatus *status, char *archivingName)
 Retrieve a IONameArchiveFile.

virtual void retrieve (ArchivingServiceIStatus *_status, char *runNumber, char *scanNumber, char *className, char *specifier)
 Retrieve objects matching a particular file glob pattern.

virtual ilu_ShortInteger getCompressionLevel (ArchivingServiceIStatus *_status)
 get the gzip compression level

virtual void setCompressionLevel (ArchivingServiceIStatus *_status, ilu_ShortInteger level)
 set the gzip compression level

virtual void setRetrieveIsServer (ArchivingServiceIStatus *_status, ilu_T_CString 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 getRetrieveIsServer () const throw ()
 get the IS server name to retrieve data to


Static Public Member Functions

Archiverinstance ()
 Gets a reference to the instance of the Archiver.

Archiverinitialize () throw (ConfigurationException)
 Initialize the Archiver instance
Exceptions:
ConfigurationException if.


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


Private Member Functions

 Archiver () throw (ConfigurationException)
 singleton

 ~Archiver () throw ()
 private destructor

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::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

Static Private Attributes

Archiverarchiver
 pointer to singleton used in lazy initialization.


Detailed Description

Class definition of the SCT archiving service.

Author:
Alan Barr
Date:
10 Feb 2004

Definition at line 30 of file Archiver.h.


Constructor & Destructor Documentation

SctArchiving::Archiver::Archiver  )  throw (ConfigurationException) [private]
 

singleton

Definition at line 68 of file Archiver.cpp.

References Sct::SctNames::getRetrievedDataName().

Referenced by instance().

Here is the call graph for this function:

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

private destructor

Definition at line 83 of file Archiver.cpp.


Member Function Documentation

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

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

Definition at line 204 of file Archiver.cpp.

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

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

Definition at line 199 of file Archiver.cpp.

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

Static function used as callback to archive data.

Definition at line 104 of file Archiver.cpp.

References m_suspend_callback, SctService::WorkerGroup< shared_ptr< ArchivingCommand > >::push(), and workergroup.

Here is the call graph for this function:

void SctArchiving::Archiver::archiveISName ArchivingServiceIStatus *  status,
char *  ioNameIS
[virtual]
 

Archive a IONameIS.

Definition at line 238 of file Archiver.cpp.

References SctService::WorkerGroup< shared_ptr< ArchivingCommand > >::push(), and workergroup.

Here is the call graph for this function:

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

get the archive manager

ilu_ShortInteger SctArchiving::Archiver::busy ArchivingServiceIStatus *  _status  )  [virtual]
 

busy method available over IPC

Definition at line 300 of file Archiver.cpp.

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

Here is the call graph for this function:

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

wrap method to get server

Definition at line 95 of file Archiver.cpp.

ilu_ShortInteger SctArchiving::Archiver::getCompressionLevel ArchivingServiceIStatus *  _status  )  [virtual]
 

get the gzip compression level

Definition at line 310 of file Archiver.cpp.

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

get the IS server name to retrieve data to

Definition at line 143 of file Archiver.cpp.

Referenced by retrieveArchName().

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

Get the status information.

Definition at line 209 of file Archiver.cpp.

Referenced by status().

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

The command to start the workers.

Parameters:
nWorker the number of worker threads.

Definition at line 175 of file Archiver.cpp.

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

Incriment the number of archivals by 1.

Definition at line 184 of file Archiver.cpp.

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

Incriment the number of retrievals.

Definition at line 189 of file Archiver.cpp.

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

Incriment the number of validations.

Definition at line 194 of file Archiver.cpp.

Archiver& SctArchiving::Archiver::initialize  )  throw (ConfigurationException) [static]
 

Initialize the Archiver instance

Exceptions:
ConfigurationException if.

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 63 of file Archiver.cpp.

References Archiver(), and archiver.

Here is the call graph for this function:

ilu_ShortInteger SctArchiving::Archiver::queueLength ArchivingServiceIStatus *  _status  )  [virtual]
 

queue method available over IPC

Definition at line 305 of file Archiver.cpp.

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

Here is the call graph for this function:

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

Retrieve objects matching a particular file glob pattern.

Definition at line 271 of file Archiver.cpp.

References retrieveArchName().

Here is the call graph for this function:

void SctArchiving::Archiver::retrieveArchName ArchivingServiceIStatus *  status,
char *  archivingName
[virtual]
 

Retrieve a IONameArchiveFile.

Definition at line 285 of file Archiver.cpp.

References getRetrieveIsServer(), SctService::WorkerGroup< shared_ptr< ArchivingCommand > >::push(), and workergroup.

Referenced by retrieve(), and retrieveISName().

Here is the call graph for this function:

void SctArchiving::Archiver::retrieveISName ArchivingServiceIStatus *  _status,
char *  ioNameIS
[virtual]
 

Retrieve a IONameIS.

need to do this cos IPC dosent guarentee constness

Definition at line 259 of file Archiver.cpp.

References retrieveArchName().

Here is the call graph for this function:

void SctArchiving::Archiver::setCompressionLevel ArchivingServiceIStatus *  _status,
ilu_ShortInteger  level
[virtual]
 

set the gzip compression level

Definition at line 315 of file Archiver.cpp.

void SctArchiving::Archiver::setRetrieveIsServer ArchivingServiceIStatus *  _status,
ilu_T_CString  serverName
[virtual]
 

set the retrieval IS server name

Definition at line 147 of file Archiver.cpp.

char * SctArchiving::Archiver::status ArchivingServiceIStatus *  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 231 of file Archiver.cpp.

References 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 158 of file Archiver.cpp.

References infoReceiver.

void SctArchiving::Archiver::suspendCallbacks ArchivingServiceIStatus *  _status,
ilu_Boolean  doSuspend
[virtual]
 

call this to suspend callbacks when retrieving to data servers

Definition at line 152 of file Archiver.cpp.


Field Documentation

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

pointer to singleton used in lazy initialization.

Definition at line 61 of file Archiver.cpp.

Referenced by instance().

boost::mutex SctArchiving::Archiver::counterMutex [private]
 

used to lock access to counters

Definition at line 135 of file Archiver.h.

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

pointer to the IS infoReceiver object

Definition at line 128 of file Archiver.h.

Referenced by subscribe().

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

iomanager to use for achiving

Definition at line 138 of file Archiver.h.

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

pointer to its ArchivingWorkerGroup

Definition at line 124 of file Archiver.h.

Referenced by archive_callback(), archiveISName(), busy(), queueLength(), and retrieveArchName().


The documentation for this class was generated from the following files:
Generated on Thu Jul 15 09:52:06 2004 for SCT DAQ/DCS Software - C++ by doxygen 1.3.5