CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
cond::Logger Class Reference

#include <Logger.h>

Public Member Functions

void connect (const std::string &logConnectionString, bool readOnly=false)
 
void createLogDBIfNonExist ()
 
void logFailedOperationNow (const cond::UserLogInfo &userlogInfo, const std::string &destDB, const std::string &payloadToken, const std::string &payloadClass, const std::string &iovtag, const std::string &iovtimetype, unsigned int payloadIdx, unsigned long long lastSince, const std::string &exceptionMessage)
 
 Logger (DbSession &sessionHandle)
 
void logOperationNow (const cond::UserLogInfo &userlogInfo, const std::string &destDB, const std::string &payloadToken, const std::string &payloadClass, const std::string &iovtag, const std::string &iovtimetype, unsigned int payloadIdx, unsigned long long lastSince)
 
void LookupLastEntryByProvenance (const std::string &provenance, LogDBEntry &logentry, bool filterFailedOp=true) const
 
void LookupLastEntryByTag (const std::string &iovtag, LogDBEntry &logentry, bool filterFailedOp=true) const
 
void LookupLastEntryByTag (const std::string &iovtag, const std::string &connectionStr, LogDBEntry &logentry, bool filterFailedOp=true) const
 
 ~Logger ()
 

Private Member Functions

void insertLogRecord (unsigned long long logId, const std::string &utctime, const std::string &destDB, const std::string &payloadToken, const std::string &payloadClass, const cond::UserLogInfo &userLogInfo, const std::string &iovtag, const std::string &iovtimetype, unsigned int payloadIdx, unsigned long long lastSince, const std::string &exceptionMessage)
 

Private Attributes

bool m_locked
 
bool m_logTableExists
 
SequenceManagerm_sequenceManager
 
DbSession m_sessionHandle
 
coral::IQuery * m_statusEditorHandle
 

Detailed Description

Definition at line 25 of file Logger.h.

Constructor & Destructor Documentation

cond::Logger::Logger ( cond::DbSession sessionHandle)
explicit

Definition at line 33 of file Logger.cc.

33  :
34  m_sessionHandle(sessionHandle),
35  m_locked(false),
38  m_logTableExists(false){
39 }
SequenceManager * m_sequenceManager
Definition: Logger.h:107
bool m_locked
Definition: Logger.h:105
DbSession m_sessionHandle
Definition: Logger.h:103
coral::IQuery * m_statusEditorHandle
Definition: Logger.h:106
bool m_logTableExists
Definition: Logger.h:108
cond::Logger::~Logger ( )

Definition at line 340 of file Logger.cc.

340  {
341  if( m_sequenceManager ){
342  delete m_sequenceManager;
344  }
345 }
SequenceManager * m_sequenceManager
Definition: Logger.h:107

Member Function Documentation

void cond::Logger::connect ( const std::string &  logConnectionString,
bool  readOnly = false 
)

Definition at line 41 of file Logger.cc.

References cond::Auth::COND_READER_ROLE, cond::Auth::COND_WRITER_ROLE, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by Vispa.Gui.ZoomableScrollArea.ZoomableScrollArea::__init__(), Vispa.Views.PropertyView.BooleanProperty::__init__(), Vispa.Gui.FindDialog.FindDialog::_addScript(), Vispa.Gui.FindDialog.FindDialog::_addStringProperty(), Vispa.Main.Application.Application::_connectSignals(), Vispa.Plugins.ConfigEditor.CodeTableView.CodeTableView::_createItem(), Vispa.Gui.BoxContentDialog.BoxContentDialog::addButton(), Vispa.Gui.ToolBoxContainer.ToolBoxContainer::addWidget(), Vispa.Views.PropertyView.PropertyView::append(), Vispa.Views.PropertyView.PropertyView::appendAddRow(), Vispa.Main.Application.Application::createAction(), Vispa.Views.PropertyView.TextEditWithButtonProperty::createButton(), Vispa.Views.LineDecayView.LineDecayView::createLineDecayContainer(), Vispa.Views.PropertyView.TextEditWithButtonProperty::createLineEdit(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.PropertyView.TextEditWithButtonProperty::createTextEdit(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::filterDialog(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Gui.PortWidget.PortWidget::mouseMoveEvent(), Vispa.Views.PropertyView.BooleanProperty::setChecked(), Vispa.Main.SplitterTab.SplitterTab::setController(), Vispa.Plugins.Browser.BrowserTab.BrowserTab::setController(), Vispa.Views.PropertyView.BooleanProperty::setReadOnly(), Vispa.Views.PropertyView.DropDownProperty::setReadOnly(), Vispa.Views.PropertyView.TextEditWithButtonProperty::setReadOnly(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::setTab(), Vispa.Views.PropertyView.IntegerProperty::setValue(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView(), Vispa.Plugins.EdmBrowser.EdmBrowserTabController.EdmBrowserTabController::updateViewMenu(), and Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController::updateViewMenu().

41  {
43  if( readOnly ) role = Auth::COND_READER_ROLE;
44  m_sessionHandle.open( logConnectionString, role, readOnly );
45 }
void open(const std::string &connectionString, bool readOnly=false)
Definition: DbSession.cc:159
DbSession m_sessionHandle
Definition: Logger.h:103
static const std::string COND_WRITER_ROLE
Definition: Auth.h:18
static const std::string COND_READER_ROLE
Definition: Auth.h:19
void cond::Logger::createLogDBIfNonExist ( )

Definition at line 48 of file Logger.cc.

References cond::DbScopedTransaction::commit(), cond::SequenceManager::createSequencesTable(), idDealer::description, cond::SequenceManager::existSequencesTable(), cond::LogDBNames::LogTableName(), cond::LogDBNames::SequenceTableName(), cond::DbScopedTransaction::start(), and AlCaHLTBitMon_QueryRunRegistry::string.

48  {
49  if(m_logTableExists) return;
51  trans.start(false);
54  m_logTableExists=true;
55  trans.commit();
56  return;
57  }
58  //create sequence table
60  if( !sequenceGenerator.existSequencesTable() ){
61  sequenceGenerator.createSequencesTable();
62  }
63  //create log table
64  coral::TableDescription description( "CONDLOG" );
66  description.insertColumn(std::string("LOGID"),
67  coral::AttributeSpecification::typeNameForType<unsigned long long>() );
68  description.setPrimaryKey( std::vector<std::string>( 1, std::string("LOGID")));
69  description.insertColumn(std::string("EXECTIME"),
70  coral::AttributeSpecification::typeNameForType<std::string>() );
71  description.setNotNullConstraint(std::string("EXECTIME"));
72 
73  description.insertColumn(std::string("IOVTAG"),
74  coral::AttributeSpecification::typeNameForType<std::string>() );
75  description.setNotNullConstraint(std::string("IOVTAG"));
76 
77  description.insertColumn(std::string("IOVTIMETYPE"),
78  coral::AttributeSpecification::typeNameForType<std::string>() );
79  description.setNotNullConstraint(std::string("IOVTIMETYPE"));
80 
81  description.insertColumn(std::string("PAYLOADCLASS"),
82  coral::AttributeSpecification::typeNameForType<std::string>() );
83  description.setNotNullConstraint(std::string("PAYLOADCLASS"));
84 
85  description.insertColumn(std::string("PAYLOADTOKEN"),
86  coral::AttributeSpecification::typeNameForType<std::string>() );
87  description.setNotNullConstraint(std::string("PAYLOADTOKEN"));
88 
89  description.insertColumn(std::string("PAYLOADINDEX"),
90  coral::AttributeSpecification::typeNameForType<unsigned int>() );
91  description.setNotNullConstraint(std::string("PAYLOADINDEX"));
92 
93  description.insertColumn(std::string("LASTSINCE"),
94  coral::AttributeSpecification::typeNameForType<unsigned long long>() );
95  description.setNotNullConstraint(std::string("LASTSINCE"));
96 
97  description.insertColumn(std::string("DESTINATIONDB"),
98  coral::AttributeSpecification::typeNameForType<std::string>() );
99  description.setNotNullConstraint(std::string("DESTINATIONDB"));
100 
101  description.insertColumn(std::string("PROVENANCE"),
102  coral::AttributeSpecification::typeNameForType<std::string>() );
103  description.insertColumn(std::string("USERTEXT"),
104  coral::AttributeSpecification::typeNameForType<std::string>() );
105  description.insertColumn(std::string("EXECMESSAGE"),
106  coral::AttributeSpecification::typeNameForType<std::string>() );
107  m_sessionHandle.nominalSchema().createTable( description );
108  m_logTableExists=true;
109  trans.commit();
110 }
DbSession m_sessionHandle
Definition: Logger.h:103
tuple description
Definition: idDealer.py:66
static std::string SequenceTableName()
Definition: LogDBNames.cc:3
coral::ISchema & nominalSchema()
Definition: DbSession.cc:243
bool m_logTableExists
Definition: Logger.h:108
static std::string LogTableName()
Definition: LogDBNames.cc:7
void cond::Logger::insertLogRecord ( unsigned long long  logId,
const std::string &  utctime,
const std::string &  destDB,
const std::string &  payloadToken,
const std::string &  payloadClass,
const cond::UserLogInfo userLogInfo,
const std::string &  iovtag,
const std::string &  iovtimetype,
unsigned int  payloadIdx,
unsigned long long  lastSince,
const std::string &  exceptionMessage 
)
private

Definition at line 295 of file Logger.cc.

References cppFunctionSkipper::exception, edm::hlt::Exception, cond::LogDBNames::LogTableName(), cond::UserLogInfo::provenance, AlCaHLTBitMon_QueryRunRegistry::string, and cond::UserLogInfo::usertext.

305  {
306  try{
307  coral::AttributeList rowData;
308  rowData.extend<unsigned long long>("LOGID");
309  rowData.extend<std::string>("EXECTIME");
310  rowData.extend<std::string>("DESTINATIONDB");
311  rowData.extend<std::string>("PAYLOADCLASS");
312  rowData.extend<std::string>("PAYLOADTOKEN");
313  rowData.extend<std::string>("PROVENANCE");
314  rowData.extend<std::string>("USERTEXT");
315  rowData.extend<std::string>("IOVTAG");
316  rowData.extend<std::string>("IOVTIMETYPE");
317  rowData.extend<unsigned int>("PAYLOADINDEX");
318  rowData.extend<unsigned long long>("LASTSINCE");
319  rowData.extend<std::string>("EXECMESSAGE");
320  rowData["LOGID"].data< unsigned long long >() = logId;
321  rowData["EXECTIME"].data< std::string >() = utctime;
322  rowData["DESTINATIONDB"].data< std::string >() = destDB;
323  rowData["PAYLOADCLASS"].data< std::string >() = payloadClass;
324  std::string ptok = payloadToken;
325  if( payloadToken.empty() ) ptok = "NA";
326  rowData["PAYLOADTOKEN"].data< std::string >() = ptok;
327  rowData["PROVENANCE"].data< std::string >() = userLogInfo.provenance;
328  rowData["USERTEXT"].data< std::string >() = userLogInfo.usertext;
329  rowData["IOVTAG"].data< std::string >() = iovtag;
330  rowData["IOVTIMETYPE"].data< std::string >() = iovtimetype;
331  rowData["PAYLOADINDEX"].data< unsigned int >() = payloadIdx;
332  rowData["LASTSINCE"].data< unsigned long long >() = lastSince;
333  rowData["EXECMESSAGE"].data< std::string >() = exceptionMessage;
334  m_sessionHandle.nominalSchema().tableHandle(cond::LogDBNames::LogTableName()).dataEditor().insertRow(rowData);
335  }catch(const std::exception& er){
336  throw cond::Exception(std::string(er.what()));
337  }
338 }
std::string usertext
Definition: LogDBEntry.h:9
DbSession m_sessionHandle
Definition: Logger.h:103
std::string provenance
Definition: LogDBEntry.h:8
coral::ISchema & nominalSchema()
Definition: DbSession.cc:243
static std::string LogTableName()
Definition: LogDBNames.cc:7
void cond::Logger::logFailedOperationNow ( const cond::UserLogInfo userlogInfo,
const std::string &  destDB,
const std::string &  payloadToken,
const std::string &  payloadClass,
const std::string &  iovtag,
const std::string &  iovtimetype,
unsigned int  payloadIdx,
unsigned long long  lastSince,
const std::string &  exceptionMessage 
)

Definition at line 138 of file Logger.cc.

References cond::DbScopedTransaction::commit(), cond::LogDBNames::LogTableName(), cmsPerfSuiteHarvest::now, AlCaHLTBitMon_ParallelJobs::p, cond::LogDBNames::SequenceTableName(), cond::DbScopedTransaction::start(), AlCaHLTBitMon_QueryRunRegistry::string, and cond::to_string().

148  {
150  trans.start(false);
151  //aquireutctime
152  boost::posix_time::ptime p=boost::posix_time::microsec_clock::universal_time();
153  std::string now=cond::to_string(p.date().year())+"-"+cond::to_string(p.date().month())+"-"+cond::to_string(p.date().day())+"-"+cond::to_string(p.time_of_day().hours())+":"+cond::to_string(p.time_of_day().minutes())+":"+cond::to_string(p.time_of_day().seconds());
154  //aquireentryid
155  if(!m_sequenceManager){
157  }
158  unsigned long long targetLogId=m_sequenceManager->incrementId(LogDBNames::LogTableName());
159  //insert log record with the new id
160  this->insertLogRecord(targetLogId,now,destDB,payloadClass,payloadToken,userlogInfo,iovtag,iovtimetype,payloadIdx,lastSince,exceptionMessage);
161  trans.commit();
162 }
SequenceManager * m_sequenceManager
Definition: Logger.h:107
DbSession m_sessionHandle
Definition: Logger.h:103
std::string to_string(const T &t)
Definition: Logger.cc:26
static std::string SequenceTableName()
Definition: LogDBNames.cc:3
unsigned long long incrementId(const std::string &reftableName)
Increments and returns a new valid oid for a table.
void insertLogRecord(unsigned long long logId, const std::string &utctime, const std::string &destDB, const std::string &payloadToken, const std::string &payloadClass, const cond::UserLogInfo &userLogInfo, const std::string &iovtag, const std::string &iovtimetype, unsigned int payloadIdx, unsigned long long lastSince, const std::string &exceptionMessage)
Definition: Logger.cc:295
static std::string LogTableName()
Definition: LogDBNames.cc:7
void cond::Logger::logOperationNow ( const cond::UserLogInfo userlogInfo,
const std::string &  destDB,
const std::string &  payloadToken,
const std::string &  payloadClass,
const std::string &  iovtag,
const std::string &  iovtimetype,
unsigned int  payloadIdx,
unsigned long long  lastSince 
)

Definition at line 112 of file Logger.cc.

References cond::DbScopedTransaction::commit(), cond::LogDBNames::LogTableName(), cmsPerfSuiteHarvest::now, AlCaHLTBitMon_ParallelJobs::p, cond::LogDBNames::SequenceTableName(), cond::DbScopedTransaction::start(), AlCaHLTBitMon_QueryRunRegistry::string, and cond::to_string().

121  {
123  trans.start(false);
124  //aquireutctime
125  //using namespace boost::posix_time;
126  boost::posix_time::ptime p=boost::posix_time::microsec_clock::universal_time();
127  std::string now=cond::to_string(p.date().year())+"-"+cond::to_string(p.date().month())+"-"+cond::to_string(p.date().day())+"-"+cond::to_string(p.time_of_day().hours())+":"+cond::to_string(p.time_of_day().minutes())+":"+cond::to_string(p.time_of_day().seconds());
128  //aquireentryid
129  if(!m_sequenceManager){
131  }
132  unsigned long long targetLogId=m_sequenceManager->incrementId(LogDBNames::LogTableName());
133  //insert log record with the new id
134  this->insertLogRecord(targetLogId,now,destDB,payloadClass,payloadToken,userlogInfo,iovtag,iovtimetype,payloadIdx,lastSince,"OK");
135  trans.commit();
136 }
SequenceManager * m_sequenceManager
Definition: Logger.h:107
DbSession m_sessionHandle
Definition: Logger.h:103
std::string to_string(const T &t)
Definition: Logger.cc:26
static std::string SequenceTableName()
Definition: LogDBNames.cc:3
unsigned long long incrementId(const std::string &reftableName)
Increments and returns a new valid oid for a table.
void insertLogRecord(unsigned long long logId, const std::string &utctime, const std::string &destDB, const std::string &payloadToken, const std::string &payloadClass, const cond::UserLogInfo &userLogInfo, const std::string &iovtag, const std::string &iovtimetype, unsigned int payloadIdx, unsigned long long lastSince, const std::string &exceptionMessage)
Definition: Logger.cc:295
static std::string LogTableName()
Definition: LogDBNames.cc:7
void cond::Logger::LookupLastEntryByProvenance ( const std::string &  provenance,
LogDBEntry logentry,
bool  filterFailedOp = true 
) const

Definition at line 165 of file Logger.cc.

References cond::LogDBEntry::destinationDB, cond::LogDBEntry::execmessage, cond::LogDBEntry::exectime, cond::LogDBEntry::iovtag, cond::LogDBEntry::iovtimetype, cond::LogDBEntry::lastSince, cond::LogDBEntry::logId, cond::LogDBNames::LogTableName(), cond::LogDBEntry::payloadClass, cond::LogDBEntry::payloadIdx, cond::LogDBEntry::payloadToken, cond::LogDBEntry::provenance, o2o::query, AlCaHLTBitMon_QueryRunRegistry::string, and cond::LogDBEntry::usertext.

167  {
168  //construct where
170  whereClause+=".PROVENANCE=:provenance";
171  if(filterFailedOp){
172  whereClause+=std::string(" AND ");
173  whereClause+=cond::LogDBNames::LogTableName();
174  whereClause+=std::string(".EXECMESSAGE=:execmessage");
175  }
176  coral::AttributeList BindVariableList;
177  BindVariableList.extend("provenance",typeid(std::string) );
178  BindVariableList.extend("execmessage",typeid(std::string) );
179  BindVariableList["provenance"].data<std::string>()=provenance;
180  BindVariableList["execmessage"].data<std::string>()="OK";
182  {
183  std::auto_ptr<coral::IQuery> query(m_sessionHandle.nominalSchema().tableHandle( cond::LogDBNames::LogTableName() ).newQuery());
184  // construct select
185  query->addToOutputList( "LOGID" );
186  query->defineOutputType( "LOGID", "unsigned long long" );
187  query->addToOutputList( "DESTINATIONDB" );
188  query->addToOutputList( "PROVENANCE" );
189  query->addToOutputList( "USERTEXT" );
190  query->addToOutputList( "IOVTAG" );
191  query->addToOutputList( "IOVTIMETYPE" );
192  query->addToOutputList( "PAYLOADINDEX" );
193  query->defineOutputType( "PAYLOADINDEX", "unsigned int" );
194  query->addToOutputList( "LASTSINCE" );
195  query->defineOutputType( "LASTSINCE", "unsigned long long" );
196  query->addToOutputList( "PAYLOADCLASS" );
197  query->addToOutputList( "PAYLOADTOKEN" );
198  query->addToOutputList( "EXECTIME" );
199  query->addToOutputList( "EXECMESSAGE" );
200 
201  query->setCondition( whereClause, BindVariableList );
202  query->addToOrderList( cond::LogDBNames::LogTableName()+".LOGID desc" );
203  query->limitReturnedRows();
204  coral::ICursor& cursor = query->execute();
205  if( cursor.next() ) {
206  const coral::AttributeList& row = cursor.currentRow();
207  logentry.logId=row["LOGID"].data<unsigned long long>();
208  logentry.destinationDB=row["DESTINATIONDB"].data<std::string>();
209  logentry.provenance=row["PROVENANCE"].data<std::string>();
210  logentry.usertext=row["USERTEXT"].data<std::string>();
211  logentry.iovtag=row["IOVTAG"].data<std::string>();
212  logentry.iovtimetype=row["IOVTIMETYPE"].data<std::string>();
213  logentry.payloadIdx=row["PAYLOADINDEX"].data<unsigned int>();
214  logentry.lastSince=row["LASTSINCE"].data<unsigned long long>();
215  logentry.payloadClass=row["PAYLOADCLASS"].data<std::string>();
216  logentry.payloadToken=row["PAYLOADTOKEN"].data<std::string>();
217  logentry.exectime=row["EXECTIME"].data<std::string>();
218  logentry.execmessage=row["EXECMESSAGE"].data<std::string>();
219  }
220  }
222 }
DbTransaction & transaction()
Definition: DbSession.cc:208
int commit()
commit transaction.
DbSession m_sessionHandle
Definition: Logger.h:103
int start(bool readOnly=false)
start transaction
coral::ISchema & nominalSchema()
Definition: DbSession.cc:243
tuple query
Definition: o2o.py:269
static std::string LogTableName()
Definition: LogDBNames.cc:7
void cond::Logger::LookupLastEntryByTag ( const std::string &  iovtag,
LogDBEntry logentry,
bool  filterFailedOp = true 
) const

Definition at line 289 of file Logger.cc.

291  {
292  LookupLastEntryByTag(iovtag,"",logentry,filterFailedOp);
293 }
void LookupLastEntryByTag(const std::string &iovtag, LogDBEntry &logentry, bool filterFailedOp=true) const
Definition: Logger.cc:289
void cond::Logger::LookupLastEntryByTag ( const std::string &  iovtag,
const std::string &  connectionStr,
cond::LogDBEntry logentry,
bool  filterFailedOp = true 
) const

Definition at line 224 of file Logger.cc.

References cond::LogDBEntry::destinationDB, cond::LogDBEntry::execmessage, cond::LogDBEntry::exectime, cond::LogDBEntry::iovtag, cond::LogDBEntry::iovtimetype, cond::LogDBEntry::lastSince, cond::LogDBEntry::logId, cond::LogDBNames::LogTableName(), cond::LogDBEntry::payloadClass, cond::LogDBEntry::payloadIdx, cond::LogDBEntry::payloadToken, cond::LogDBEntry::provenance, o2o::query, AlCaHLTBitMon_QueryRunRegistry::string, and cond::LogDBEntry::usertext.

227  {
228  coral::AttributeList BindVariableList;
229  BindVariableList.extend("IOVTAG",typeid(std::string) );
230  BindVariableList["IOVTAG"].data<std::string>()=iovtag;
231  std::string whereClause("");
232  whereClause+=std::string("IOVTAG=:IOVTAG");
233  if(connectionStr!=""){
234  whereClause+=std::string(" AND ");
235  whereClause+=std::string("DESTINATIONDB=:DESTINATIONDB");
236  BindVariableList.extend("DESTINATIONDB",typeid(std::string) );
237  BindVariableList["DESTINATIONDB"].data<std::string>()=connectionStr;
238  }
239  if(filterFailedOp){
240  whereClause+=std::string(" AND ");
241  whereClause+=std::string("EXECMESSAGE=:EXECMESSAGE");
242  BindVariableList.extend("EXECMESSAGE",typeid(std::string) );
243  BindVariableList["EXECMESSAGE"].data<std::string>()="OK";
244  }
246  {
247  std::auto_ptr<coral::IQuery> query( m_sessionHandle.nominalSchema().tableHandle(cond::LogDBNames::LogTableName()).newQuery() );
248  // construct select
249  query->addToOutputList( "LOGID" );
250  query->defineOutputType( "LOGID", "unsigned long long" );
251  query->addToOutputList( "DESTINATIONDB" );
252  query->addToOutputList( "PROVENANCE" );
253  query->addToOutputList( "USERTEXT" );
254  query->addToOutputList( "IOVTAG" );
255  query->addToOutputList( "IOVTIMETYPE" );
256  query->addToOutputList( "PAYLOADINDEX" );
257  query->defineOutputType( "PAYLOADINDEX", "unsigned int" );
258  query->addToOutputList( "LASTSINCE" );
259  query->defineOutputType( "LASTSINCE", "unsigned long long" );
260  query->addToOutputList( "PAYLOADCLASS" );
261  query->addToOutputList( "PAYLOADTOKEN" );
262  query->addToOutputList( "EXECTIME" );
263  query->addToOutputList( "EXECMESSAGE" );
264 
265  query->setCondition( whereClause, BindVariableList );
266  query->addToOrderList( "LOGID DESC" );
267  query->limitReturnedRows();
268  coral::ICursor& cursor = query->execute();
269  if( cursor.next() ) {
270  const coral::AttributeList& row = cursor.currentRow();
271  logentry.logId=row["LOGID"].data<unsigned long long>();
272  logentry.destinationDB=row["DESTINATIONDB"].data<std::string>();
273  logentry.provenance=row["PROVENANCE"].data<std::string>();
274  logentry.usertext=row["USERTEXT"].data<std::string>();
275  logentry.iovtag=row["IOVTAG"].data<std::string>();
276  logentry.iovtimetype=row["IOVTIMETYPE"].data<std::string>();
277  logentry.payloadIdx=row["PAYLOADINDEX"].data<unsigned int>();
278  logentry.lastSince=row["LASTSINCE"].data<unsigned long long>();
279  logentry.payloadClass=row["PAYLOADCLASS"].data<std::string>();
280  logentry.payloadToken=row["PAYLOADTOKEN"].data<std::string>();
281  logentry.exectime=row["EXECTIME"].data<std::string>();
282  logentry.execmessage=row["EXECMESSAGE"].data<std::string>();
283 
284  }
285  }
287 }
std::string exectime
Definition: LogDBEntry.h:27
std::string usertext
Definition: LogDBEntry.h:20
std::string iovtimetype
Definition: LogDBEntry.h:22
unsigned int payloadIdx
Definition: LogDBEntry.h:23
DbTransaction & transaction()
Definition: DbSession.cc:208
std::string payloadToken
Definition: LogDBEntry.h:26
unsigned long long logId
Definition: LogDBEntry.h:17
int commit()
commit transaction.
DbSession m_sessionHandle
Definition: Logger.h:103
std::string payloadClass
Definition: LogDBEntry.h:25
std::string destinationDB
Definition: LogDBEntry.h:18
int start(bool readOnly=false)
start transaction
unsigned long long lastSince
Definition: LogDBEntry.h:24
std::string execmessage
Definition: LogDBEntry.h:28
coral::ISchema & nominalSchema()
Definition: DbSession.cc:243
std::string provenance
Definition: LogDBEntry.h:19
tuple query
Definition: o2o.py:269
std::string iovtag
Definition: LogDBEntry.h:21
static std::string LogTableName()
Definition: LogDBNames.cc:7

Member Data Documentation

bool cond::Logger::m_locked
private

Definition at line 105 of file Logger.h.

bool cond::Logger::m_logTableExists
private

Definition at line 108 of file Logger.h.

SequenceManager* cond::Logger::m_sequenceManager
private

Definition at line 107 of file Logger.h.

DbSession cond::Logger::m_sessionHandle
mutableprivate

Definition at line 103 of file Logger.h.

coral::IQuery* cond::Logger::m_statusEditorHandle
private

Definition at line 106 of file Logger.h.