00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include "StStarLogger/StLoggerConfig.h"
00011 #include "TxUCMCollector.h"
00012 #include "StDbFieldI.h"
00013 #include "FieldList.h"
00014 #include "StDbFieldIIterator.h"
00015 #include "StUcmTasks.h"
00016 #include "StUcmJobs.h"
00017 #include "StUcmEvents.h"
00018
00019 #include <stdlib.h>
00020 #include <iostream>
00021 #include <sstream>
00022 #include <log4cxx/logger.h>
00023 #include <log4cxx/consoleappender.h>
00024 #include <log4cxx/patternlayout.h>
00025 #include <log4cxx/helpers/loglog.h>
00026 #include <log4cxx/helpers/optionconverter.h>
00027 #include <log4cxx/helpers/stringhelper.h>
00028 #include <stdio.h>
00029 using namespace log4cxx;
00030 using namespace log4cxx::helpers;
00031 using namespace log4cxx::spi;
00032 using namespace std;
00033
00034 using namespace TxLogging;
00035 using namespace StDbField;
00036
00037 #define TRY
00038 #define CATCH(a)
00039
00040 const char *TxUCMCollector::fgTs = "ts";
00041 const char *TxUCMCollector::fgEvent = "event";
00042 const char *TxUCMCollector::fgBJobID = "broker.job.id";
00043 const char *TxUCMCollector::fgBTaskID = "broker.task.id";
00044 const char *TxUCMCollector::fgRequester = "requester.name";
00045 const char *TxUCMCollector::fgContext = "context";
00046 const char *TxUCMCollector::fgLevel = "level";
00047 const char *TxUCMCollector::fgStage = "stage";
00048 const char *TxUCMCollector::fgKey = "key";
00049 const char *TxUCMCollector::fgValue = "value";
00050
00051 const char *TxUCMCollector::fgNewTask = "com.txcorp.ucm.newtask";
00052 const char *TxUCMCollector::fgUpdateTask = "com.txcorp.ucm.updatetask";
00053 const char *TxUCMCollector::fgAddJob = "com.txcorp.ucm.addjob";
00054 const char *TxUCMCollector::fgUpdateJob = "com.txcorp.ucm.updatejob";
00055 const char *TxUCMCollector::fgSiteLocation = "com.txcorp.ucm.job.siteLocation";
00056 const char *TxUCMCollector::fgStateID = "com.txcorp.ucm.job.stateID";
00057 const char *TxUCMCollector::fgGridJobID = "com.txcorp.ucm.job.gridJobID";
00058 const char *TxUCMCollector::fgAppStart = "com.txcorp.ucm.app.start";
00059 const char *TxUCMCollector::fgAppEnd = "com.txcorp.ucm.app.end";
00060
00061 const char *TxUCMCollector::fgStatusFile = "txucmcollectorstatus.properties";
00062 const char *TxUCMCollector::fgStatusFileName = "current.logfile.name";
00063 const char *TxUCMCollector::fgStatusFileModTime = "current.logfile.modtime";
00064 const char *TxUCMCollector::fgStatusFilePos = "current.logfile.pos";
00065
00066
00067
00068 namespace {
00069 string itoa(int i)
00070 {
00071 char buffer[100];
00072 sprintf(buffer,"%d",i);
00073 return string(buffer);
00074 }
00075 }
00076
00077
00078 MYSQL *TxUCMCollector::getConnection()
00079 {
00080 const char *host = "heston.star.bnl.gov";
00081 const char *user = "StarLogger";
00082 const char *passwd = "logger";
00083 return getConnection(host,user,passwd);
00084 }
00085
00086
00087 MYSQL *TxUCMCollector::getConnection (const string&dbUrl,const string&dbUsername
00088 , const string&dbPassword)
00089 {
00090 return getConnection (dbUrl.c_str(),dbUsername.c_str(),dbPassword.c_str());
00091 }
00092
00093
00094 MYSQL *TxUCMCollector::getConnection (const char *cdbUrl,const char *cdbUsername
00095 , const char *cdbPassword)
00096 {
00097 if (!fIsConnectionOpen) {
00098 if ( !(connection= mysql_init(connection)) ) {
00099 log->error("MYSQL: ---- > No init connection");
00100 } else {
00101 const char *host = cdbUrl;
00102 const char *user = cdbUsername;
00103 const char *passwd = cdbPassword;
00104 const char *db = dbName.c_str();
00105 unsigned int port = 3306;
00106
00107 if (!(mysql_real_connect(connection
00108 , host
00109 , user
00110 , passwd
00111 , db
00112 , port
00113 , 0,0
00114 )))
00115 {
00116 string error = __FUNCTION__
00117 + string("host: ") + host
00118 + string("; user: ") + user
00119 + string(" passwd: ") + passwd
00120 + string(" db: ") + db
00121 + string(" port:") + itoa(port)
00122 + " error: " + mysql_error(connection);
00123 log->debug(error.c_str());
00124 connection = 0;
00125 fIsConnectionOpen = false;
00126 } else {
00127 string error = "Ok connection to Db : "
00128 + string("host: <") + host
00129 + string("> user: <") + user
00130 + string("> passwd: <") + passwd
00131 + string("> db: <") + db
00132 + string("> port: ") + itoa(port);
00133 log->debug(error.c_str());
00134 fIsConnectionOpen = true;
00135 }
00136 }
00137 }
00138 return connection;
00139 }
00140
00141
00142 unsigned int TxUCMCollector::execute(const string &sql)
00143 {
00144 return execute(sql.c_str());
00145 }
00146
00147
00148 unsigned int TxUCMCollector::execute(const char *sql)
00149 {
00150 unsigned int ret=1;
00151 if (getConnection()) {
00152 String query = sql;
00153 log->debug(string("TxUCMCollector::execute ") + sql);
00154 if (fResult) {
00155 mysql_free_result(fResult);
00156 fResult = 0;
00157 }
00158 if (( ret = mysql_query(connection,query.c_str()) )) {
00159 log->error(std::string("MYSQL QUERY:") + mysql_error(connection));
00160 } else {
00161 fResult = mysql_store_result(connection);
00162 }
00163 }
00164 return ret;
00165 }
00166
00167
00168 void TxUCMCollector::closeConnection()
00169 {
00170 if (fIsConnectionOpen) {
00171 if (fResult) {
00172 mysql_free_result(fResult);
00173 fResult = 0;
00174 }
00175 mysql_close(connection);
00176 if (mysql_errno(connection)) fprintf(stderr,"MYSQL close ERROR %s \n",mysql_error(connection));
00177 connection = 0;
00178 fIsConnectionOpen = false;
00179 }
00180 }
00181
00182
00183 TxUCMCollector::TxUCMCollector ()
00184 : connection()
00185 ,fResult(),fField(),fRow()
00186 ,fIsConnectionOpen(false), sleepTime(10),currLogFilePos(0)
00187 ,fBrokerJobID(-1), fDbJobID(-1)
00188
00189 {
00190
00191 log = Logger::getLogger(_T("TxUCMCollector"));
00192
00193 AppenderList apps = log->getAllAppenders();
00194 if (!apps.size()) {
00195
00196 ConsoleAppenderPtr appender = new ConsoleAppender(
00197 new PatternLayout("TxUCMCollector: %-3c{2}:%-5p - %m%n"));
00198 appender->setName(_T("TxUCMCollectorAppender"));
00199 log->addAppender(appender);
00200 }
00201
00202 }
00203
00204 TxUCMCollector::~TxUCMCollector ()
00205 {
00206 closeConnection();
00207 }
00208
00212 boolean endsWith (std::string str, const char *suffix)
00213 {
00214 return StringHelper::endsWith(str, _T(suffix));
00215 }
00216
00220 static string trim (std::string str)
00221 {
00222 return StringHelper::trim(str);
00223 }
00224
00232 static vector<std::string> split(const std::string &str, const std::string &sep)
00233 {
00234 vector<std::string> splits;
00235 size_t posOld = 0;
00236 size_t posNew = 0;
00237 while ((posNew = str.find(sep,posOld)) != string::npos)
00238 {
00239 splits.push_back(str.substr(posOld,posNew-posOld));
00240 posOld=posNew+sep.size();
00241 }
00242
00243 if (posOld < str.size()) splits.push_back(str.substr(posOld,string::npos));
00244
00245 return splits;
00246 }
00247
00248 boolean TxUCMCollector::initDb () {
00249 boolean success = false;
00250 TRY
00251 {
00252 log->debug (" TxUCMCollector::initDb . . . ");
00253 success = this->init ();
00254 success = success & this->loadDatabase ();
00255 }
00256
00257
00258
00259
00260
00261
00262 if (!success) {
00263 log->error("Failed to initialize, review log file");
00264 TRY {
00265 exit (1);
00266 }
00267
00268
00269
00270 }
00271 return success;
00272 }
00273
00279
00280 boolean TxUCMCollector::init ()
00281
00282 {
00283 boolean success = false;
00284 #if 0
00285 Properties properties = new Properties();
00286 TRY {
00287 properties.load (new FileInputStream ("txucmcollector.properties"));
00288
00289
00290 dbName = properties.getProperty ("db.name");
00291 dbUrl = "jdbc:mysql://" + properties.getProperty ("db.host") + ":"
00292 + properties.getProperty ("db.port") + "/" + dbName;
00293 dbUsername = properties.getProperty ("db.username");
00294 dbPassword = properties.getProperty ("db.password");
00295
00296
00297
00298 logsDir = properties.getProperty ("logs.dir");
00299 sleepTime = (new Long (properties.getProperty ("sleep.time.sec"))).longValue ();
00300
00301 success = true;
00302 }
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313 #else
00314 dbName = "logger";
00315 dbUrl = "heston.star.bnl.gov";
00316 dbUsername = "StarLogger";
00317 dbPassword = "logger";
00318 #endif
00319 return success=true;
00320 }
00321
00322
00328
00329 boolean TxUCMCollector::loadDatabase()
00330
00331
00332 {
00333 boolean success = false;
00334
00335 TRY {
00336 log->debug ("dbName: " + dbName);
00337 log->debug ("dbUrl: " + dbUrl);
00338
00339 connection = getConnection (dbUrl.c_str(), dbUsername.c_str(), dbPassword.c_str());
00340 log->debug ("Successfully loaded database: dbName = " + dbName);
00341
00342 success = true;
00343 }
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361 return success;
00362 }
00363
00369
00370 void TxUCMCollector::startProcess () {
00371 TRY {
00372 #ifdef FUTURE
00373 while (true) {
00374
00375 setCurrLogFile ();
00376
00377
00378 processLogFile ();
00379
00380
00381
00382 File file = new File (currLogFile);
00383 if ((Calendar.getInstance ().getTimeInMillis () - file.lastModified ())
00384 >= (24 * 60 * 60 * 1000)) {
00385 file.renameTo (new File (currLogFile + ".archive"));
00386 }
00387
00388
00389
00390 else {
00391 Properties properties = new Properties();
00392 TRY {
00393 properties.setProperty (statusFileName, currLogFile);
00394 properties.setProperty (statusFileModTime,
00395 new Long (file.lastModified ()).toString ());
00396 properties.setProperty (statusFilePos,
00397 new Long (currLogFilePos).toString ());
00398 properties.store (new FileOutputStream (statusFile), null);
00399
00400
00401 currLogFilePos = 0;
00402 } CATCH (IOException ioe) {
00403 log->error ("Failed to write current file info to <" +
00404 statusFile + ">");
00405 log->error (ioe.getMessage ());
00406 }
00407 }
00408 }
00409 #endif
00410 }
00411
00412
00413
00414
00415
00416 }
00417
00418
00434
00435 void TxUCMCollector::setCurrLogFile () {
00436 TRY {
00437 #ifdef FUTURE
00438
00439
00440
00441
00442
00443
00444 if (new File (statusFile).exists ()) {
00445 Properties properties = new Properties();
00446 properties.load (new FileInputStream (statusFile));
00447
00448 currLogFile = properties.getProperty (statusFileName);
00449 if (currLogFile != null) {
00450 const char * strTime = properties.getProperty (statusFileModTime);
00451 long longTime = (new Long (strTime)).longValue ();
00452 currLogFilePos =
00453 (new Long (properties.getProperty (statusFilePos))).longValue ();
00454
00455
00456 if (new File (currLogFile).exists ()) {
00457 while (true) {
00458 if (new File (currLogFile).lastModified () == longTime) {
00459 System.out.println ("Waiting for " + currLogFile + " to be updated...");
00460 log->info ("Waiting for " + currLogFile + " to be updated...");
00461 Thread.sleep (sleepTime * 1000);
00462 }
00463 else {
00464 break;
00465 }
00466 }
00467 }
00468
00469 else {
00470 new File (statusFile).delete ();
00471 }
00472 }
00473 }
00474
00475
00476
00477
00478 currLogFile = "";
00479 currLogFilePos = 0;
00480 File logFileDir = new File (logsDir);
00481
00482 while (true) {
00483 FilenameFilter filter = new FilenameFilter() {
00484 boolean accept (File file, const char * name) {
00485 return name.endsWith (".log");
00486 }
00487 };
00488
00489 File[] logFiles = logFileDir.listFiles (filter);
00490
00491 System.out.println ("Found " + logFiles.length + " log files in " + logsDir);
00492 log->info ("Found " + logFiles.length + " log files in " + logsDir);
00493
00494
00495
00496 if (logFiles.length > 0) {
00497 File file = logFiles [0];
00498 for (int i = 1; i < logFiles.length; i++) {
00499 if (file.lastModified () > logFiles [i].lastModified ()) {
00500 file = logFiles [i];
00501 }
00502 }
00503
00504
00505 currLogFile = file.toString ();
00506 break;
00507 }
00508
00509
00510 else {
00511 System.out.println ("Waiting for new log files in " + logsDir);
00512 log->info ("Waiting for new log files in " + logsDir);
00513 Thread.sleep (sleepTime * 1000);
00514 }
00515 }
00516 #endif
00517 }
00518
00519
00520
00521
00522
00523
00524 }
00525
00531
00532 void TxUCMCollector::processLogFile () {
00533 TRY {
00534 #ifdef FUTURE
00535 System.out.println ("processing " + currLogFile);
00536
00537 BufferedReader in = new BufferedReader (new FileReader (currLogFile));
00538 const char * str;
00539
00540
00541 for (int i = 0; i < currLogFilePos; i++) {
00542 in.readLine ();
00543 }
00544
00545 while ((str = in.readLine()) != null) {
00546 processMessage (str);
00547 currLogFilePos ++;
00548 }
00549 in.close();
00550 #endif
00551 }
00552
00553
00554
00555
00556
00557 }
00558
00559
00567
00568 void TxUCMCollector::processMessage (const string &msg)
00569 { processMessage(msg.c_str()); }
00570
00571
00572 void TxUCMCollector::processMessage (const char * msg) {
00573
00574
00575
00576
00577
00578
00579 msgHashMap.clear();
00580 vector<std::string> keysNVals;
00581 std::string message = msg;
00582 size_t hdrDelimIndex = message.find(':');
00583 if (hdrDelimIndex != string::npos && hdrDelimIndex < message.find("=\"")) {
00584 keysNVals = split(message.substr(hdrDelimIndex + 1),"\" ");
00585 } else {
00586
00587
00588
00589 keysNVals = split(message,"\" ");
00590 }
00591
00592 log->debug(_T("TxUCMCollector::processMessage: ")+ message);
00593 for (size_t i = 0; i < keysNVals.size(); i++) {
00594
00595
00596 vector<std::string> keyNVal = split(keysNVals [i],"=\"");
00597
00598
00599 std::string value = (keyNVal.size() == 2)
00600 ? trim(keyNVal [1])
00601 : " ";
00602
00603
00604 value = endsWith(value,"\"")
00605 ? value.substr (0, value.size() - 1)
00606 : value;
00607
00608 msgHashMap.insert(pair<std::string,std::string>(trim(keyNVal [0]), value));
00609 log->debug(string("next pair: ") + trim(keyNVal [0]) + "<" + value + ">");
00610 }
00611
00612
00613
00614 std::string keyVal = msgHashMap[string(fgKey)];
00615 if (keyVal.empty()) {
00616 char buffer[20];
00617 sprintf(buffer,"%d",(int)keysNVals.size());
00618 log->error (string("Wrong message format: \"")
00619 + message
00620 + "\" par:"
00621 + buffer
00622 + "does not contains any <"
00623 + fgKey
00624 + ">");
00625
00626 return;
00627 }
00628
00629
00630
00631
00632 if (keyVal == fgNewTask ) this->createNewTask ();
00633
00634
00635
00636 else if (keyVal == fgUpdateTask) this->updateTask ();
00637
00638
00639
00640 else if (keyVal == fgAddJob) this->addJob ();
00641
00642
00643
00644 else if (keyVal == fgUpdateJob) this->updateJob ();
00645
00646
00647
00648 else if (keyVal == fgSiteLocation) this->setJobsField ("siteLocation");
00649
00650
00651
00652 else if (keyVal == fgStateID) this->setJobsField ("stateID");
00653
00654
00655
00656 else if (keyVal == fgGridJobID) this->setJobsField ("gridJobID");
00657
00658
00659
00660
00661
00662 else this->addEvent ();
00663 }
00664
00665
00671
00672 void TxUCMCollector::createNewTask () {
00673 string newTaskKeys = "brokerTaskID, requesterID";
00674 string newTaskVals = "'" + msgHashMap[fgBTaskID] + "'" +
00675 ", '" + msgHashMap[fgRequester] + "'";
00676
00677
00678 if (!this->recordExists (string("brokerTaskID = \"") + msgHashMap[fgBTaskID] + "\"",
00679 "Tasks")) {
00680 vector <string> newTask = split(msgHashMap[fgValue],"', ");
00681 for (size_t i = 0; i < newTask.size(); i++) {
00682 vector <string> taskKeyNVal = split(newTask [i],"='");
00683 if (taskKeyNVal.size() == 2) {
00684 newTaskKeys += ", " + trim(taskKeyNVal [0]);
00685
00686 newTaskVals += ", '";
00687 newTaskVals += endsWith (trim(taskKeyNVal [1]),"'")
00688 ? taskKeyNVal [1].substr (0, taskKeyNVal[1].size()-1)
00689 : trim(taskKeyNVal [1]);
00690 newTaskVals += "'";
00691 }
00692 }
00693 insertRecord (string("(") + newTaskKeys + ") VALUES (" + newTaskVals + ")",
00694 "Tasks");
00695
00696 this->createJobsTable ();
00697 this->createEventsTable ();
00698 }
00699 else {
00700 log->debug (string("Record with brokerTaskID = ") + msgHashMap[fgBTaskID] +
00701 " already exists");
00702
00703 }
00704 }
00710
00711 void TxUCMCollector::updateTask () {
00712
00713
00714 if (this->recordExists (string("brokerTaskID = \"") + msgHashMap[fgBTaskID] + "\"",
00715 "Tasks")) {
00716 updateRecord (msgHashMap[fgValue],
00717 "Tasks",
00718 string("brokerTaskID = '") + msgHashMap[fgBTaskID] + "'");
00719 }
00720 else {
00721 log->error (string("Record with brokerTaskID = ") + msgHashMap[fgBTaskID] +
00722 " does not exist, so creating a new record instead of updating");
00723 this->createNewTask ();
00724
00725 if (this->recordExists (string("brokerTaskID = \"") + msgHashMap[fgBTaskID] + "\"",
00726 "Tasks")) {
00727 updateRecord (msgHashMap[fgValue],
00728 "Tasks",
00729 string("brokerTaskID = '") + msgHashMap[fgBTaskID] + "'");
00730 }
00731 }
00732 }
00733
00740
00741 void TxUCMCollector::addJob () {
00742
00743
00744
00745 if (!this->recordExists (string("brokerTaskID = \"") + msgHashMap[fgBTaskID] + "\"",
00746 "Tasks")) {
00747 log->info (msgHashMap[fgBTaskID]
00748 + " does not exist in Tasks table");
00749 insertRecord (string("(brokerTaskID, requesterID) VALUES ") +
00750 "('" + msgHashMap[fgBTaskID] + "', " +
00751 "'" + msgHashMap[fgRequester] + "')",
00752 "Tasks");
00753 }
00754
00755 this->createJobsTable ();
00756 this->createEventsTable ();
00757
00758
00759 if (!this->recordExists (string("brokerJobID = \"") + msgHashMap[fgBJobID] + "\"",
00760 jobTableName())) {
00761
00762 std::string newJobKeys = "taskID, brokerJobID";
00763 std::string newJobVals = string("(SELECT taskID FROM Tasks WHERE brokerTaskID=") +
00764 "'" + msgHashMap[fgBTaskID] + "')" +
00765 ", '" + msgHashMap[fgBJobID] + "'";
00766
00767 vector<std::string> newJob = split(msgHashMap[fgValue],"', ");
00768
00769 for (size_t i = 0; i < newJob.size(); i++) {
00770 vector<std::string> jobKeyNVal = split(newJob [i],"='");
00771 if (jobKeyNVal.size() == 2) {
00772 newJobKeys += ", " + trim(jobKeyNVal [0]);
00773
00774 newJobVals += ", '";
00775 newJobVals += endsWith(trim(jobKeyNVal [1]),"'")
00776 ? jobKeyNVal [1].substr (0, jobKeyNVal.size() - 1)
00777 : trim(jobKeyNVal [1]);
00778 newJobVals += "'";
00779 }
00780 }
00781
00782 insertRecord (string("(") + newJobKeys + ") VALUES (" + newJobVals + ")",
00783 jobTableName());
00784 } else {
00785 log->debug ("Record with brokerJobID = " + msgHashMap[fgBJobID] +
00786 " already exists");
00787 }
00788 }
00789
00790
00791 string TxUCMCollector::tableNamePrefix(const char *prefix) const
00792 {
00793 string fullTableName =
00794 string(prefix)
00795 + string("_") + msgHashMap.find(fgRequester)->second
00796 + string("_") + msgHashMap.find(fgBTaskID)->second;
00797 ((TxUCMCollector*) this)->log->debug(string(__FUNCTION__)+ "<" + fullTableName + ">");
00798 return fullTableName;
00799 }
00800
00801
00802 string TxUCMCollector::jobTableName() const
00803 {
00804 return tableNamePrefix("Jobs");
00805 }
00806
00807 std::string TxUCMCollector::eventTableName() const
00808 {
00809 return tableNamePrefix("Events");
00810 }
00811
00817
00818 void TxUCMCollector::updateJob () {
00819
00820
00821 if (this->recordExists (string("brokerJobID = \"") + msgHashMap[fgBJobID] + "\"",
00822 jobTableName() ) ) {
00823 updateRecord ( msgHashMap[fgValue], jobTableName(),
00824 "brokerJobID = '" + msgHashMap[fgBJobID] + "'");
00825 } else {
00826 log->debug ("Record with brokerJobID = " + msgHashMap[fgBJobID] +
00827 " does not exist, so creating a new record instead of updating");
00828 this->addJob ();
00829 }
00830 }
00831
00836 void TxUCMCollector::setJobsField (const string &fieldName) {
00837 setJobsField (fieldName.c_str());
00838 }
00839
00840 void TxUCMCollector::setJobsField (const char * fieldName) {
00841 if (this->recordExists (string("brokerJobID = \"") + msgHashMap[fgBJobID] + "\"",
00842 jobTableName() )) {
00843 updateRecord (string(fieldName) + " = '" + msgHashMap[fgValue] + "'",
00844 jobTableName() ,
00845 "brokerJobID = '" + msgHashMap[fgBJobID] + "'");
00846 } else {
00847 log->error (string("Record with brokerJobID = ") + msgHashMap[fgBJobID] +
00848 " does not exist, so creating a new record instead of updating");
00849 }
00850 }
00851
00858
00859 void TxUCMCollector::addEvent () {
00860
00861
00862
00863 if (!this->recordExists (string("brokerTaskID = \"") + msgHashMap[fgBTaskID] + "\"",
00864 "Tasks")) {
00865 log->info (msgHashMap[fgBTaskID]
00866 + " does not exist in Tasks table");
00867 insertRecord (string("(brokerTaskID, requesterID) VALUES ") +
00868 "('" + msgHashMap[fgBTaskID] + "', " +
00869 "'" + msgHashMap[fgRequester] + "')",
00870 "Tasks");
00871 }
00872
00873
00874 this->createJobsTable ();
00875 this->createEventsTable ();
00876
00877
00878
00879
00880 if (!this->recordExists (string("brokerJobID = \"") + msgHashMap[fgBJobID] + "\"",
00881 jobTableName())) {
00882
00883 log->info (msgHashMap[fgBTaskID]
00884 + " does not exist in Jobs table");
00885
00886 std::string newJobKeys = "taskID, brokerJobID";
00887 std::string newJobVals = string("(SELECT taskID FROM Tasks WHERE brokerTaskID=")
00888 + "'" + msgHashMap[fgBTaskID] + "')"
00889 + ", '" + msgHashMap[fgBJobID] + "'";
00890
00891 insertRecord (string("(taskID, brokerJobID) VALUES ") +
00892 "((SELECT taskID FROM Tasks WHERE brokerTaskID=" +
00893 "'" + msgHashMap[fgBTaskID] + "')" +
00894 ", '" + msgHashMap[fgBJobID] + "')",
00895 jobTableName());
00896 }
00897
00898
00899
00900 std::string newEventKeys = "jobID, levelID, context, time, stageID, messageKey, messageValue";
00901 std::string newEventVals = string("(SELECT jobID FROM `") + jobTableName() + "` WHERE brokerJobID=" +
00902 "'" + msgHashMap[fgBJobID] + "')" +
00903 ", '" + msgHashMap[fgLevel] + "'" +
00904 ", '" + msgHashMap[fgContext] + "'" +
00905 ", '" + msgHashMap[fgTs] + "'" +
00906 ", '" + msgHashMap[fgStage] + "'" +
00907 ", '" + msgHashMap[fgKey] + "'" +
00908 ", '" + msgHashMap[fgValue] + "'";
00909
00910 insertRecord (string("(") + newEventKeys + ") VALUES (" + newEventVals + ")",
00911 eventTableName());
00912 static string FAILED_JOB_ATTRIBUTE;
00913 if ( FAILED_JOB_ATTRIBUTE.empty() ) {
00914 stringstream oss(FAILED_JOB_ATTRIBUTE);
00915 oss << TxEventLog::FAILED;
00916 }
00917 static string DONE_JOB_ATTRIBUTE;
00918 if ( DONE_JOB_ATTRIBUTE.empty() ) {
00919 stringstream oss(DONE_JOB_ATTRIBUTE);
00920 oss << TxEventLog::DONE;
00921 }
00922 if (msgHashMap[fgStage] == FAILED_JOB_ATTRIBUTE || msgHashMap[fgStage] == DONE_JOB_ATTRIBUTE ) {
00923 updateRecord ("taskRemainSize=taskRemainSize-1"
00924 , "Task"
00925 , string("brokerTaskID=") + "'" + msgHashMap[fgBTaskID] + "'" );
00926 }
00927 }
00928
00932
00933 void TxUCMCollector::createJobsTable () {
00934
00935 std::string tableName = "`" + jobTableName() + "` ";
00936 this->createTable (tableName , std::string("jobspattern"));
00937
00938 }
00939
00943
00944 void TxUCMCollector::createEventsTable () {
00945
00946 std::string tableName = "`" + eventTableName() + "` ";
00947 this->createTable (tableName, std::string("eventspattern"));
00948
00949 }
00950
00958 void TxUCMCollector::insertRecord (const string &insertStr, const string &tableName)
00959 {
00960 insertRecord(insertStr.c_str(),tableName.c_str());
00961 }
00962
00963 void TxUCMCollector::insertRecord (const char * insertStr, const char * tableName) {
00964 TRY{
00965
00966 if (!execute(string("INSERT INTO `") + tableName + "` " + insertStr))
00967 log->debug (string("Created new record for ") + tableName + ": " + insertStr);
00968 else
00969 log->error (string(mysql_error(connection)) + " the new record for " + tableName + ": " + insertStr);
00970 closeConnection();
00971 }
00972
00973
00974
00975 }
00976
00985
00986 void TxUCMCollector::updateRecord (const string&updateStr, const string&tableName, const string&condition)
00987 {
00988 updateRecord (updateStr.c_str(), tableName.c_str(), condition.c_str());
00989 }
00990
00991 void TxUCMCollector::updateRecord (const char * updateStr, const char * tableName, const char * condition)
00992 {
00993 TRY{
00994
00995 if (!execute(string("UPDATE `") + tableName
00996 + "` SET " + updateStr
00997 + " WHERE " + condition))
00998 log->debug(string("Updated new record for ") + tableName + " with values: " + updateStr);
00999 closeConnection();
01000 }
01001
01002
01003
01004 }
01005
01012
01013 boolean TxUCMCollector::recordExists (const string&selectStr, const string&tableName)
01014 {
01015 return
01016 recordExists (selectStr.c_str(),tableName.c_str());
01017 }
01018
01019
01020 boolean TxUCMCollector::recordExists (const char * selectStr, const char * tableName) {
01021 unsigned long nRows = 0;
01022 TRY
01023 {
01024 execute(string("SELECT * FROM `") + tableName
01025 + "` WHERE " + selectStr);
01026 if (fResult) {
01027 nRows = mysql_num_rows(fResult);
01028 }
01029 }
01030 closeConnection();
01031
01032
01033
01034
01035
01036 return nRows ? true: false;
01037 }
01038
01039
01046 void TxUCMCollector::createTable (const string&table,const string&like)
01047 {
01048 const char *likestr = like.empty() ? 0 : like.c_str();
01049 createTable (table.c_str(), likestr);
01050 }
01051
01052
01053 void TxUCMCollector::createTable (const char * table, const char *like) {
01054 TRY{
01055 std::string query = string("CREATE TABLE IF NOT EXISTS ") + table;
01056 if (like && like[0]) query += std::string(" LIKE `") + like + "`";
01057 if (!execute(query))
01058 log->debug (string("Created new table: ") + table);
01059 }
01060 closeConnection();
01061
01062
01063
01064 }
01065
01071
01072 void TxUCMCollector::usage (Options options)
01073 {
01074 #ifdef FUTURE
01075
01076 HelpFormatter formatter = new HelpFormatter ();
01077 formatter.printHelp ("Tx UCM Collector", options);
01078 #endif
01079 }
01080
01081
01082 StUcmTasks *TxUCMCollector::getTaskList(int limit, int offset)
01083 {
01084 static StUcmTasks tasks;
01085 fillTaskList(tasks,limit,offset);
01086 return &tasks;
01087 }
01088
01089
01090 StUcmJobs *TxUCMCollector::getJobList(StRecord *task, int limit, int offset)
01091 {
01092 static StUcmJobs jobs;
01093 fillJobList(jobs,limit,offset,task);
01094 return &jobs;
01095 }
01096
01097 int TxUCMCollector::getJobId(const char *reqName, const char *taskBrokerID, int brokerJobID)
01098 {
01099 int id = -1;
01100 setRequesterName(reqName);
01101 setBrokerTaskID (taskBrokerID);
01102 setBrokerJobID (brokerJobID);
01103 try {
01104 string where = string(" brokerJobID='") + itoa(brokerJobID) + "' ";
01105 queryTable(jobTableName().c_str(),0,0,where.c_str());
01106 if (fResult) {
01107 int nRows = mysql_num_rows(fResult) ;
01108 if (nRows<=0 || nRows >1 ) {
01109 log->error(string("Can not fetch the job id for the ") + taskBrokerID + " broker id=" + itoa(brokerJobID) + " nrow=" + itoa(nRows));
01110 } else {
01111 StRecord *job = new StRecord;
01112 fillFields(job->getFields());
01113 id = job->getField("jobID")->toInt();
01114 }
01115 }
01116 } catch (const StDataException &e) {
01117 log->error(e.getDescription() );
01118 }
01119
01120 setDbJobID(id);
01121 return id;
01122 }
01123
01124
01125 StUcmEvents *TxUCMCollector::getEventList(StRecord *job,int limit, int offset)
01126 {
01127 static StUcmEvents events;
01128 fillEventList(events,limit,offset);
01129 return &events;
01130 }
01131
01132
01133 int TxUCMCollector::fillTaskList(StUcmTasks &tasks, int limit, int offset)
01134 {
01135 RecordList &l = tasks.getTasks();
01136 return fillUcmList("Tasks",l,limit,offset);
01137 }
01138
01139
01140 int TxUCMCollector::fillUcmList(const char *type, RecordList &records, int limit, int offset)
01141 {
01142 my_ulonglong nRows = 0;
01143 records.Clear();
01144 try {
01145 if (string(type) == "Tasks") {
01146 queryTaskTable(limit,offset);
01147 } else if (string(type) == "Jobs" ) {
01148 queryJobTable(limit,offset);
01149 } else if (string(type) == "Events" ) {
01150 queryEventTable(limit,offset);
01151 } else {
01152 queryTable(type,limit,offset);
01153 }
01154 if (fResult) {
01155 nRows = mysql_num_rows(fResult) ;
01156 log->debug(string(itoa(nRows)) + " rows from " + itoa(offset) + " row" );
01157 for (my_ulonglong i=0; i<nRows;++i)
01158 {
01159 StRecord *task = new StRecord;
01160 fillFields(task->getFields());
01161 records.push_back(task);
01162 }
01163 }
01164 } catch (const StDataException &e) {
01165 log->error(e.getDescription() );
01166 }
01167 return nRows;
01168 }
01169
01170
01171 int TxUCMCollector::fillJobList(StUcmJobs &jobs, int limit, int offset)
01172 {
01173 RecordList &l = jobs.getJobs();
01174 return fillUcmList("Jobs",l,limit,offset);
01175 }
01176
01177
01178 void TxUCMCollector::setBrokerTaskID(const StRecord *task)
01179 {
01180 const char *requestId = 0;
01181 if (task) {
01182 requestId = task->getField("brokerTaskID")->getValueAsString();
01183 setBrokerTaskID(requestId);
01184 }
01185 }
01186
01187
01188 void TxUCMCollector::setBrokerJobID(const StRecord *job)
01189 {
01190 if (job) {
01191 int brokerJobID = job->getField("brokerJobID")->toInt();
01192 setBrokerJobID(brokerJobID);
01193 int jobID = job->getField("jobID")->toInt();
01194 setDbJobID(jobID);
01195 }
01196 }
01197
01198 int TxUCMCollector::fillJobList(StUcmJobs &jobs, int limit, int offset,const StRecord *task)
01199 {
01200 int row = 0;
01201 RecordList &l = jobs.getJobs();
01202 setBrokerTaskID(task);
01203 row = fillUcmList("Jobs",l,limit,offset);
01204
01205
01206
01207 return row;
01208 }
01209
01210
01211
01212 int TxUCMCollector::fillEventList(StUcmEvents &events, int limit, int offset,const StRecord *job)
01213 {
01214 RecordList &l = events.getEvents();
01215 if (job) setBrokerJobID (job);
01216 return fillUcmList("Events",l,limit,offset);
01217 }
01218
01219
01220 void TxUCMCollector::fillFields(FieldList &fields)
01221 {
01222 fRow = mysql_fetch_row(fResult);
01223 if (fRow) {
01224 fField = mysql_fetch_fields(fResult);
01225 unsigned int n_fields = mysql_num_fields(fResult);
01226 log->debug(string("Fetching ") + itoa(n_fields) + " fields ");
01227 for (unsigned int i=0;i<n_fields; ++i)
01228 {
01229 fields.push_back(createField(i));
01230 }
01231 } else {
01232 log->error(mysql_error(connection));
01233 }
01234 }
01235
01236 StDbFieldI::EDataType TxUCMCollector::MapSqlField(enum_field_types type)
01237 {
01238 StDbFieldI::EDataType ucmType = StDbFieldI::kINVALID;
01239 switch (type) {
01240 case MYSQL_TYPE_TINY: case MYSQL_TYPE_SHORT:case MYSQL_TYPE_LONG:
01241 ucmType =StDbFieldI::kINT;
01242 break;
01243 case MYSQL_TYPE_TIMESTAMP: case MYSQL_TYPE_DATE: case MYSQL_TYPE_TIME:
01244 case MYSQL_TYPE_DATETIME: case MYSQL_TYPE_YEAR:
01245 ucmType = StDbFieldI::kUNIXTIME;
01246 break;
01247 #if 0
01248 case ucmType =StDbFieldI::kLONG; break;
01249 case ucmType =StDbFieldI::kULONG; break;
01250 case ucmType =StDbFieldI::kDOUBLE; break;
01251 #endif
01252 case MYSQL_TYPE_STRING: case MYSQL_TYPE_VAR_STRING:
01253 ucmType =StDbFieldI::kCHAR; break;
01254
01255 default: break;
01256 }
01257 return ucmType;
01258 }
01259
01260
01261 StDbFieldI *TxUCMCollector::createField(unsigned int fieldIndx)
01262 {
01263 StDbFieldI *field = new StDbFieldI(fField[fieldIndx].org_name, fRow[fieldIndx],MapSqlField(fField[fieldIndx].type),1);
01264 return field;
01265 }
01266
01267
01272 void TxUCMCollector::printVersion(){
01273 log->info("Tx UCM Collector, version 0.4");
01274 }
01275
01276
01280 void TxUCMCollector::main(const char *args[]) {
01281 #ifdef FUTURE
01282 boolean debug = false;
01283 Option h = new Option ("h", "help", false, "print this message");
01284 Option v = new Option ("v", "version", false, "print the version information");
01285 Option d = new Option ("d", "debug", false, "set log level to debug");
01286 Option t = new Option ("t", "test", false, "run the setUpTest()");
01287 Option m = new Option ("m", "message", true, "parse one message and exit");
01288
01289
01290 Options options = new Options ();
01291 options.addOption (h);
01292 options.addOption (v);
01293 options.addOption (d);
01294 options.addOption (t);
01295 options.addOption (m);
01296
01297 CommandLineParser parser = new PosixParser();
01298 CommandLine cmd;
01299 const char * jobMessage=null;
01300 TRY{
01301 cmd = parser.parse (options, args);
01302 }
01303 CATCH (ParseException pe) {
01304 System.out.println ("** Error ** : Check your input parametres:");
01305 usage (options);
01306 return;
01307 }
01308
01309 if (cmd.hasOption ("m")) {
01310
01311 jobMessage = cmd.getOptionValue("m");
01312 if (jobMessage.isEmpty () ) {
01313 System.out.println ("Error: no message has been provided");
01314 usage (options);
01315 return;
01316 }
01317 const char * jobMessagesArgs[] = cmd.getArgs() ;
01318 int n = 0;
01319 for (n=0; n < jobMessagesArgs.length; n++)
01320 jobMessage += " " + jobMessagesArgs[n] ;
01321 }
01322 if (cmd.hasOption ("h")) {
01323 usage (options);
01324 return;
01325 }
01326
01327 if (cmd.hasOption ("v")) {
01328 printVersion ();
01329 return;
01330 }
01331
01332 if (cmd.hasOption ("d") ){
01333
01334 debug = true;
01335 if (debug) {
01336 System.out.println("option:debug");
01337 }
01338 }
01339
01340
01341 TxUCMCollector collector = new TxUCMCollector ();
01342 if (collector.initDb() ) {
01343 if (jobMessage == null ) {
01344
01345 collector.startProcess ();
01346 } else {
01347 collector.processMessage(jobMessage);
01348 }
01349 }
01350 if (debug) {
01351 System.out.println ("created collector object");
01352 }
01353 #endif
01354 }
01355
01356 const char * TxUCMCollector::fgTaskCols = "('taskID', 'brokerTaskID', 'brokerID', "
01357 "'requesterID', 'taskName', 'taskDescription', 'taskSize', "
01358 "'taskRemainSize', 'submitTime', 'updateTime', 'archiveFlag')";
01359
01360
01361 const char *TxUCMCollector::fgJobsTableCols =
01362 "("
01363 "jobID int(11) NOT NULL AUTO_INCREMENT KEY COMMENT 'ID of job when entry is created, unique within table', "
01364 "updateTime timestamp NOT NULL default CURRENT_TIMESTAMP COMMENT 'Time that job execution state was last updated', "
01365 "brokerJobID int(11) NOT NULL COMMENT 'ID of job as assigned by Broker', "
01366 "taskID int(11) NOT NULL COMMENT 'Foreign key reference to Tasks table', "
01367 "gridJobID varchar(64) default NULL COMMENT 'ID for job as assigned by Grid Resource Allocation Manager (GRAM)', "
01368 "localJobID int(11) default NULL COMMENT 'ID for job as assigned by local resource manager or scheduler', "
01369 "gridSubmitTime datetime default NULL COMMENT 'Time that job was submitted to the GRAM', "
01370 "localSubmitTime datetime default NULL COMMENT 'Time that job was submitted to the local resource manager or scheduler', "
01371 "siteLocation varchar(64) default NULL COMMENT 'Physical local of job, could be grid site or local cluster description', "
01372 "queue varchar(64) default NULL COMMENT 'Name and short description of queue that shedules job', "
01373 "queuePosition int(11) default NULL COMMENT 'Integer slot position of job in local resource manager or scheduler', "
01374 "nodeLocation varchar(64) default NULL COMMENT 'Name of worker node that job lands on', "
01375 "startTime datetime default NULL COMMENT 'Time that job started execution', "
01376 "executionUserName varchar(32) default NULL COMMENT 'A login ID on the local resource site & worker node that actually executes', "
01377 "stateID int(11) NOT NULL default '1' COMMENT 'Foreign key reference to StateDictionary table', "
01378 "CONSTRAINT UNIQUE INDEX jobID (brokerJobID, taskID)"
01379 ")";
01380
01381
01382 const char * TxUCMCollector::fgJobCols = "('jobID', 'brokerJobID', 'taskID', "
01383 "'gridJobID', 'localJobID', 'gridSubmitTime', "
01384 "'localSubmitTime', 'siteLocation', 'queue', 'queuePosition', "
01385 "'nodeLocation', 'startTime', 'executionUserName', 'stateID')";
01386
01387
01388
01389 const char * TxUCMCollector::fgEventsTableCols =
01390 "("
01391 "eventID int(11) NOT NULL AUTO_INCREMENT KEY COMMENT 'ID of event when entry is created, unique within table', "
01392 "time timestamp NOT NULL default CURRENT_TIMESTAMP COMMENT 'Time that event was recorded by the Tracking Library', "
01393 "jobID int(11) NOT NULL COMMENT 'Job that this message is associated with', "
01394 "levelID int(11) NOT NULL COMMENT 'The ID of the log level of the event (WARNING, DEBUG, ERROR, etc.)', "
01395 "context VARCHAR(40) NOT NULL COMMENT 'The bulk category of the log event or the facilty or code where the event happens', "
01396 "stageID int(11) NOT NULL COMMENT 'The ID of the logging stage of the event (i.e., START, STATUS, or END)', "
01397 "messageKey VARCHAR(40) COMMENT 'A user defined property key or SYSTEM for system event', "
01398 "messageValue VARCHAR(120) COMMENT 'A user defined property value or textual content of a log message for a system event', "
01399 "cpuLoad double default NULL COMMENT 'Optional benchmarking value, program CPU load in %', "
01400 "totalMem int(11) default NULL COMMENT 'Optional benchmarking value, total system memory in KiB', "
01401 "usedMem int(11) default NULL COMMENT 'Optional benchmarking value, total used memory in KiB', "
01402 "appMem int(11) default NULL COMMENT 'Optional benchmarking value, total app memory in KiB', "
01403 "INDEX (jobID)"
01404 ")";
01405
01406
01407 const char * TxUCMCollector::fgEventCols = "('eventID', 'jobID', 'levelID', "
01408 "'context', 'time', 'stageID', 'messageKey', 'messageValue', "
01409 "'cpuLoad', 'totalMem', 'usedMem', 'appMem')";
01410
01411 int TxUCMCollector::queryTableSize(const char *tableName,const StRecord *where)
01412 {
01413 int size = 0;
01414 if(string(tableName) == "Jobs") {
01415 setBrokerTaskID(where);
01416 } else if (string(tableName) == "Events") {
01417 setBrokerJobID(where);
01418 }
01419 size = queryTableSize(tableName);
01420 return size;
01421 }
01422
01423 int TxUCMCollector::queryTableSize(const char *tableName, const char *where)
01424 {
01425 int size = 0;
01426 string whichTask;
01427 bool countSelectedEvents = false;
01428 if ( !where ) {
01429 if ((string(tableName) == "Tasks" ) && (msgHashMap.find(fgRequester) != msgHashMap.end())) {
01430 whichTask=string("requesterID='")+ msgHashMap[fgRequester]+"' ";
01431 where = whichTask.c_str();
01432 } else if (string(tableName) == "Jobs" ) {
01433 tableName = jobTableName().c_str();
01434 } else if (string(tableName) == "Events" ) {
01435 tableName = eventTableName().c_str();
01436 countSelectedEvents = (fDbJobID >= 0 );
01437 }
01438 }
01439 string query = string("select count(*) from `")+ tableName + "`";
01440 if (where &&where[0]) {
01441 query += string(" WHERE ") + where;
01442 } else if (countSelectedEvents) {
01443 query += string(" WHERE ") + string("jobID='")+ itoa(fDbJobID)+"' ";
01444 }
01445 execute (query);
01446 if (fResult) {
01447 if (mysql_num_rows(fResult)==1) {
01448 fRow = mysql_fetch_row(fResult);
01449 if (!fRow) {
01450 log->error(mysql_error(connection));
01451 } else {
01452 size = atoi(*fRow);
01453 }
01454 } else {
01455 log->error(string("wrong result for <") + query + ">");
01456 }
01457 }
01458 return size;
01459 }
01460
01461 void TxUCMCollector::queryTable(const char *tableName, int limit, int offset, const char *where)
01462 {
01463
01464 string query = string("select * from `") + tableName + "` ";
01465 if (where && where[0] ) {
01466 query += string("WHERE ") + where;
01467 }
01468 if (limit > 0) query += " LIMIT " + itoa(limit);
01469 if (offset > 0) {
01470 if(limit <= 0 ) query += "LIMIT 9999999 ";
01471 query += " OFFSET " + itoa(offset);
01472 }
01473 execute (query);
01474 }
01475
01476
01477 void TxUCMCollector::queryTaskTable(int limit, int offset)
01478 {
01479 string where=string(" requesterID='")+ msgHashMap[fgRequester]+"' ";
01480 where += string(" ORDER BY ") + "taskID" + " DESC ";
01481
01482 queryTable("Tasks",limit,offset,where.c_str());
01483 }
01484
01485 void TxUCMCollector::queryJobTable(int limit, int offset)
01486 {
01487 queryTable(jobTableName().c_str(),limit,offset);
01488 if (!fResult) {
01489 string where = " taskID=47948 ";
01490 queryTable("Jobs",limit,offset, where.c_str());
01491 }
01492 }
01493
01494
01495 void TxUCMCollector::queryJobTable(const char *taskID,int limit, int offset)
01496 {
01497 queryTable(jobTableName().c_str(),limit,offset);
01498 if (!fResult) {
01499 string where = string(" taskID='") + taskID + "' ";
01500 queryTable("Jobs",limit,offset, where.c_str());
01501 }
01502 }
01503
01504 void TxUCMCollector::queryEventTable(int limit, int offset)
01505 {
01506 string where=string("jobID='")+ itoa(fDbJobID)+"' ";
01507 queryTable(eventTableName().c_str(),limit,offset,where.c_str());
01508 if (!fResult) queryTable("Messages",limit,offset,where.c_str());
01509 }
01510
01511
01512 void TxUCMCollector::queryEventTable(const char *jobDbID, int limit, int offset)
01513 {
01514 string where=string(" jobID='")+ jobDbID+"' ";
01515 queryTable(eventTableName().c_str(),limit,offset,where.c_str());
01516 if (!fResult) queryTable("Messages",limit,offset,where.c_str());
01517 }
01518
01519
01520
01521
01522 void TxUCMCollector::writeDown(const std::string& message)
01523 {
01524
01525 }
01526
01527 void TxUCMCollector::setEnvBrokerTaskID (const std::string& envBrokerTaskID)
01528 {
01529 }
01530
01531
01532 void TxUCMCollector::setEnvBrokerJobID (const std::string& envBrokerJobID)
01533 {
01534 }
01535
01536
01537 void TxUCMCollector::setBrokerTaskID (const std::string& brokerTaskID)
01538 {
01539 msgHashMap[fgBTaskID] = brokerTaskID;
01540 }
01541
01542
01543 void TxUCMCollector::setBrokerJobID (int brokerJobID)
01544 {
01545 fBrokerJobID = brokerJobID;
01546 }
01547
01548
01549 void TxUCMCollector::setDbJobID (int dbJobID)
01550 {
01551 fDbJobID = dbJobID;
01552 }
01553
01554
01555 void TxUCMCollector::setRequesterName (const std::string& requester)
01556 {
01557 msgHashMap[fgRequester] = requester;
01558 }
01559
01560
01561 void TxUCMCollector::setContext (const std::string& context)
01562 {
01563 }
01564
01565
01566 void TxUCMCollector::logStart (const std::string& key, const std::string& value)
01567 {
01568 }
01569
01570
01571 void TxUCMCollector::logJobAttribute (const std::string& key , const std::string&value)
01572 {
01573
01574 }
01575
01576
01577 void TxUCMCollector::logJobSubmitLocation (const std::string&url)
01578 {
01579
01580 }
01581
01582
01583 void TxUCMCollector::setJobSubmitLocation (const std::string& url)
01584 {
01585
01586 }
01587
01588
01589 void TxUCMCollector::logTask (unsigned int size)
01590 {
01591 }
01592
01593
01594 void TxUCMCollector::logTask (const std::string& taskAttributes)
01595 {
01596 }
01597
01598
01599 void TxUCMCollector::logJobSubmitState (State state)
01600 {
01601 }
01602
01603
01604 void TxUCMCollector::setJobSubmitState (State state)
01605 {
01606 }
01607
01608 void TxUCMCollector::logJobSubmitID (const std::string& ID)
01609 {
01610 }
01611
01612 void TxUCMCollector::setJobSubmitID (const std::string& ID)
01613 {
01614 }
01615
01616 void TxUCMCollector::logEvent (const std::string& logMsg,
01617 Level level,Stage stage, const std::string& msgContext)
01618 {
01619 }
01620
01621 void TxUCMCollector::logEvent (const std::string& userKey,
01622 const std::string& userValue, Level level, Stage stage,
01623 const std::string& msgContext)
01624 {
01625 }
01626
01627 void TxUCMCollector::logEnd (const std::string& key, const std::string& value)
01628 {
01629 }
01630
01631 TXEVENT_DEFAULT_IMPLEMENTAION(TxUCMCollector)
01632