ATLAS Offline Software
CoraCoolFolder.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // CoraCoolFolder.cxx
6 // implementation for CoraCoolFolder
7 // Richard Hawkings, started 10/2006
8 
9 #include "RelationalAccess/ISessionProxy.h"
10 #include "RelationalAccess/ITransaction.h"
11 #include "RelationalAccess/ISchema.h"
12 #include "RelationalAccess/ITable.h"
13 #include "RelationalAccess/ITableDescription.h"
14 #include "RelationalAccess/ITableDataEditor.h"
15 #include "RelationalAccess/IBulkOperation.h"
16 #include "RelationalAccess/IColumn.h"
17 #include "RelationalAccess/IQuery.h"
18 #include "RelationalAccess/ICursor.h"
19 #include "RelationalAccess/SchemaException.h"
20 #include "CoralBase/Attribute.h"
21 #include "CoralBase/Exception.h"
22 #include "CoolKernel/ValidityKey.h"
23 #include "CoolKernel/IDatabase.h"
24 #include "CoolKernel/IFolder.h"
25 #include "CoolKernel/IObject.h"
26 #include "CoolKernel/Record.h"
27 #include "CoolKernel/StorageType.h"
30 #include "CoraCoolSequence.h"
33 
36 
37 // size of attributelist buffer for write operations
38 #define WB_SIZE 256
39 
40 CoraCoolFolder::CoraCoolFolder(const std::string& coolfolder,
41  coral::ISessionProxy* proxy, cool::IDatabasePtr cooldb,
42  CoraCoolDatabase* coradb, coral::MessageStream& log)
43  :
44  m_foldername(coolfolder),
45  m_proxy(proxy),m_cooldb(cooldb),m_coradb(coradb),
46  m_log(log),
47  m_bulkactive(false),m_payloadbuf(0),m_bulki(0),m_seqpk(0),m_seqfk(0),
48  m_nextpk(0),m_usedpk(0),m_nextfk(0),m_usedfk(0)
49 {
51 
52  // get information from COOL
53  m_log << coral::Debug << "Initialize CoraCoolFolder " << coolfolder <<
54  " in database instance " << m_dbname << coral::MessageStream::endmsg;
55 
56  std::string folderdesc;
57  try {
59  folderdesc=m_coolfolder->description();
60  }
61  catch (cool::Exception& e) {
62  throw CoraCoolException(e.what(),"CoraCoolFolder::CoraCoolFolder");
63  }
64  m_log << coral::Debug << "COOL Folder description is: " << folderdesc
66 
67  // set up linking information between COOL and CORAL folders
71  } else {
72  throw CoraCoolException("incorrect <coracool> description string ",
73  "CoraCoolFolder::CoraCoolFolder");
74  }
75 
76  // obtain information about CORAL folder
77  try {
78  m_proxy->transaction().start(true);
79  coral::ISchema& schema=m_proxy->nominalSchema();
80  m_table=&schema.tableHandle(m_tablename);
81  m_tabledesc=&(m_table->description());
82  // find type of foreign key
83  // lookup attribute specification for query outputs
84  if (!decodeAttrSpec()) throw CoraCoolException(
85  "Problem extracting attribute specification",
86  "CoraCoolFolder::CoraCoolFolder");
87  m_proxy->transaction().commit();
88  }
89  catch (coral::SessionException& e) {
90  throw CoraCoolException("Problem accessing CORAL table "+m_tablename,
91  "CoraCoolFolder::CoraCoolFolder");
92  }
93 }
94 
96  delete m_payloadbuf;
97 
98  if (m_seqpk) delete m_seqpk;
99  if (m_seqfk) delete m_seqfk;
100 }
101 
102 const cool::IRecordSpecification& CoraCoolFolder::fkSpecification()
103  const
104 { return m_coolfolder->payloadSpecification(); }
105 
106 const cool::RecordSpecification
108  // have to assemble a RecordSpecification and return the specification
109  // as ITableDescription does not allow to get this directly
110  cool::RecordSpecification atrspec;
111  for (AttrItr itr=m_attrvec.begin();itr!=m_attrvec.end();++itr)
112  atrspec.extend(itr->first,nameToCoolType(itr->second));
113  return atrspec;
114 }
115 
117  // assemble and return an attributelist for use in constructing payloads
118  coral::AttributeList atrlist;
119  for (AttrItr itr=m_attrvec.begin();itr!=m_attrvec.end();++itr)
120  atrlist.extend(itr->first,
121  cool::StorageType::storageType(nameToCoolType(itr->second)).cppType());
122  return atrlist;
123 }
124 
125 int CoraCoolFolder::storeObject (const cool::ValidityKey& since,
126  const cool::ValidityKey until,
129  const cool::ChannelId& channelId,
130  const std::string& tagName,
131  const bool userTagOnly) {
132  // store objects into CORAL table, and reference in COOL table
133  // generate new FK and PK for CORAL data as needed
134 
135  int fkey=0;
136  if (m_bulkactive) {
137  fkey=m_nextfk++;
138  ++m_usedfk;
139  bulkInsert(begin,end,fkey,true);
140  } else {
141  // non-bulk insert
142  // first count number of CORAL rows to be inserted
143  unsigned int nrow=0;
144  for (const_iterator payitr=begin;payitr!=end;++payitr) ++nrow;
145  m_log << coral::Debug << "Storing " << nrow << " rows in CoraCool folder "
146  << m_foldername << " channel " << channelId <<
148 
149  // generate keys - start transaction here
150  int pkey;
151  try {
152  m_proxy->transaction().start(false);
153  CoraCoolSequence seqfk(m_dbname,m_tablename+"_FK",m_proxy,false);
154  fkey=seqfk.fetch();
155  if (m_pkey) {
156  CoraCoolSequence seqfk(m_dbname,m_tablename+"_PK",m_proxy,false);
157  pkey=seqfk.fetch(nrow);
158  } else {
159  pkey=0; // set to 0 to satisfy compiler
160  }
161  // commit key transaction, releasing lock on keytable
162  m_proxy->transaction().commit();
163  }
164  catch (coral::Exception& e) {
165  throw CoraCoolException(e.what(),"CoraCoolFolder::storeObject(key)");
166  }
167 
168  // insert rows into CORAL, using bulk operation
169  try {
170  m_proxy->transaction().start(false);
171  coral::ISchema& schema=m_proxy->nominalSchema();
172  m_table=&schema.tableHandle(m_tablename);
173  coral::ITableDataEditor& editor=m_table->dataEditor();
175  coral::IBulkOperation* bulki=editor.bulkInsert(data,WB_SIZE);
176 
177  for (const_iterator payitr=begin;payitr!=end;++payitr) {
178  // copy data from iterator
179  data.fastCopyData(*payitr);
180  // update the keys
182  if (m_pkey) setAttrKey(data[m_pkeycolcoral],pkey++);
183  // store data into CORAL table
184  bulki->processNextIteration();
185  }
186  bulki->flush();
187  m_proxy->transaction().commit();
188  }
189  catch (coral::Exception& e) {
190  throw CoraCoolException(e.what(),"CoraCoolFolder::storeObject(payload)");
191  }
192 
193  // now store data in COOL, with correct foreign key (bulk/non bulk)
194  // in bulk case, the COOL operation is already going via storage buffer
195  }
196  cool::Record coolfk(m_coolfolder->payloadSpecification());
197  setFieldKey(coolfk[m_keycolcool],fkey);
198  try {
199  m_coolfolder->storeObject(since,until,coolfk,channelId,tagName,
200  userTagOnly);
201  }
202  catch (cool::Exception &e) {
203  throw CoraCoolException(e.what(),"CoraCoolFolder::storeObject");
204  }
205  // return FK value, in case user wants to use it in a reference object call
206  return fkey;
207 }
208 
209 // Actually ok, but marked as not thread-safe due to the copy
210 // of the (non-shared) AttributeList.
212  // flush any existing data first to get clean state
214  if (m_payloadbuf==0) {
215  // actions done if this is the first time setupStorageBuffer done for
216  // this folder
217  // create AttributeList as bulk buffer
219  // setup bulk storage for the COOL folder
220  m_coolfolder->setupStorageBuffer();
221  }
222  // setup bulk operation buffer - transaction begins here
223  m_proxy->transaction().start(false);
224  coral::ISchema& schema=m_proxy->nominalSchema();
225  m_table=&schema.tableHandle(m_tablename);
226  coral::ITableDataEditor& editor=m_table->dataEditor();
227  m_bulki=editor.bulkInsert(*m_payloadbuf,WB_SIZE);
228  // prepare the key sequences
229  if (m_pkey) {
230  if (m_seqpk==0)
232  m_seqpk->querySeq(m_nextpk,true,true);
233  m_usedpk=0;
234  }
235  if (m_seqfk==0)
237  m_seqfk->querySeq(m_nextfk,true,true);
238  m_usedfk=0;
239  m_bulkactive=true;
240  return true;
241 }
242 
244  if (!m_bulkactive) return;
245  // execute bulk store
246  try {
247  m_bulki->flush();
248  // update the keys
249  if (m_usedpk>0) m_seqpk->fetch(m_usedpk);
250  if (m_usedfk>0) m_seqfk->fetch(m_usedfk);
251  // commit transaction for payload table and keys
252  m_proxy->transaction().commit();
253  }
254  catch (coral::Exception& e) {
255  throw CoraCoolException(e.what(),"CoraCoolFolder::flushStorageBuffer");
256  }
257  m_coolfolder->flushStorageBuffer();
258  m_bulkactive=false;
259 }
260 
261 void CoraCoolFolder::referenceObject(const cool::ValidityKey& since,
262  const cool::ValidityKey& until,
263  const coral::Attribute& fkey,
264  const cool::ChannelId& channelId,
265  const std::string& tagName,
266  const bool userTagOnly) {
267  // add reference to existing payload object
268  // call COOL API, just checking fkey has correct name
269  if (fkey.specification().name()==m_keycolcool) {
270  cool::Record fkeylist(m_coolfolder->payloadSpecification());
271  setFieldAttr(fkeylist[m_keycolcool],fkey);
272  m_coolfolder->storeObject(since,until,fkeylist,channelId,tagName,
273  userTagOnly);
274  } else {
275  throw CoraCoolException("Foreign key name should be "+m_keycolcool,
276  "CoraCool::Folder::referenceObject");
277  }
278 }
279 
280 void CoraCoolFolder::referenceObject(const cool::ValidityKey& since,
281  const cool::ValidityKey& until,
282  const int ifkey,
283  const cool::ChannelId& channelId,
284  const std::string& tagName,
285  const bool userTagOnly) {
286  // add reference to existing payload object, supplying key as int
287  cool::Record fkeylist(m_coolfolder->payloadSpecification());
288  setFieldKey(fkeylist[m_keycolcool],ifkey);
289  m_coolfolder->storeObject(since,until,fkeylist,channelId,tagName,
290  userTagOnly);
291 }
292 
293 void CoraCoolFolder::addPayload(const_iterator begin, const_iterator end) { // Copies AttributeList, giving shared specification.
294  // add payload to the CORAL table, using existing FKs in data
295  // but regenerating primary keys
296 
297  // only makes sense to use this method for folders with separate pkeys
298  if (!m_pkey) throw CoraCoolException("Folder has no primary key",
299  "CoralCoolFolder::addPayload");
300  if (m_bulkactive) {
301  // via bulk operation buffer
302  bulkInsert(begin,end,0,false);
303  } else {
304  // first count number of CORAL rows to be inserted
305  unsigned int nrow=0;
306  for (const_iterator payitr=begin;payitr!=end;++payitr) ++nrow;
307  m_log << coral::Debug << "Adding " << nrow << " into CoraCool folder "
309  // generate keys - start transaction here
310  int pkey;
311  try {
312  m_proxy->transaction().start(false);
313  CoraCoolSequence seqfk(m_dbname,m_tablename+"_PK",m_proxy,false);
314  pkey=seqfk.fetch(nrow);
315  // commit key transaction, releasing lock on keytable
316  m_proxy->transaction().commit();
317  }
318  catch (coral::Exception& e) {
319  throw CoraCoolException(e.what(),"CoraCoolFolder::addPayload(key)");
320  }
321  // insert rows into CORAL
322  try {
323  m_proxy->transaction().start(false);
324  coral::ISchema& schema=m_proxy->nominalSchema();
325  m_table=&schema.tableHandle(m_tablename);
326  coral::ITableDataEditor& editor=m_table->dataEditor();
327 
328  for (const_iterator payitr=begin;payitr!=end;++payitr) {
329  // store data, updating pkey
330  coral::AttributeList data=*payitr;
331  setAttrKey(data[m_pkeycolcoral],pkey++);
332  editor.insertRow(data);
333  }
334  m_proxy->transaction().commit();
335  }
336  catch (coral::Exception& e) {
337  throw CoraCoolException(e.what(),"CoraCoolFolder::addPayload(payload)");
338  }
339  }
340 }
341 
342 bool CoraCoolFolder::setAttrKey(coral::Attribute& attr,
343  const int keyval) {
344  // set the value of the key in the attribute, regardless of type
345  const std::string typen=attr.specification().typeName();
346  if (typen=="int") {
347  attr.data<int>()=keyval;
348  } else if (typen=="unsigned int") {
349  attr.data<unsigned int>()=keyval;
350  } else if (typen=="long long") {
351  attr.data<long long>()=keyval;
352  } else if (typen=="unsigned long long") {
353  attr.data<unsigned long long>()=keyval;
354  } else {
355  // throw exception here?
356  m_log << coral::Error << "Unrecognised key type " << typen <<
357  " in CoraCoolFolder::setAttrKey" << coral::MessageStream::endmsg;
358  return false;
359  }
360  return true;
361 }
362 
363 bool CoraCoolFolder::setFieldKey(cool::IField& attr,
364  const int keyval) {
365  // set the value of the key in the Record, regardless of type
366  const cool::StorageType& typen=attr.specification().storageType();
367  if (typen==cool::StorageType::Int32) {
368  attr.setValue<int>(keyval);
369  } else if (typen==cool::StorageType::UInt32) {
370  attr.setValue<unsigned int>(keyval);
371  } else if (typen==cool::StorageType::Int64) {
372  attr.setValue<long long>(keyval);
373  } else if (typen==cool::StorageType::UInt63) {
374  attr.setValue<unsigned long long>(keyval);
375  } else {
376  // throw exception here?
377  m_log << coral::Error << "Unrecognised key type " << typen.name() <<
378  " in CoraCoolFolder::setFieldKey" << coral::MessageStream::endmsg;
379  return false;
380  }
381  return true;
382 }
383 
384 bool CoraCoolFolder::setFieldAttr(cool::IField& attr,
385  const coral::Attribute& keyval) {
386  // set the value of the key in the Record, from input Attribute
387  const cool::StorageType& typen=attr.specification().storageType();
388  if (typen==cool::StorageType::Int32) {
389  attr.setValue<int>(keyval.data<int>());
390  } else if (typen==cool::StorageType::UInt32) {
391  attr.setValue<unsigned int>(keyval.data<unsigned int>());
392  } else if (typen==cool::StorageType::Int64) {
393  attr.setValue<long long>(keyval.data<long long>());
394  } else if (typen==cool::StorageType::UInt63) {
395  attr.setValue<unsigned long long>(keyval.data<unsigned long long>());
396  } else {
397  // throw exception here?
398  m_log << coral::Error << "Unrecognised key type " << typen.name() <<
399  " in CoraCoolFolder::setFieldAttr" << coral::MessageStream::endmsg;
400  return false;
401  }
402  return true;
403 }
404 
405 
406 int CoraCoolFolder::getAttrKey(const coral::Attribute& attr) {
407  const std::string typen=attr.specification().typeName();
408  if (typen=="int") {
409  return attr.data<int>();
410  } else if (typen=="unsigned int") {
411  return static_cast<int>(attr.data<unsigned int>());
412  } else if (typen=="long long") {
413  return static_cast<int>(attr.data<long long>());
414  } else if (typen=="unsigned long long") {
415  return static_cast<int>(attr.data<unsigned long long>());
416  } else {
417  m_log << coral::Error << "Unrecognised key type " << typen <<
418  " in CoraCoolFolder::getAttrKey" << coral::MessageStream::endmsg;
419  return 0;
420  }
421 }
422 
424  // read information from the CORACOOLATTR table
425  bool bres=false;
426  coral::IQuery* query=0;
427  try {
428  coral::ITable& table=m_proxy->nominalSchema().tableHandle(
429  m_dbname+"_CORACOOLATTR");
430  query=table.newQuery();
431  coral::AttributeList bindvar;
432  bindvar.extend<std::string>("SNAME");
433  bindvar[0].data<std::string>()=m_tablename;
434  query->setCondition("NAME=:SNAME",bindvar);
435  query->setRowCacheSize(1);
436  query->defineOutputType("NAME","string");
437  coral::ICursor& cursor=query->execute();
438  if (cursor.next()) {
439  const coral::AttributeList& res=cursor.currentRow();
440  std::string spec=res["ATTRSPEC"].data<std::string>();
441  // decode specification
442  std::string::size_type iofs1,iofs2,iofs3;
443  iofs1=0;
444  bool last=false;
445  while (!last) {
446  iofs2=spec.find(':',iofs1);
447  iofs3=spec.find(',',iofs2);
448  if (iofs3==std::string::npos) {
449  iofs3=spec.size();
450  last=true;
451  }
452  m_attrvec.emplace_back(spec.substr(iofs1,iofs2-iofs1),spec.substr(iofs2+1,iofs3-iofs2-1));
453  if (!last) iofs1=iofs3+1;
454  }
455  bres=true;
456  } else {
457  m_log << coral::Error << "No data obtained for CORACOOLATTR" <<
459  }
460  }
461  catch (coral::Exception &e) {
462  m_log << coral::Error << "Exception reading CORACOOLATTR table: "
463  << e.what() << coral::MessageStream::endmsg;
464  }
465  delete query;
466  return bres;
467 }
468 
470  const std::string& coolName) const {
471  if (coolName=="Int16") return cool::StorageType::Int16;
472  if (coolName=="UInt16") return cool::StorageType::UInt16;
473  if (coolName=="Int32") return cool::StorageType::Int32;
474  if (coolName=="UInt32") return cool::StorageType::UInt32;
475  if (coolName=="UInt63") return cool::StorageType::UInt63;
476  if (coolName=="Int64") return cool::StorageType::Int64;
477  if (coolName=="Float") return cool::StorageType::Float;
478  if (coolName=="Double") return cool::StorageType::Double;
479  if (coolName=="String255") return cool::StorageType::String255;
480  if (coolName=="String4k") return cool::StorageType::String4k;
481  if (coolName=="String64k") return cool::StorageType::String64k;
482  if (coolName=="String16M") return cool::StorageType::String16M;
483  if (coolName=="Blob64k") return cool::StorageType::Blob64k;
484 
485  throw CoraCoolException("Undefined type: "+coolName,
486  "CoraCoolFolder::nameToCoolType");
487 }
488 
489 void CoraCoolFolder::setOutputSpec(coral::IQuery* query) {
490  for (AttrItr itr=m_attrvec.begin();itr!=m_attrvec.end();++itr)
491  query->defineOutputType(itr->first,
492  coral::AttributeSpecification::typeNameForId(
493  cool::StorageType::storageType(nameToCoolType(itr->second)).cppType()));
494 }
495 
497  const int fkey,bool updatefk) {
498  // do bulk insertion into CORAL table buffer
499  // if updateFK=true, update rows with given FK value
500  try {
501  for (const_iterator payitr=begin;payitr!=end;++payitr) {
502  // copy data into buffer bound to bulk insert
503  m_payloadbuf->fastCopyData(*payitr);
504  // update the keys
505  if (updatefk) setAttrKey((*m_payloadbuf)[m_keycolcoral],fkey);
506  if (m_pkey) {
508  ++m_usedpk;
509  }
510  // add to bulk operation
511  m_bulki->processNextIteration();
512  }
513  }
514  catch (coral::Exception& e) {
515  throw CoraCoolException(e.what(),"CoraCoolFolder::bulkInsert");
516  }
517 }
518 
520  const cool::ValidityKey& pointInTime, const cool::ChannelId& channelId,
521  const std::string& tagName) {
522  // first query cool to get foreign key
523  m_log << coral::Debug << "CoraCoolFolder query time " << pointInTime <<
524  " channel " << channelId << " tag " << tagName << coral::MessageStream::endmsg;
525  cool::IObjectPtr obj=m_coolfolder->findObject(pointInTime,channelId,tagName);
526  // create result object with IOV from COOL
527  CoraCoolObjectPtr result(new CoraCoolObject(obj->since(),obj->until(),
528  obj->channelId()));
529  // now query CORAL for payload
530  try {
531  m_proxy->transaction().start(true);
532  coral::IQuery* query=m_table->newQuery();
533  std::string where=m_keycolcoral+"=:"+m_keycolcool;
534  const coral::AttributeList& fkeybind=obj->payload().attributeList();
535  query->setCondition(where,fkeybind);
536  coral::ICursor& cursor=query->execute();
537  while (cursor.next()) {
538  const coral::AttributeList& res=cursor.currentRow();
539  result->add(res);
540  }
541  delete query;
542  m_proxy->transaction().commit();
543  }
544  catch (coral::Exception& e) {
545  throw CoraCoolException(e.what(),"CoraCoolFolder::findObject");
546  }
547  return result;
548 }
549 
551  const cool::ValidityKey& pointInTime,
552  const cool::ChannelSelection& channels,
553  const std::string& tagName) {
555 }
556 
558  const cool::ValidityKey& since,
559  const cool::ValidityKey& until,
560  const cool::ChannelSelection& channels,
561  const std::string& tagName)
562 {
563  // first initialise COOL query
564  cool::IObjectIteratorPtr coolitr=m_coolfolder->browseObjects(since,until,
565  channels,tagName);
566  CoraCoolObjectIterPtr itr(new CoraCoolObjectIter(this,coolitr));
567  return itr;
568 }
569 
570 void CoraCoolFolder::setPrefetchAll(bool prefetchAll) {
571  // pass setting onto COOL - no special actions for CoraCool yet
572  m_coolfolder->setPrefetchAll(prefetchAll);
573 }
574 
575 coral::ITable* CoraCoolFolder::table() {
576  return &(m_proxy->nominalSchema().tableHandle(m_tablename));
577 }
CoraCoolFolder::nameToCoolType
cool::StorageType::TypeId nameToCoolType(const std::string &coolName) const
Definition: CoraCoolFolder.cxx:469
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
CoraCoolFolder::m_attrvec
AttrVec m_attrvec
Definition: CoraCoolFolder.h:175
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
CoraCoolFolder::setupStorageBuffer
bool setupStorageBuffer()
Definition: CoraCoolFolder.cxx:211
CoraCoolObject
Definition: CoraCoolObject.h:20
get_generator_info.result
result
Definition: get_generator_info.py:21
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
CoraCoolFolder::decodeAttrSpec
bool decodeAttrSpec()
Definition: CoraCoolFolder.cxx:423
CoraCoolFolder::setFieldKey
bool setFieldKey(cool::IField &attr, const int keyval)
Definition: CoraCoolFolder.cxx:363
CoraCoolDatabase
Definition: CoraCoolDatabase.h:24
CoraCoolSequence::querySeq
bool querySeq(int &keyval, bool update=false, bool gettable=false)
Definition: CoraCoolSequence.cxx:96
CoraCoolFolder::m_pkeycolcoral
std::string m_pkeycolcoral
Definition: CoraCoolFolder.h:167
CaloCondBlobAlgs_fillNoiseFromASCII.spec
spec
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:47
CoraCoolFolder::m_pkey
bool m_pkey
Definition: CoraCoolFolder.h:168
CoraCoolFolder::setPrefetchAll
void setPrefetchAll(const bool prefetchAll)
Definition: CoraCoolFolder.cxx:570
CoraCoolFolder::m_nextfk
int m_nextfk
Definition: CoraCoolFolder.h:184
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
CoraCoolFolder::m_seqfk
CoraCoolSequence * m_seqfk
Definition: CoraCoolFolder.h:181
CoraCoolFolder::m_nextpk
int m_nextpk
Definition: CoraCoolFolder.h:182
CoraCoolFolder::browseObjects
CoraCoolObjectIterPtr browseObjects(const cool::ValidityKey &pointInTime, const cool::ChannelSelection &channels, const std::string &tagName="")
Definition: CoraCoolFolder.cxx:550
CoraCoolFolder::bulkInsert
void bulkInsert(const_iterator begin, const_iterator end, const int fkey, bool updatefk)
Definition: CoraCoolFolder.cxx:496
python.PyKernel.AttributeList
AttributeList
Definition: PyKernel.py:36
CoraCoolFolder::emptyAttrList
coral::AttributeList emptyAttrList() const
Definition: CoraCoolFolder.cxx:116
CoraCoolFolder::table
coral::ITable * table()
Definition: CoraCoolFolder.cxx:575
CoraCoolFolder::~CoraCoolFolder
~CoraCoolFolder()
Definition: CoraCoolFolder.cxx:95
CoraCoolFolder::m_table
coral::ITable * m_table
Definition: CoraCoolFolder.h:170
CoraCoolFolder::m_payloadbuf
coral::AttributeList * m_payloadbuf
Definition: CoraCoolFolder.h:178
CoraCoolObject.h
dq_defect_copy_defect_database.channels
def channels
Definition: dq_defect_copy_defect_database.py:56
CoraCoolFolder::m_bulki
coral::IBulkOperation * m_bulki
Definition: CoraCoolFolder.h:179
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
dq_defect_copy_defect_database.since
def since
Definition: dq_defect_copy_defect_database.py:54
CheckTagAssociation.schema
schema
Definition: CheckTagAssociation.py:22
dq_defect_copy_defect_database.until
def until
Definition: dq_defect_copy_defect_database.py:55
query
Definition: query.py:1
CoraCoolFolder::setAttrKey
bool setAttrKey(coral::Attribute &attr, const int keyval)
Definition: CoraCoolFolder.cxx:342
CoraCoolSequence::fetch
int fetch(const int inc=1)
Definition: CoraCoolSequence.cxx:73
CoraCoolFolder::CoraCoolObjectIter
friend class CoraCoolObjectIter
Definition: CoraCoolFolder.h:39
CoraCoolFolder::m_keycolcoral
std::string m_keycolcoral
Definition: CoraCoolFolder.h:165
CoraCoolFolder::const_iterator
std::vector< coral::AttributeList >::const_iterator const_iterator
Definition: CoraCoolFolder.h:42
CoraCoolFolder::getAttrKey
int getAttrKey(const coral::Attribute &attr)
Definition: CoraCoolFolder.cxx:406
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
WB_SIZE
#define WB_SIZE
Definition: CoraCoolFolder.cxx:38
CoraCoolFolder::m_bulkactive
bool m_bulkactive
Definition: CoraCoolFolder.h:177
CoraCoolFolder::m_tablename
std::string m_tablename
Definition: CoraCoolFolder.h:164
CoraCoolDatabase::dbname
const std::string & dbname() const
Definition: CoraCoolDatabase.h:97
CoraCoolFolder::payloadSpecification
const cool::RecordSpecification payloadSpecification() const
Definition: CoraCoolFolder.cxx:107
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
python.Utils.unixtools.where
def where(filename, prepath=[])
"which" for python files -------------------------------------------------—
Definition: unixtools.py:53
CoraCoolFolder::referenceObject
void referenceObject(const cool::ValidityKey &since, const cool::ValidityKey &until, const coral::Attribute &fkey, const cool::ChannelId &channelId=0, const std::string &tagName="", const bool userTagOnly=false)
Definition: CoraCoolFolder.cxx:261
CoraCoolSequence
Definition: CoraCoolSequence.h:15
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
CoraCoolFolder::findObject
CoraCoolObjectPtr findObject(const cool::ValidityKey &pointInTime, const cool::ChannelId &channelId=0, const std::string &tagName="")
Definition: CoraCoolFolder.cxx:519
CoraCoolFolder::m_cooldb
cool::IDatabasePtr m_cooldb
Definition: CoraCoolFolder.h:160
query_example.query
query
Definition: query_example.py:15
CoraCoolDatabase::parseFolderDescription
bool parseFolderDescription(const std::string &folderdesc, std::string &tablename, std::string &keycolcool, std::string &fkeycolcoral, std::string &pkeycolcoral)
Definition: CoraCoolDatabase.cxx:330
CoraCoolFolder::CoraCoolFolder
CoraCoolFolder(const std::string &coolfolder, coral::ISessionProxy *proxy, cool::IDatabasePtr cooldb, CoraCoolDatabase *coradb, coral::MessageStream &log)
Definition: CoraCoolFolder.cxx:40
CoraCoolFolder.h
CoraCoolFolder::setOutputSpec
void setOutputSpec(coral::IQuery *query)
Definition: CoraCoolFolder.cxx:489
CoraCoolFolder::fkSpecification
const cool::IRecordSpecification & fkSpecification() const
Definition: CoraCoolFolder.cxx:102
CoraCoolFolder::m_coolfolder
cool::IFolderPtr m_coolfolder
Definition: CoraCoolFolder.h:169
CoraCoolFolder::m_dbname
std::string m_dbname
Definition: CoraCoolFolder.h:158
CoraCoolFolder::setFieldAttr
bool setFieldAttr(cool::IField &attr, const coral::Attribute &keyval)
Definition: CoraCoolFolder.cxx:384
CoraCoolException
Definition: CoraCoolException.h:13
CoraCoolFolder::AttrItr
AttrVec::const_iterator AttrItr
Definition: CoraCoolFolder.h:174
query_example.cursor
cursor
Definition: query_example.py:21
CoraCoolFolder::m_usedpk
int m_usedpk
Definition: CoraCoolFolder.h:183
CoraCoolObjectIterPtr
boost::shared_ptr< CoraCoolObjectIter > CoraCoolObjectIterPtr
Definition: CoraCoolTypes.h:21
CoraCoolFolder::m_seqpk
CoraCoolSequence * m_seqpk
Definition: CoraCoolFolder.h:180
CoraCoolObjectPtr
boost::shared_ptr< CoraCoolObject > CoraCoolObjectPtr
Definition: CoraCoolTypes.h:18
CoraCoolFolder::flushStorageBuffer
void flushStorageBuffer()
Definition: CoraCoolFolder.cxx:243
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
CoraCoolFolder::storeObject
int storeObject(const cool::ValidityKey &since, const cool::ValidityKey until, const_iterator begin, const_iterator end, const cool::ChannelId &channelId=0, const std::string &tagName="", const bool userTagOnly=false)
Definition: CoraCoolFolder.cxx:125
CoraCoolDatabase.h
CoraCoolObjectIter.h
CoraCoolFolder::m_log
coral::MessageStream & m_log
Definition: CoraCoolFolder.h:162
CoraCoolSequence.h
CoraCoolFolder::m_foldername
std::string m_foldername
Definition: CoraCoolFolder.h:157
checker_macros.h
Define macros for attributes used to control the static checker.
python.PyAthena.obj
obj
Definition: PyAthena.py:132
Crest::TypeId
TypeId
Definition: CrestContainer.h:24
CoraCoolException.h
CoraCoolFolder::m_proxy
coral::ISessionProxy * m_proxy
Definition: CoraCoolFolder.h:159
CoraCoolFolder::m_tabledesc
const coral::ITableDescription * m_tabledesc
Definition: CoraCoolFolder.h:171
CoraCoolFolder::addPayload
void addPayload(const_iterator begin, const_iterator end)
Definition: CoraCoolFolder.cxx:293
Example_ReadSampleNoise.pointInTime
pointInTime
Definition: Example_ReadSampleNoise.py:14
CoraCoolFolder::m_coradb
CoraCoolDatabase * m_coradb
Definition: CoraCoolFolder.h:161
CoraCoolFolder::m_keycolcool
std::string m_keycolcool
Definition: CoraCoolFolder.h:166
CoraCoolFolder::m_usedfk
int m_usedfk
Definition: CoraCoolFolder.h:185