OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
lockmgr::TableSchemaLockContainer< WriteLock > Class Template Reference

#include <LockMgr.h>

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

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, WriteLock &&lock)
 

Additional Inherited Members

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

Detailed Description

template<>
class lockmgr::TableSchemaLockContainer< WriteLock >

Definition at line 153 of file LockMgr.h.

Constructor & Destructor Documentation

Definition at line 179 of file LockMgr.h.

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

Member Function Documentation

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

Definition at line 156 of file LockMgr.h.

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

158  {
159  VLOG(1) << "Acquiring Table Schema Write Lock for table: " << table_name;
160  auto lock = TableSchemaLockMgr::getWriteLockForTable(cat, table_name);
161  auto ret = TableSchemaLockContainer<WriteLock>(
162  cat.getMetadataForTable(table_name, populate_fragmenter), std::move(lock));
163  validate_table_descriptor_after_lock(ret(), cat, table_name, populate_fragmenter);
164  return ret;
165  }
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 WriteLock getWriteLockForTable(const Catalog_Namespace::Catalog &cat, const std::string &table_name)
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:388

+ Here is the call graph for this function:

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

Definition at line 167 of file LockMgr.h.

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

168  {
169  const auto table_name = cat.getTableName(table_id);
170  if (!table_name.has_value()) {
172  cat.getCurrentDB().dbName,
173  " Cannot acquire write lock");
174  }
175  return acquireTableDescriptor(cat, table_name.value());
176  }
static auto acquireTableDescriptor(Catalog_Namespace::Catalog &cat, const std::string &table_name, const bool populate_fragmenter=true)
Definition: LockMgr.h:156
std::string to_string(char const *&&v)
const DBMetadata & getCurrentDB() const
Definition: Catalog.h:265
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: