CMS 3D CMS Logo

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

#include <DbCore.h>

Public Member Functions

void addStaticCondition (const std::string &condition)
 
 BulkDeleter (coral::ISchema &schema, const char *tableName)
 
template<typename P >
void erase (const P &params)
 
void flush ()
 

Static Public Attributes

static constexpr size_t cacheSize = 1000
 

Private Attributes

ConditionBuffer< Types... > m_buffer
 
std::unique_ptr< coral::IBulkOperation > m_coralDeleter
 
coral::ISchema & m_schema
 
std::string m_tableName
 

Detailed Description

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

Definition at line 709 of file DbCore.h.

Constructor & Destructor Documentation

◆ BulkDeleter()

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

Definition at line 712 of file DbCore.h.

714  //fix me: maybe with
715  //m_coralInserter.reset( schema.tableHandle( std::string(tableName ) ).dataEditor().bulkInsert( m_buffer.get(), cacheSize ) );
716  }
ConditionBuffer< Types... > m_buffer
Definition: DbCore.h:740
coral::ISchema & m_schema
Definition: DbCore.h:737
std::unique_ptr< coral::IBulkOperation > m_coralDeleter
Definition: DbCore.h:741

Member Function Documentation

◆ addStaticCondition()

template<typename... Types>
void cond::persistency::BulkDeleter< Types >::addStaticCondition ( const std::string &  condition)
inline

Definition at line 718 of file DbCore.h.

References cond::persistency::ConditionBuffer< Columns >::addStaticCondition(), and cond::persistency::BulkDeleter< Types >::m_buffer.

718 { m_buffer.addStaticCondition(condition); }
void addStaticCondition(const std::string &condition)
Definition: DbCore.h:228
ConditionBuffer< Types... > m_buffer
Definition: DbCore.h:740

◆ erase()

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

Definition at line 721 of file DbCore.h.

References cond::persistency::BulkDeleter< Types >::cacheSize, cond::persistency::ConditionBuffer< Columns >::get(), cond::persistency::ConditionBuffer< Columns >::getClause(), cond::persistency::BulkDeleter< Types >::m_buffer, cond::persistency::BulkDeleter< Types >::m_coralDeleter, cond::persistency::BulkDeleter< Types >::m_schema, cond::persistency::BulkDeleter< Types >::m_tableName, submitPVValidationJobs::params, and cond::persistency::ConditionBuffer< Columns >::set().

721  {
723  if (!m_coralDeleter.get())
724  m_coralDeleter.reset(m_schema.tableHandle(m_tableName)
725  .dataEditor()
726  .bulkDeleteRows(m_buffer.getClause(), m_buffer.get(), cacheSize));
727  m_coralDeleter->processNextIteration();
728  }
void set(const P &params)
Definition: DbCore.h:223
static constexpr size_t cacheSize
Definition: DbCore.h:711
const std::string & getClause() const
Definition: DbCore.h:237
const coral::AttributeList & get() const
Definition: DbCore.h:235
ConditionBuffer< Types... > m_buffer
Definition: DbCore.h:740
coral::ISchema & m_schema
Definition: DbCore.h:737
std::unique_ptr< coral::IBulkOperation > m_coralDeleter
Definition: DbCore.h:741

◆ flush()

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

Definition at line 730 of file DbCore.h.

References cond::persistency::BulkDeleter< Types >::m_coralDeleter.

730  {
731  if (m_coralDeleter.get())
732  m_coralDeleter->flush();
733  }
std::unique_ptr< coral::IBulkOperation > m_coralDeleter
Definition: DbCore.h:741

Member Data Documentation

◆ cacheSize

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

Definition at line 711 of file DbCore.h.

Referenced by cond::persistency::BulkDeleter< Types >::erase().

◆ m_buffer

template<typename... Types>
ConditionBuffer<Types...> cond::persistency::BulkDeleter< Types >::m_buffer
private

◆ m_coralDeleter

template<typename... Types>
std::unique_ptr<coral::IBulkOperation> cond::persistency::BulkDeleter< Types >::m_coralDeleter
private

◆ m_schema

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

Definition at line 737 of file DbCore.h.

Referenced by cond::persistency::BulkDeleter< Types >::erase().

◆ m_tableName

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

Definition at line 738 of file DbCore.h.

Referenced by cond::persistency::BulkDeleter< Types >::erase().