CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Attributes | Private Attributes
cond::persistency::BulkInserter< Types > Class Template Reference

#include <DbCore.h>

Public Member Functions

 BulkInserter (coral::ISchema &schema, const char *tableName)
 
void flush ()
 
template<typename P >
void insert (const P &params)
 

Static Public Attributes

static size_t cacheSize = 1000
 

Private Attributes

RowBuffer< Types... > m_buffer
 
std::unique_ptr< coral::IBulkOperation > m_coralInserter
 
coral::ISchema & m_schema
 
std::string m_tableName
 

Detailed Description

template<typename... Types>
class cond::persistency::BulkInserter< Types >

Definition at line 633 of file DbCore.h.

Constructor & Destructor Documentation

template<typename... Types>
cond::persistency::BulkInserter< Types >::BulkInserter ( coral::ISchema &  schema,
const char *  tableName 
)
inline

Definition at line 636 of file DbCore.h.

638  //fix me: maybe with
639  //m_coralInserter.reset( schema.tableHandle( std::string(tableName ) ).dataEditor().bulkInsert( m_buffer.get(), cacheSize ) );
640  }
RowBuffer< Types... > m_buffer
Definition: DbCore.h:660
coral::ISchema & m_schema
Definition: DbCore.h:657
std::unique_ptr< coral::IBulkOperation > m_coralInserter
Definition: DbCore.h:661

Member Function Documentation

template<typename... Types>
void cond::persistency::BulkInserter< Types >::flush ( )
inline

Definition at line 650 of file DbCore.h.

Referenced by cond::persistency::RUN_INFO::Table::insert(), cond::persistency::GLOBAL_TAG_MAP::Table::insert(), and cond::persistency::IOV::Table::insertMany().

650  {
651  if (m_coralInserter.get())
652  m_coralInserter->flush();
653  }
std::unique_ptr< coral::IBulkOperation > m_coralInserter
Definition: DbCore.h:661
template<typename... Types>
template<typename P >
void cond::persistency::BulkInserter< Types >::insert ( const P params)
inline

Definition at line 643 of file DbCore.h.

Referenced by BeautifulSoup.PageElement::append(), cond::persistency::RUN_INFO::Table::insert(), cond::persistency::GLOBAL_TAG_MAP::Table::insert(), and cond::persistency::IOV::Table::insertMany().

643  {
645  if (!m_coralInserter.get())
646  m_coralInserter.reset(m_schema.tableHandle(m_tableName).dataEditor().bulkInsert(m_buffer.get(), cacheSize));
647  m_coralInserter->processNextIteration();
648  }
void set(const P &params)
Definition: DbCore.h:193
RowBuffer< Types... > m_buffer
Definition: DbCore.h:660
const coral::AttributeList & get() const
Definition: DbCore.h:199
coral::ISchema & m_schema
Definition: DbCore.h:657
std::unique_ptr< coral::IBulkOperation > m_coralInserter
Definition: DbCore.h:661

Member Data Documentation

template<typename... Types>
size_t cond::persistency::BulkInserter< Types >::cacheSize = 1000
static

Definition at line 635 of file DbCore.h.

template<typename... Types>
RowBuffer<Types...> cond::persistency::BulkInserter< Types >::m_buffer
private

Definition at line 660 of file DbCore.h.

template<typename... Types>
std::unique_ptr<coral::IBulkOperation> cond::persistency::BulkInserter< Types >::m_coralInserter
private

Definition at line 661 of file DbCore.h.

template<typename... Types>
coral::ISchema& cond::persistency::BulkInserter< Types >::m_schema
private

Definition at line 657 of file DbCore.h.

template<typename... Types>
std::string cond::persistency::BulkInserter< Types >::m_tableName
private

Definition at line 658 of file DbCore.h.