OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LockMgr.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2022 HEAVY.AI, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include "LockMgr/LockMgrImpl.h"
18 
19 #include <string>
20 
21 #include "Catalog/Catalog.h"
22 #include "LockMgr/LegacyLockMgr.h"
25 #include "Shared/types.h"
26 #include "gen-cpp/CalciteServer.h"
27 
28 namespace lockmgr {
29 
30 namespace helpers {
31 
33  const std::string& tableName) {
34  const auto table_id = cat.getTableId(tableName);
35  if (table_id.has_value()) {
36  ChunkKey chunk_key{cat.getCurrentDB().dbId, table_id.value()};
37  return chunk_key;
38  } else {
40  }
41 }
42 
43 } // namespace helpers
44 
45 } // namespace lockmgr
std::vector< int > ChunkKey
Definition: types.h:36
std::string cat(Ts &&...args)
class for a per-database catalog. also includes metadata for the current database and the current use...
Definition: Catalog.h:143
std::optional< int32_t > getTableId(const std::string &table_name) const
Definition: Catalog.cpp:1878
This file contains the class specification and related data structures for Catalog.
const DBMetadata & getCurrentDB() const
Definition: Catalog.h:265
Checked json field retrieval.
ChunkKey chunk_key_for_table(const Catalog_Namespace::Catalog &cat, const std::string &tableName)
Definition: LockMgr.cpp:32