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 constexpr 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 684 of file DbCore.h.

Constructor & Destructor Documentation

◆ BulkInserter()

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

Definition at line 687 of file DbCore.h.

689  //fix me: maybe with
690  //m_coralInserter.reset( schema.tableHandle( std::string(tableName ) ).dataEditor().bulkInsert( m_buffer.get(), cacheSize ) );
691  }
RowBuffer< Types... > m_buffer
Definition: DbCore.h:711
coral::ISchema & m_schema
Definition: DbCore.h:708
std::unique_ptr< coral::IBulkOperation > m_coralInserter
Definition: DbCore.h:712

Member Function Documentation

◆ flush()

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

◆ insert()

template<typename... Types>
template<typename P >
void cond::persistency::BulkInserter< Types >::insert ( const P params)
inline

Definition at line 694 of file DbCore.h.

References cond::persistency::BulkInserter< Types >::cacheSize, cond::persistency::RowBuffer< Columns >::get(), cond::persistency::BulkInserter< Types >::m_buffer, cond::persistency::BulkInserter< Types >::m_coralInserter, cond::persistency::BulkInserter< Types >::m_schema, cond::persistency::BulkInserter< Types >::m_tableName, submitPVValidationJobs::params, and cond::persistency::RowBuffer< Columns >::set().

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

694  {
696  if (!m_coralInserter.get())
697  m_coralInserter.reset(m_schema.tableHandle(m_tableName).dataEditor().bulkInsert(m_buffer.get(), cacheSize));
698  m_coralInserter->processNextIteration();
699  }
void set(const P &params)
Definition: DbCore.h:195
RowBuffer< Types... > m_buffer
Definition: DbCore.h:711
const coral::AttributeList & get() const
Definition: DbCore.h:201
static constexpr size_t cacheSize
Definition: DbCore.h:686
coral::ISchema & m_schema
Definition: DbCore.h:708
std::unique_ptr< coral::IBulkOperation > m_coralInserter
Definition: DbCore.h:712

Member Data Documentation

◆ cacheSize

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

Definition at line 686 of file DbCore.h.

Referenced by cond::persistency::BulkInserter< Types >::insert().

◆ m_buffer

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

Definition at line 711 of file DbCore.h.

Referenced by cond::persistency::BulkInserter< Types >::insert().

◆ m_coralInserter

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

◆ m_schema

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

Definition at line 708 of file DbCore.h.

Referenced by cond::persistency::BulkInserter< Types >::insert().

◆ m_tableName

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

Definition at line 709 of file DbCore.h.

Referenced by cond::persistency::BulkInserter< Types >::insert().