OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 (Catalog_Namespace::Catalog &cat, const std::string &table_name, const bool populate_fragmenter=true)
 
static auto acquireTableDescriptor (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 Attributes inherited from lockmgr::LockContainerImpl< const TableDescriptor *, ReadLock >
const TableDescriptorobj_
 
ReadLock lock_
 

Detailed Description

template<>
class lockmgr::TableSchemaLockContainer< ReadLock >

Definition at line 122 of file LockMgr.h.

Constructor & Destructor Documentation

Definition at line 148 of file LockMgr.h.

149  : LockContainerImpl<const TableDescriptor*, ReadLock>(obj, std::move(lock)) {}

Member Function Documentation

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

Definition at line 125 of file LockMgr.h.

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

127  {
128  VLOG(1) << "Acquiring Table Schema Read Lock for table: " << table_name;
129  auto lock = TableSchemaLockMgr::getReadLockForTable(cat, table_name);
130  auto ret = TableSchemaLockContainer<ReadLock>(
131  cat.getMetadataForTable(table_name, populate_fragmenter), std::move(lock));
132  validate_table_descriptor_after_lock(ret(), cat, table_name, populate_fragmenter);
133  return ret;
134  }
void validate_table_descriptor_after_lock(const TableDescriptor *td_prelock, const Catalog_Namespace::Catalog &cat, const std::string &table_name, const bool populate_fragmenter)
Definition: LockMgr.h:98
const TableDescriptor * getMetadataForTable(const std::string &tableName, const bool populateFragmenter=true) const
Returns a pointer to a const TableDescriptor struct matching the provided tableName.
static ReadLock getReadLockForTable(Catalog_Namespace::Catalog &cat, const std::string &table_name)
#define VLOG(n)
Definition: Logger.h:388

+ Here is the call graph for this function:

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

Definition at line 136 of file LockMgr.h.

References Catalog_Namespace::DBMetadata::dbName, Catalog_Namespace::Catalog::getCurrentDB(), Catalog_Namespace::Catalog::getTableName(), and to_string().

137  {
138  const auto table_name = cat.getTableName(table_id);
139  if (!table_name.has_value()) {
141  cat.getCurrentDB().dbName,
142  " Cannot acquire read lock");
143  }
144  return acquireTableDescriptor(cat, table_name.value());
145  }
std::string to_string(char const *&&v)
const DBMetadata & getCurrentDB() const
Definition: Catalog.h:265
static auto acquireTableDescriptor(Catalog_Namespace::Catalog &cat, const std::string &table_name, const bool populate_fragmenter=true)
Definition: LockMgr.h:125
std::optional< std::string > getTableName(int32_t table_id) const
Definition: Catalog.cpp:1872

+ Here is the call graph for this function:


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