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 716 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 719 of file DbCore.h.

721  //fix me: maybe with
722  //m_coralInserter.reset( schema.tableHandle( std::string(tableName ) ).dataEditor().bulkInsert( m_buffer.get(), cacheSize ) );
723  }
ConditionBuffer< Types... > m_buffer
Definition: DbCore.h:747
coral::ISchema & m_schema
Definition: DbCore.h:744
std::unique_ptr< coral::IBulkOperation > m_coralDeleter
Definition: DbCore.h:748

Member Function Documentation

◆ addStaticCondition()

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

Definition at line 725 of file DbCore.h.

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

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

◆ erase()

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

Definition at line 728 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().

728  {
730  if (!m_coralDeleter.get())
731  m_coralDeleter.reset(m_schema.tableHandle(m_tableName)
732  .dataEditor()
733  .bulkDeleteRows(m_buffer.getClause(), m_buffer.get(), cacheSize));
734  m_coralDeleter->processNextIteration();
735  }
void set(const P &params)
Definition: DbCore.h:223
static constexpr size_t cacheSize
Definition: DbCore.h:718
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:747
coral::ISchema & m_schema
Definition: DbCore.h:744
std::unique_ptr< coral::IBulkOperation > m_coralDeleter
Definition: DbCore.h:748

◆ flush()

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

Definition at line 737 of file DbCore.h.

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

737  {
738  if (m_coralDeleter.get())
739  m_coralDeleter->flush();
740  }
std::unique_ptr< coral::IBulkOperation > m_coralDeleter
Definition: DbCore.h:748

Member Data Documentation

◆ cacheSize

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

Definition at line 718 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 744 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 745 of file DbCore.h.

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