StRoot
1
|
Public Member Functions | |
TxUCMCollector () | |
boolean | initDb () |
void | startProcess () |
void | processMessage (const std::string &message) |
void | processMessage (const char *message) |
virtual StUcmTasks * | getTaskList () |
virtual StUcmTasks * | getTaskList (int limit) |
virtual StUcmTasks * | getTaskList (int limit, int offset) |
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) |
virtual int | getJobId (const char *reqName, const char *taskBrokerId, int jobBrokerId) |
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) |
int | fillTaskList (StUcmTasks &tasks, int limit=0, int offset=0) |
int | fillJobList (StUcmJobs &jobs, int limit=0, int offset=0) |
int | fillJobList (StUcmJobs &jobs, int limit, int offset, const StRecord *task) |
int | fillEventList (StUcmEvents &event, int limit=0, int offset=0, const StRecord *job=0) |
void | fillFields (FieldList &fields) |
int | fillUcmList (const char *type, RecordList &records, int limit=0, int offset=0) |
int | queryTableSize (const char *tableName) |
int | queryTableSize (const char *tableName, const char *where) |
int | queryTableSize (const char *tableName, const StRecord *where) |
void | queryTable (const char *tableName, int limit=0, int offset=0, const char *where=0) |
void | queryTaskTable (int limit=0, int offset=0) |
void | queryJobTable (int limit=0, int offset=0) |
void | queryJobTable (const char *taskID, int limit=0, int offset=0) |
void | queryEventTable (int limit=0, int offset=0) |
void | queryEventTable (const char *jobID, int limit=0, int offset=0) |
virtual void | setEnvBrokerTaskID (const std::string &envBrokerTaskID) |
virtual void | setEnvBrokerJobID (const std::string &envBrokerJobID) |
virtual void | setBrokerTaskID (const std::string &brokerTaskID) |
virtual void | setBrokerJobID (int brokerJobID) |
virtual void | setDbJobID (int dbJobID) |
virtual void | setRequesterName (const std::string &requester) |
virtual void | setContext (const std::string &context) |
virtual void | logStart (const std::string &key, const std::string &value) |
virtual void | logJobAttribute (const std::string &key, const std::string &value) |
virtual void | logJobSubmitLocation (const std::string &url) |
virtual void | setJobSubmitLocation (const std::string &url) |
virtual void | logTask (unsigned int size=1) |
virtual void | logTask (const std::string &taskAttributes) |
virtual void | logJobSubmitState (State state) |
virtual void | setJobSubmitState (State state) |
virtual void | logJobSubmitID (const std::string &ID) |
virtual void | setJobSubmitID (const std::string &ID) |
virtual void | logEvent (const std::string &logMsg, Level level=LEVEL_INFO, Stage stage=STATUS, const std::string &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) |
virtual void | logEnd (const std::string &key, const std::string &value) |
Public Member Functions inherited from TxLogging::TxEventLog | |
virtual | ~TxEventLog () |
void | setEnvBrokerTaskID (const char *envBrokerTaskID) |
void | setEnvBrokerJobID (const char *envBrokerJobID) |
void | setBrokerTaskID (const char *brokerTaskID) |
void | setRequesterName (const char *requester) |
void | setContext (const char *context) |
void | logStart (const char *key=TxUCMConstants::appStart, const char *value="application started") |
void | logJobSubmitLocation (const char *url) |
void | setJobSubmitLocation (const char *url) |
void | logJobAttribute (const char *key, const char *value) |
void | logTask (const char *taskAttributes) |
void | logJobSubmitID (const char *ID) |
void | setJobSubmitID (const char *ID) |
void | logEvent (const char *logMsg, Level level=LEVEL_INFO, Stage stage=STATUS, const char *msgContext=TxUCMConstants::defaultContext) |
void | logEvent (const char *userKey, const char *userValue, Level level=LEVEL_INFO, Stage stage=STATUS, const char *msgContext=TxUCMConstants::defaultContext) |
void | logEnd (const char *key=TxUCMConstants::appEnd, const char *value="application ended") |
Static Public Member Functions | |
static void | main (const char *args[]) |
Protected Member Functions | |
virtual void | writeDown (const std::string &message) |
virtual void | writeDown (const char *message) |
Protected Member Functions inherited from TxLogging::TxEventLog | |
TxEventLog () | |
Additional Inherited Members | |
Public Types inherited from TxLogging::TxEventLog | |
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 } |
Definition at line 38 of file TxUCMCollector.h.
TxUCMCollector::TxUCMCollector | ( | ) |
|
virtual |
Create a new record in Tasks table: the values are in the value field of the log message
Reimplemented from TxLogging::TxEventLog.
boolean TxUCMCollector::initDb | ( | ) |
Init Db properties and connection
Definition at line 248 of file TxUCMCollector.cxx.
Referenced by main().
|
virtual |
Called by the application to log an END event
Implements TxLogging::TxEventLog.
Definition at line 1627 of file TxUCMCollector.cxx.
|
virtual |
Log a simple message event. This event is always associated with the currnet brokerTaskID and brokerJobID.
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. |
Implements TxLogging::TxEventLog.
Definition at line 1616 of file TxUCMCollector.cxx.
|
virtual |
Log a key-value pair type event. This event is always associated with the current brokerTaskID and brokerJobID.
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. |
Implements TxLogging::TxEventLog.
Definition at line 1621 of file TxUCMCollector.cxx.
|
virtual |
Log the job attrbutes. This method will be called by the Broker.
string | attrbutes key, For example: "que" |
string | attrbutes value, For example queu name |
Implements TxLogging::TxEventLog.
Definition at line 1571 of file TxUCMCollector.cxx.
|
virtual |
Log the job submit ID. This method will be called by the Broker.
Implements TxLogging::TxEventLog.
Definition at line 1608 of file TxUCMCollector.cxx.
|
virtual |
Log the job submit location. This method will be called by the Broker.
string | url, Job submit location. |
Implements TxLogging::TxEventLog.
Definition at line 1577 of file TxUCMCollector.cxx.
|
virtual |
Log the job state. This method will be called by the Broker.
enum | Stage, Job state. |
Implements TxLogging::TxEventLog.
Definition at line 1599 of file TxUCMCollector.cxx.
|
virtual |
Called by the application to log a START event
Implements TxLogging::TxEventLog.
Definition at line 1566 of file TxUCMCollector.cxx.
|
virtual |
Log the task size. This method will be called by the Broker to log the new task and its size.
int | size, The new task size (the total number of the jobs) |
Implements TxLogging::TxEventLog.
Definition at line 1589 of file TxUCMCollector.cxx.
|
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
string | attributes. Task attributes |
Implements TxLogging::TxEventLog.
Definition at line 1594 of file TxUCMCollector.cxx.
|
static |
main to get things going
Definition at line 1280 of file TxUCMCollector.cxx.
References initDb(), processMessage(), startProcess(), and TxUCMCollector().
void TxUCMCollector::processMessage | ( | const std::string & | message | ) |
Process the message and create a hash map with key value pairs Then process the hash map to create/update/insert tables
const | char * message to process |
Definition at line 568 of file TxUCMCollector.cxx.
Referenced by main().
|
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.
int | brokerJobID, value of Job ID |
Implements TxLogging::TxEventLog.
Definition at line 1543 of file TxUCMCollector.cxx.
|
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.
string | brokerTaskID, value of Task ID |
Implements TxLogging::TxEventLog.
Definition at line 1537 of file TxUCMCollector.cxx.
|
virtual |
Set context for this task/job
context,the | message context |
Implements TxLogging::TxEventLog.
Definition at line 1561 of file TxUCMCollector.cxx.
|
virtual |
The current Db if for the last selected job
int | dbJobID, value of Job ID |
Implements TxLogging::TxEventLog.
Definition at line 1549 of file TxUCMCollector.cxx.
|
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
string | envBrokerJobID, Name of the environment variable |
Implements TxLogging::TxEventLog.
Definition at line 1532 of file TxUCMCollector.cxx.
|
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
string | envBrokerTaskID, Name of the environment variable |
Implements TxLogging::TxEventLog.
Definition at line 1527 of file TxUCMCollector.cxx.
|
virtual |
Set the requester name
string | requesterName |
Implements TxLogging::TxEventLog.
Definition at line 1555 of file TxUCMCollector.cxx.
void TxUCMCollector::startProcess | ( | ) |
startProcess: reads the todo list and starts processing the log file
Definition at line 370 of file TxUCMCollector.cxx.
Referenced by main().