42 return table_lock_mgr;
59 return insert_data_lock_mgr;
94 template <
typename LOCK_TYPE>
98 static_assert(std::is_same<LOCK_TYPE, ReadLock>::value ||
99 std::is_same<LOCK_TYPE, WriteLock>::value);
111 const std::string& table_name,
112 const bool populate_fragmenter =
true) {
113 VLOG(1) <<
"Acquiring Table Schema Read Lock for table: " << table_name;
120 const int table_id) {
123 throw std::runtime_error(
"Table/View ID " +
std::to_string(table_id) +
125 " does not exist. Cannot aquire read lock");
127 VLOG(1) <<
"Acquiring Table Schema Read Lock for table: " << td->tableName;
144 const std::string& table_name,
145 const bool populate_fragmenter =
true) {
146 VLOG(1) <<
"Acquiring Table Schema Write Lock for table: " << table_name;
153 const int table_id) {
156 throw std::runtime_error(
"Table/View ID " +
std::to_string(table_id) +
158 " does not exist. Cannot aquire write lock");
160 VLOG(1) <<
"Acquiring Table Schema Write Lock for table: " << td->tableName;
171 template <
typename LOCK_TYPE>
175 static_assert(std::is_same<LOCK_TYPE, ReadLock>::value ||
176 std::is_same<LOCK_TYPE, WriteLock>::value);
190 VLOG(1) <<
"Acquiring Table Data Write Lock for table: " << td->
tableName;
209 VLOG(1) <<
"Acquiring Table Data Read Lock for table: " << td->
tableName;
220 template <
typename LOCK_TYPE>
224 static_assert(std::is_same<LOCK_TYPE, ReadLock>::value ||
225 std::is_same<LOCK_TYPE, WriteLock>::value);
239 VLOG(1) <<
"Acquiring Table Insert Write Lock for table: " << td->
tableName;
258 VLOG(1) <<
"Acquiring Table Insert Read Lock for table: " << td->
tableName;
270 std::vector<std::unique_ptr<lockmgr::AbstractLockContainer<const TableDescriptor*>>>;
std::vector< int > ChunkKey
std::vector< std::unique_ptr< lockmgr::AbstractLockContainer< const TableDescriptor * >>> LockedTableDescriptors
static ReadLock getReadLockForTable(const Catalog_Namespace::Catalog &cat, const std::string &table_name)
Locks protecting a physical table object returned from the catalog. Table Metadata Locks prevent inco...
static TableSchemaLockMgr & instance()
class for a per-database catalog. also includes metadata for the current database and the current use...
Locks protecting table data. Read queries take a read lock, while write queries (update, delete) obtain a write lock. Note that insert queries do not currently take a write lock (to allow concurrent inserts). Instead, insert queries obtain a write lock on the table metadata to allow existing read queries to finish (and block new ones) before flushing the inserted data to disk.
TableInsertLockContainer(const TableInsertLockContainer &)=delete
static WriteLock getWriteLockForTable(const Catalog_Namespace::Catalog &cat, const std::string &table_name)
std::string getTableName() const
static auto acquire(const int db_id, const TableDescriptor *td)
TableLockContainerImpl(const std::string &table_name)
static auto acquireTableDescriptor(const Catalog_Namespace::Catalog &cat, const int table_id)
static TableDataLockMgr & instance()
static auto acquire(const int db_id, const TableDescriptor *td)
This file contains the class specification and related data structures for Catalog.
static auto acquireTableDescriptor(const Catalog_Namespace::Catalog &cat, const int table_id)
static auto acquireTableDescriptor(const Catalog_Namespace::Catalog &cat, const std::string &table_name, const bool populate_fragmenter=true)
const DBMetadata & getCurrentDB() const
static auto acquireTableDescriptor(const Catalog_Namespace::Catalog &cat, const std::string &table_name, const bool populate_fragmenter=true)
TableDataLockContainer(const TableDataLockContainer &)=delete
TableSchemaLockContainer(const TableSchemaLockContainer &)=delete
static auto acquire(const int db_id, const TableDescriptor *td)
static InsertDataLockMgr & instance()
static auto acquire(const int db_id, const TableDescriptor *td)
const TableDescriptor * getMetadataForTable(const std::string &tableName, const bool populateFragmenter=true) const
Returns a pointer to a const TableDescriptor struct matching the provided tableName.
Prevents simultaneous inserts into the same table. To allow concurrent Insert/Select queries...