OmniSciDB  c1a53651b2
 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 121 of file LockMgr.h.

Constructor & Destructor Documentation

Definition at line 147 of file LockMgr.h.

148  : 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 124 of file LockMgr.h.

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

126  {
127  VLOG(1) << "Acquiring Table Schema Read Lock for table: " << table_name;
128  auto lock = TableSchemaLockMgr::getReadLockForTable(cat, table_name);
129  auto ret = TableSchemaLockContainer<ReadLock>(
130  cat.getMetadataForTable(table_name, populate_fragmenter), std::move(lock));
131  validate_table_descriptor_after_lock(ret(), cat, table_name, populate_fragmenter);
132  return ret;
133  }
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
static ReadLock getReadLockForTable(Catalog_Namespace::Catalog &cat, const std::string &table_name)
Definition: LockMgrImpl.h:238
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:387

+ 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 135 of file LockMgr.h.

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

136  {
137  const auto table_name = cat.getTableName(table_id);
138  if (!table_name.has_value()) {
139  throw std::runtime_error("Table/View ID " + std::to_string(table_id) +
140  " for catalog " + cat.getCurrentDB().dbName +
141  " does not exist. Cannot aquire read lock");
142  }
143  return acquireTableDescriptor(cat, table_name.value());
144  }
std::string to_string(char const *&&v)
const DBMetadata & getCurrentDB() const
Definition: Catalog.h:248
static auto acquireTableDescriptor(Catalog_Namespace::Catalog &cat, const std::string &table_name, const bool populate_fragmenter=true)
Definition: LockMgr.h:124
std::optional< std::string > getTableName(int32_t table_id) const
Definition: Catalog.cpp:1964

+ Here is the call graph for this function:


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