OmniSciDB  8a228a1076
lockmgr::TableSchemaLockContainer< ReadLock > Class Template Reference

#include <LockMgr.h>

+ Inheritance diagram for lockmgr::TableSchemaLockContainer< ReadLock >:
+ Collaboration diagram for lockmgr::TableSchemaLockContainer< ReadLock >:

Static Public Member Functions

static auto acquireTableDescriptor (const Catalog_Namespace::Catalog &cat, const std::string &table_name, const bool populate_fragmenter=true)
 
static auto acquireTableDescriptor (const Catalog_Namespace::Catalog &cat, const int table_id)
 

Private Member Functions

 TableSchemaLockContainer (const TableDescriptor *obj, ReadLock &&lock)
 

Additional Inherited Members

- Public Member Functions inherited from lockmgr::LockContainerImpl< const TableDescriptor *, ReadLock >
const TableDescriptoroperator() () const final
 
- Public Member Functions inherited from lockmgr::AbstractLockContainer< const TableDescriptor * >
virtual ~AbstractLockContainer ()
 
- Protected Member Functions inherited from lockmgr::LockContainerImpl< const TableDescriptor *, ReadLock >
 LockContainerImpl (const TableDescriptor * obj, ReadLock &&lock)
 
- Protected Member Functions inherited from lockmgr::TableLockContainerImpl
 TableLockContainerImpl (const std::string &table_name)
 
- Protected Attributes inherited from lockmgr::LockContainerImpl< const TableDescriptor *, ReadLock >
const TableDescriptorobj_
 
ReadLock lock_
 
- Protected Attributes inherited from lockmgr::TableLockContainerImpl
std::string table_name_
 

Detailed Description

template<>
class lockmgr::TableSchemaLockContainer< ReadLock >

Definition at line 106 of file LockMgr.h.

Constructor & Destructor Documentation

◆ TableSchemaLockContainer()

Definition at line 132 of file LockMgr.h.

133  : LockContainerImpl<const TableDescriptor*, ReadLock>(obj, std::move(lock))
134  , TableLockContainerImpl(obj ? obj->tableName : "") {}
std::string tableName
TableLockContainerImpl(const std::string &table_name)
Definition: LockMgr.h:89

Member Function Documentation

◆ acquireTableDescriptor() [1/2]

static auto lockmgr::TableSchemaLockContainer< ReadLock >::acquireTableDescriptor ( const Catalog_Namespace::Catalog cat,
const std::string &  table_name,
const bool  populate_fragmenter = true 
)
inlinestatic

Definition at line 110 of file LockMgr.h.

References Catalog_Namespace::Catalog::getMetadataForTable(), lockmgr::TableLockMgrImpl< TableSchemaLockMgr >::getReadLockForTable(), and VLOG.

112  {
113  VLOG(1) << "Acquiring Table Schema Read Lock for table: " << table_name;
114  return TableSchemaLockContainer<ReadLock>(
115  cat.getMetadataForTable(table_name, populate_fragmenter),
116  TableSchemaLockMgr::getReadLockForTable(cat, table_name));
117  }
static ReadLock getReadLockForTable(const Catalog_Namespace::Catalog &cat, const std::string &table_name)
Definition: LockMgrImpl.h:164
const TableDescriptor * getMetadataForTable(const std::string &tableName, const bool populateFragmenter=true) const
Returns a pointer to a const TableDescriptor struct matching the provided tableName.
#define VLOG(n)
Definition: Logger.h:291
+ Here is the call graph for this function:

◆ acquireTableDescriptor() [2/2]

static auto lockmgr::TableSchemaLockContainer< ReadLock >::acquireTableDescriptor ( const Catalog_Namespace::Catalog cat,
const int  table_id 
)
inlinestatic

Definition at line 119 of file LockMgr.h.

References Catalog_Namespace::Catalog::getMetadataForTable(), lockmgr::TableLockMgrImpl< TableSchemaLockMgr >::getReadLockForTable(), to_string(), and VLOG.

120  {
121  const auto td = cat.getMetadataForTable(table_id);
122  if (!td) {
123  throw std::runtime_error("Table/View ID " + std::to_string(table_id) +
124  " does not exist.");
125  }
126  VLOG(1) << "Acquiring Table Schema Read Lock for table: " << td->tableName;
127  return TableSchemaLockContainer<ReadLock>(
128  td, TableSchemaLockMgr::getReadLockForTable(cat, td->tableName));
129  }
static ReadLock getReadLockForTable(const Catalog_Namespace::Catalog &cat, const std::string &table_name)
Definition: LockMgrImpl.h:164
const TableDescriptor * getMetadataForTable(const std::string &tableName, const bool populateFragmenter=true) const
Returns a pointer to a const TableDescriptor struct matching the provided tableName.
std::string to_string(char const *&&v)
#define VLOG(n)
Definition: Logger.h:291
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: