StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Protected Member Functions | List of all members
TxLogging::TxEventLog Class Referenceabstract

#include <TxEventLog.h>

Inheritance diagram for TxLogging::TxEventLog:
TxLogging::TxEventLogFile TxLogging::TxUCMCollector TxLogging::TxEventLogCollector TxLogging::TxEventLogWeb

Public Types

enum  Stage { START = 1, STATUS = 2, END = 3 }
 
enum  Level {
  LEVEL_UNKNOWN = 0, LEVEL_TRACE = 1, LEVEL_DEBUG = 2, LEVEL_INFO = 3,
  LEVEL_NOTICE = 4, LEVEL_WARNING = 5, LEVEL_ERROR = 6, LEVEL_CRITICAL = 7,
  LEVEL_ALERT = 8, LEVEL_FATAL = 9, TOTAL_LEVELS
}
 
enum  State {
  UNKNOWN = 0, UNSUBMITTED = 1, STAGEIN = 2, PENDING = 3,
  ACTIVE = 4, SUSPENDED = 5, STAGEOUT = 6, CLEANUP = 7,
  DONE = 8, FAILED = 9, TOTAL_STATES
}
 

Public Member Functions

virtual ~TxEventLog ()
 
virtual void writeDown (const char *message)
 
virtual void setEnvBrokerTaskID (const std::string &envBrokerTaskID)=0
 
void setEnvBrokerTaskID (const char *envBrokerTaskID)
 
virtual void setEnvBrokerJobID (const std::string &envBrokerJobID)=0
 
void setEnvBrokerJobID (const char *envBrokerJobID)
 
virtual void setBrokerTaskID (const std::string &brokerTaskID)=0
 
void setBrokerTaskID (const char *brokerTaskID)
 
virtual void setBrokerJobID (int brokerJobID)=0
 
virtual void setRequesterName (const std::string &requester)=0
 
void setRequesterName (const char *requester)
 
virtual void setContext (const std::string &context)=0
 
void setContext (const char *context)
 
virtual void logStart (const std::string &key, const std::string &value)=0
 
void logStart (const char *key=TxUCMConstants::appStart, const char *value="application started")
 
virtual void logJobSubmitLocation (const std::string &url)=0
 
void logJobSubmitLocation (const char *url)
 
virtual void setJobSubmitLocation (const std::string &url)=0
 
void setJobSubmitLocation (const char *url)
 
virtual void logJobAttribute (const std::string &key, const std::string &value)=0
 
void logJobAttribute (const char *key, const char *value)
 
virtual void logTask (unsigned int size=1)=0
 
virtual void logTask (const std::string &taskAttributes)=0
 
void logTask (const char *taskAttributes)
 
virtual void logJobSubmitState (State state)=0
 
virtual void setJobSubmitState (State state)=0
 
virtual void logJobSubmitID (const std::string &ID)=0
 
void logJobSubmitID (const char *ID)
 
virtual void setJobSubmitID (const std::string &ID)=0
 
void setJobSubmitID (const char *ID)
 
virtual void logEvent (const std::string &logMsg, Level level=LEVEL_INFO, Stage stage=STATUS, const std::string &msgContext=TxUCMConstants::defaultContext)=0
 
void logEvent (const char *logMsg, Level level=LEVEL_INFO, Stage stage=STATUS, const char *msgContext=TxUCMConstants::defaultContext)
 
virtual void logEvent (const std::string &userKey, const std::string &userValue, Level level=LEVEL_INFO, Stage stage=STATUS, const std::string &msgContext=TxUCMConstants::defaultContext)=0
 
void logEvent (const char *userKey, const char *userValue, Level level=LEVEL_INFO, Stage stage=STATUS, const char *msgContext=TxUCMConstants::defaultContext)
 
virtual void logEnd (const std::string &key, const std::string &value)=0
 
void logEnd (const char *key=TxUCMConstants::appEnd, const char *value="application ended")
 
virtual StUcmTasksgetTaskList ()
 
virtual StUcmTasksgetTaskList (int limit)
 
virtual StUcmTasksgetTaskList (int limit, int offset)=0
 
virtual StUcmJobsgetJobList ()
 
virtual StUcmJobsgetJobList (StRecord *task)
 
virtual StUcmJobsgetJobList (StRecord *task, int limit)
 
virtual StUcmJobsgetJobList (int limit)
 
virtual StUcmJobsgetJobList (int limit, int offset)
 
virtual StUcmJobsgetJobList (StRecord *task, int limit, int offset)=0
 
virtual int getJobId (const char *requester, const char *taskBrokerId, int jobBrokerId)=0
 
virtual StUcmEventsgetEventList ()
 
virtual StUcmEventsgetEventList (StRecord *job)
 
virtual StUcmEventsgetEventList (StRecord *job, int limit)
 
virtual StUcmEventsgetEventList (int limit)
 
virtual StUcmEventsgetEventList (int limit, int offset)
 
virtual StUcmEventsgetEventList (StRecord *job, int limit, int offset)=0
 
virtual int queryTableSize (const char *tableName)
 
virtual int queryTableSize (const char *tableName, const char *where)=0
 
virtual int queryTableSize (const char *tableName, const StRecord *where)=0
 
virtual void setDbJobID (int dbJobID)=0
 

Protected Member Functions

 TxEventLog ()
 
virtual void writeDown (const std::string &message)=0
 

Detailed Description

TxEventLog is an abstarct inteface to the logginh system

Definition at line 28 of file TxEventLog.h.

Constructor & Destructor Documentation

TxLogging::TxEventLog::TxEventLog ( )
protected

Constructor

  • Gets hostname and sets nodeLocation for the running job.
virtual TxLogging::TxEventLog::~TxEventLog ( )
virtual

Destructor:

  • Sets job state to finished (STAGE = END)

Member Function Documentation

virtual void TxLogging::TxEventLog::logEnd ( const std::string &  key,
const std::string &  value 
)
pure virtual

Called by the application to log an END event

Implemented in TxLogging::TxUCMCollector, and TxLogging::TxEventLogFile.

virtual void TxLogging::TxEventLog::logEvent ( const std::string &  logMsg,
Level  level = LEVEL_INFO,
Stage  stage = STATUS,
const std::string &  msgContext = TxUCMConstants::defaultContext 
)
pure virtual

Log a simple message event. This event is always associated with the currnet brokerTaskID and brokerJobID.

Parameters
logMsgThe message to log.
levelThe level of severity of the event.
stageThe stage of the application assocated with the event.
msgContextThe context in which the event occurs.

Implemented in TxLogging::TxUCMCollector, and TxLogging::TxEventLogFile.

virtual void TxLogging::TxEventLog::logEvent ( const std::string &  userKey,
const std::string &  userValue,
Level  level = LEVEL_INFO,
Stage  stage = STATUS,
const std::string &  msgContext = TxUCMConstants::defaultContext 
)
pure virtual

Log a key-value pair type event. This event is always associated with the current brokerTaskID and brokerJobID.

Parameters
userKey,Thekey of the key-value to log.
userValue,Thevalue of the key-value to log.
levelThe level of severity of the event.
stageThe stage of the application assocated with the event.
msgContextThe context in which the event occurs.

Implemented in TxLogging::TxUCMCollector, and TxLogging::TxEventLogFile.

virtual void TxLogging::TxEventLog::logJobAttribute ( const std::string &  key,
const std::string &  value 
)
pure virtual

Log the job attrbutes. This method will be called by the Broker.

Parameters
stringattrbutes key, For example: "que"
stringattrbutes value, For example queu name

Implemented in TxLogging::TxUCMCollector, and TxLogging::TxEventLogFile.

virtual void TxLogging::TxEventLog::logJobSubmitID ( const std::string &  ID)
pure virtual

Log the job submit ID. This method will be called by the Broker.

Parameters
stringID, Job submit ID.

Implemented in TxLogging::TxUCMCollector, and TxLogging::TxEventLogFile.

virtual void TxLogging::TxEventLog::logJobSubmitLocation ( const std::string &  url)
pure virtual

Log the job submit location. This method will be called by the Broker.

Parameters
stringurl, Job submit location.

Implemented in TxLogging::TxUCMCollector, and TxLogging::TxEventLogFile.

virtual void TxLogging::TxEventLog::logJobSubmitState ( State  state)
pure virtual

Log the job state. This method will be called by the Broker.

Parameters
enumStage, Job state.

Implemented in TxLogging::TxUCMCollector, and TxLogging::TxEventLogFile.

virtual void TxLogging::TxEventLog::logStart ( const std::string &  key,
const std::string &  value 
)
pure virtual

Called by the application to log a START event

Implemented in TxLogging::TxUCMCollector, and TxLogging::TxEventLogFile.

virtual void TxLogging::TxEventLog::logTask ( unsigned int  size = 1)
pure virtual

Log the task size. This method will be called by the Broker to log the new task and its size.

Parameters
intsize, The new task size (the total number of the jobs)

Implemented in TxLogging::TxUCMCollector, and TxLogging::TxEventLogFile.

virtual void TxLogging::TxEventLog::logTask ( const std::string &  taskAttributes)
pure virtual

Log the task with the attributes. This method will be called by the Broker to log the new task and its attributes. The attribuites MUST match the "Task" MySQL table column names. The attribute types must match the mySql Task table column types

Parameters
stringattributes. Task attributes

Implemented in TxLogging::TxUCMCollector, and TxLogging::TxEventLogFile.

virtual void TxLogging::TxEventLog::setBrokerJobID ( int  brokerJobID)
pure virtual

The concept of a job ID and task ID assigned by broker is assumed to be available here. Set the value of Job ID here.

Parameters
intbrokerJobID, value of Job ID

Implemented in TxLogging::TxUCMCollector, TxLogging::TxEventLogFile, and TxLogging::TxEventLogCollector.

virtual void TxLogging::TxEventLog::setBrokerTaskID ( const std::string &  brokerTaskID)
pure virtual

The concept of a job ID and task ID assigned by broker is assumed to be available here. Set the value of Task ID here.

Parameters
stringbrokerTaskID, value of Task ID

Implemented in TxLogging::TxUCMCollector, TxLogging::TxEventLogFile, and TxLogging::TxEventLogCollector.

virtual void TxLogging::TxEventLog::setContext ( const std::string &  context)
pure virtual

Set context for this task/job

Parameters
context,themessage context

Implemented in TxLogging::TxUCMCollector, and TxLogging::TxEventLogFile.

virtual void TxLogging::TxEventLog::setEnvBrokerJobID ( const std::string &  envBrokerJobID)
pure virtual

The concept of a job ID and task ID assigned by broker is assumed to be available here. Set the job ID by passing the name of the environment variable

Parameters
stringenvBrokerJobID, Name of the environment variable

Implemented in TxLogging::TxUCMCollector, and TxLogging::TxEventLogFile.

virtual void TxLogging::TxEventLog::setEnvBrokerTaskID ( const std::string &  envBrokerTaskID)
pure virtual

The concept of a job ID and task ID assigned by broker is assumed to be available here. Set the task ID by passing the name of the environment variable

Parameters
stringenvBrokerTaskID, Name of the environment variable

Implemented in TxLogging::TxUCMCollector, and TxLogging::TxEventLogFile.

virtual void TxLogging::TxEventLog::setRequesterName ( const std::string &  requester)
pure virtual

Set the requester name

Parameters
stringrequesterName

Implemented in TxLogging::TxUCMCollector, TxLogging::TxEventLogFile, and TxLogging::TxEventLogCollector.


The documentation for this class was generated from the following file: