TxLogging::TxEventLog Class Reference

#include <TxEventLog.h>

Inherited by TxLogging::TxEventLogFile, and TxLogging::TxUCMCollector.

List of all members.

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 StUcmTasks * getTaskList ()
virtual StUcmTasks * getTaskList (int limit)
virtual StUcmTasks * getTaskList (int limit, int offset)=0
virtual StUcmJobs * getJobList ()
virtual StUcmJobs * getJobList (StRecord *task)
virtual StUcmJobs * getJobList (StRecord *task, int limit)
virtual StUcmJobs * getJobList (int limit)
virtual StUcmJobs * getJobList (int limit, int offset)
virtual StUcmJobs * getJobList (StRecord *task, int limit, int offset)=0
virtual int getJobId (const char *requester, const char *taskBrokerId, int jobBrokerId)=0
virtual StUcmEvents * getEventList ()
virtual StUcmEvents * getEventList (StRecord *job)
virtual StUcmEvents * getEventList (StRecord *job, int limit)
virtual StUcmEvents * getEventList (int limit)
virtual StUcmEvents * getEventList (int limit, int offset)
virtual StUcmEvents * getEventList (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

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,The key of the key-value to log.
userValue,The value of the key-value to log.
level The level of severity of the event.
stage The stage of the application assocated with the event.
msgContext The context in which the event occurs.

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:
logMsg The message to log.
level The level of severity of the event.
stage The stage of the application assocated with the event.
msgContext The context in which the event occurs.

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:
string attrbutes key, For example: "que"
string attrbutes value, For example queu name

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:
string ID, Job submit ID.

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:
string url, Job submit location.

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

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

Parameters:
enum Stage, Job state.

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

Called by the *application* to log a START event

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:
string attributes. Task attributes

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:
int size, The new task size (the total number of the jobs)

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:
int brokerJobID, value of Job ID

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:
string brokerTaskID, value of Task ID

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

Set context for this task/job

Parameters:
context,the message context

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:
string envBrokerJobID, Name of the environment variable

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:
string envBrokerTaskID, Name of the environment variable

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

Set the requester name

Parameters:
string requesterName


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

Generated on Sat May 26 04:28:29 2012 for StRoot by  doxygen 1.5.9