82 #define SPIMAP_MAGIC1 (std::numeric_limits<unsigned>::max() / 4)
83 #define SPIMAP_MAGIC2 8
84 #define SPIMAP_GEO_PHYSICAL_INPUT(c, i) \
85 (SPIMAP_MAGIC1 + (unsigned)(SPIMAP_MAGIC2 * ((c) + 1) + (i)))
87 namespace File_Namespace {
90 namespace Catalog_Namespace {
94 TableEpochInfo(
const int32_t table_id_param,
const int32_t table_epoch_param)
97 const int32_t table_epoch_param,
98 const size_t leaf_index_param)
106 const std::string& db_name,
107 const std::string& context_msg = {})
108 : std::runtime_error(
"Table/View " + table_name +
" for catalog " + db_name +
109 " does not exist." + context_msg) {}
123 "executor_pool_summary"};
129 "web_server_access_logs"};
153 Catalog(
const std::string& basePath,
155 std::shared_ptr<Data_Namespace::DataMgr> dataMgr,
156 const std::vector<LeafHostInfo>& string_dict_hosts,
157 std::shared_ptr<Calcite> calcite,
175 std::list<ColumnDescriptor>& columns);
177 const std::list<ColumnDescriptor>& columns,
178 const std::vector<Parser::SharedDictionaryDef>& shared_dict_defs,
179 bool isLogicalTable);
182 const std::list<ColumnDescriptor>& columns,
183 const std::vector<Parser::SharedDictionaryDef>& shared_dict_defs);
190 void renameTables(
const std::vector<std::pair<std::string, std::string>>& names);
193 const std::string& newColumnName);
216 const bool populateFragmenter =
true)
const;
218 bool populateFragmenter =
true)
const;
220 std::optional<std::string>
getTableName(int32_t table_id)
const;
221 std::optional<int32_t>
getTableId(
const std::string& table_name)
const;
224 const std::string& colName)
const;
226 const std::optional<std::string>
getColumnName(
int table_id,
int column_id)
const;
230 const size_t spi)
const;
233 const std::string& dashName)
const;
243 const std::string& tableName)
const;
257 const bool fetchSystemColumns,
258 const bool fetchVirtualColumns,
259 const bool fetchPhysicalColumns)
const;
283 bool populate_fragmenter =
true)
const;
311 const std::string& filter_table_name)
const;
313 int32_t
getTableEpoch(
const int32_t db_id,
const int32_t table_id)
const;
314 void setTableEpoch(
const int db_id,
const int table_id,
const int new_epoch);
316 void setMaxRows(
const int32_t table_id,
const int64_t max_rows);
319 const int32_t table_id)
const;
321 const std::vector<TableEpochInfo>& table_epochs)
const;
324 const std::vector<TableEpochInfo>& table_epochs)
const;
330 std::map<int, StringDictionary*>& stringDicts);
345 void checkpoint(
const int logicalTableId)
const;
358 bool file_name_only =
true)
const;
361 bool multiline_formatting =
true,
362 bool dump_defaults =
false)
const;
364 bool multiline_formatting =
true,
365 bool dump_defaults =
false)
const;
367 bool multiline_formatting =
true)
const;
407 const std::string& server_name)
const;
419 const std::string& server_name);
448 const std::string& data_wrapper);
456 const std::string& options);
480 const int32_t foreign_server_id);
495 const rapidjson::Value* filters,
497 std::vector<const foreign_storage::ForeignServer*>& results);
541 bool clear_existing_options =
true);
587 int32_t custom_expression_id);
607 const std::string& expression_json);
616 bool do_soft_delete);
627 const std::string& new_owner);
657 const std::list<ColumnDescriptor>& columns,
658 const std::list<DictDescriptor>& dicts);
661 const bool persist_reference);
664 std::list<ColumnDescriptor>& cdd,
665 std::list<DictDescriptor>& dds,
667 const std::vector<Parser::SharedDictionaryDef>& shared_dict_defs);
669 std::list<DictDescriptor>& dds,
671 bool is_logical_table,
672 bool use_temp_dictionary =
false);
678 const bool is_on_error =
false);
684 std::vector<int>& tableIds);
687 std::list<const ColumnDescriptor*>& colDescs,
688 const bool fetchSystemColumns,
689 const bool fetchVirtualColumns,
690 const bool fetchPhysicalColumns)
const;
693 const size_t shardNumber);
697 const int32_t& user_id,
698 const std::string& dash_role_name);
703 const std::list<ColumnDescriptor>& cds)
const;
728 static const std::string
738 std::vector<std::pair<ColumnDescriptor*, ColumnDescriptor*>>;
758 const std::map<int32_t, std::string>& user_name_by_user_id);
765 const std::map<int32_t, std::string>& user_name_by_user_id);
771 std::set<std::string>& shared_dict_column_names,
776 const std::string& temp_data_dir,
777 const std::unordered_map<int, int>& all_column_ids_map)
const;
779 const std::vector<std::string>& target_paths,
780 const std::string& name_prefix)
const;
784 const std::string& property,
785 const std::string& value);
788 const std::string& property,
789 const std::string& value);
803 const std::string& table_name)
const;
810 std::unique_ptr<foreign_storage::ForeignServer> foreign_server,
814 const std::string& tableName)
const;
823 const std::map<int32_t, std::string>& old_owners_user_name_by_id,
824 const std::map<int32_t, std::vector<DBObject>>& old_owner_db_objects,
825 int32_t new_owner_id);
827 const std::map<int32_t, std::string>& old_owners_user_name_by_id,
828 const std::map<int32_t, std::vector<DBObject>>& old_owner_db_objects,
829 int32_t new_owner_id);
852 const std::string& data_wrapper_type,
854 std::pair<foreign_storage::ForeignTable, std::list<ColumnDescriptor>>
856 const std::string& table_name,
857 const std::string& server_name,
858 const std::vector<std::pair<std::string, SQLTypeInfo>>& column_type_by_name,
859 bool is_in_memory_system_table);
862 const std::list<ColumnDescriptor>& columns);
872 const std::vector<const TableDescriptor*>& physical_tables);
875 bool multiline_formatting,
876 bool dump_defaults)
const;
882 : std::runtime_error{
"No entry found for table: " +
std::to_string(table_id)} {}
885 template <
typename F,
typename... Args>
889 const std::map<std::string, int>& cached_table_map,
890 const std::string& cur_table_name);
std::string dumpCreateTable(const TableDescriptor *td, bool multiline_formatting=true, bool dump_defaults=false) const
static constexpr const char * MEMORY_DETAILS_SYS_TABLE_NAME
void serializeTableJsonUnlocked(const TableDescriptor *td, const std::list< ColumnDescriptor > &cds) const
std::unordered_map< const TableDescriptor *, const ColumnDescriptor * > DeletedColumnPerTableMap
void updateViewUnlocked(TableDescriptor &)
void instantiateFragmenter(TableDescriptor *td) const
void removeFromColumnMap(ColumnDescriptor *cd)
const foreign_storage::ForeignTable * getForeignTable(const std::string &tableName) const
static constexpr const char * WS_SERVER_ACCESS_LOGS_SYS_TABLE_NAME
void initializePermissionsSystemTable()
void deleteMetadataForDashboards(const std::vector< int32_t > ids, const UserMetadata &user)
TableDictColumnsMap dict_columns_by_table_id_
void executeDropTableSqliteQueries(const TableDescriptor *td)
DictRef addDictionaryNontransactional(ColumnDescriptor &cd)
void renameTableDirectories(const std::string &temp_data_dir, const std::vector< std::string > &target_paths, const std::string &name_prefix) const
std::pair< foreign_storage::ForeignTable, std::list< ColumnDescriptor > > getSystemTableSchema(const std::string &table_name, const std::string &server_name, const std::vector< std::pair< std::string, SQLTypeInfo >> &column_type_by_name, bool is_in_memory_system_table)
static constexpr const char * SERVER_LOGS_SYS_TABLE_NAME
specifies the content in-memory of a row in the link metadata view
void eraseTablePhysicalData(const TableDescriptor *td)
static constexpr const char * EXECUTOR_RESOURCE_POOL_SUMMARY_SYS_TABLE_NAME
void conditionallyInitializeSystemObjects()
void CheckAndExecuteMigrations()
~Catalog()
Destructor - deletes all ColumnDescriptor and TableDescriptor structures which were allocated on the ...
std::string getColumnDictDirectory(const ColumnDescriptor *cd, bool file_name_only=true) const
void getDictionary(const ColumnDescriptor &cd, std::map< int, StringDictionary * > &stringDicts)
void initializeUsersSystemTable()
heavyai::shared_mutex sharedMutex_
class for a per-database catalog. also includes metadata for the current database and the current use...
std::vector< TableDescriptor > getAllTableMetadataCopy() const
void deleteCustomExpressions(const std::vector< int32_t > &custom_expression_ids, bool do_soft_delete)
void addReferenceToForeignDict(ColumnDescriptor &referencing_column, Parser::SharedDictionaryDef shared_dict_def, const bool persist_reference)
const ColumnDescriptor * getDeletedColumn(const TableDescriptor *td) const
void setDeletedColumn(const TableDescriptor *td, const ColumnDescriptor *cd)
ColumnDescriptorMap columnDescriptorMap_
void createTable(TableDescriptor &td, const std::list< ColumnDescriptor > &columns, const std::vector< Parser::SharedDictionaryDef > &shared_dict_defs, bool isLogicalTable)
void renameTables(const std::vector< std::pair< std::string, std::string >> &names)
void updateFrontendViewAndLinkUsers()
void createForeignServer(std::unique_ptr< foreign_storage::ForeignServer > foreign_server, bool if_not_exists)
TableEpochInfo(const int32_t table_id_param, const int32_t table_epoch_param, const size_t leaf_index_param)
std::map< ColumnKey, ColumnDescriptor * > ColumnDescriptorMap
std::string dumpCreateServer(const std::string &name, bool multiline_formatting=true) const
void addColumnNontransactional(const TableDescriptor &td, ColumnDescriptor &cd)
std::map< int32_t, std::vector< int32_t >> LogicalToPhysicalTableMapById
TableNotFoundException(const std::string &table_name, const std::string &db_name, const std::string &context_msg={})
Data_Namespace::DataMgr & getDataMgr() const
void reloadCatalogMetadata(const std::map< int32_t, std::string > &user_name_by_user_id)
void delDictionaryTransactional(const ColumnDescriptor &cd)
void addColumn(const TableDescriptor &td, ColumnDescriptor &cd)
int32_t createCustomExpression(std::unique_ptr< CustomExpression > custom_expression)
bool validateNonExistentTableOrView(const std::string &name, const bool if_not_exists)
void setTableFileMgrParams(const int table_id, const File_Namespace::FileMgrParams &file_mgr_params)
std::vector< const TableDescriptor * > getAllForeignTablesForRefresh() const
std::map< int, std::unique_ptr< CustomExpression >> CustomExpressionMapById
const foreign_storage::ForeignServer * getForeignServer(const std::string &server_name) const
std::list< const TableDescriptor * > getAllTableMetadata() const
static constexpr const char * DASHBOARDS_SYS_TABLE_NAME
SqliteConnector sqliteConnector_
const std::vector< LeafHostInfo > string_dict_hosts_
const DBMetadata currentDB_
const TableDescriptor * getCachedTableDescriptor(const std::map< std::string, int > &cached_table_map, const std::string &cur_table_name)
static constexpr const char * ML_METADATA_SERVER_NAME
DictDescriptorMapById dictDescriptorMapByRef_
std::vector< DashboardDescriptor > getAllDashboardsMetadataForSysTable() const
void setColumnDictionary(ColumnDescriptor &cd, std::list< DictDescriptor > &dds, const TableDescriptor &td, bool is_logical_table, bool use_temp_dictionary=false)
void updateDictionarySchema()
void updateDictionaryNames()
std::shared_ptr< Data_Namespace::DataMgr > dataMgr_
const LinkDescriptor * getMetadataForLink(const std::string &link) const
const std::optional< std::string > getColumnName(int table_id, int column_id) const
TableDescriptor * createTableFromDiskUnlocked(int32_t table_id)
void eraseDbPhysicalData()
void dropTableFromJsonUnlocked(const std::string &table_name) const
void buildTablesMapUnlocked()
void setForReload(const int32_t tableId)
int32_t getTableEpoch(const int32_t db_id, const int32_t table_id) const
void deleteTableCatalogMetadata(const TableDescriptor *logical_table, const std::vector< const TableDescriptor * > &physical_tables)
void replaceDashboard(DashboardDescriptor &vd)
void initializeServerLogsSystemTables()
static constexpr std::array< const char *, 6 > INTERNAL_SERVERS
void initializeSystemServers()
std::string dumpCreateTableUnlocked(const TableDescriptor *td, bool multiline_formatting, bool dump_defaults) const
std::vector< std::string > getTableDataDirectories(const TableDescriptor *td) const
void updateCustomExpression(int32_t custom_expression_id, const std::string &expression_json)
void dropColumn(const TableDescriptor &td, const ColumnDescriptor &cd)
void checkDateInDaysColumnMigration()
static constexpr const char * LOGS_SERVER_NAME
void addFrontendViewToMap(DashboardDescriptor &vd)
std::vector< const foreign_storage::ForeignTable * > getAllForeignTablesForForeignServer(const int32_t foreign_server_id)
Get all of the foreign tables for associated with a foreign server id.
std::vector< TableMetadata > getTablesMetadataForUser(const UserMetadata &user_metadata, const GetTablesType get_tables_type, const std::string &filter_table_name) const
void reloadCatalogMetadataUnlocked(const std::map< int32_t, std::string > &user_name_by_user_id)
std::unique_ptr< CustomExpression > getCustomExpressionFromConnector(size_t row)
std::vector< std::pair< int32_t, int32_t > > getAllPersistedTableAndShardIds() const
TableDescriptor * getMutableMetadataForTableUnlocked(int table_id) const
const ColumnDescriptor * getShardColumnMetadataForTable(const TableDescriptor *td) const
void changeForeignServerOwner(const std::string &server_name, const int new_owner_id)
std::optional< int32_t > getTableId(const std::string &table_name) const
std::atomic< std::thread::id > thread_holding_sqlite_lock
void updateFrontendViewSchema()
void renameColumn(const TableDescriptor *td, const ColumnDescriptor *cd, const std::string &newColumnName)
DeletedColumnPerTableMap deletedColumnPerTable_
ColumnDescriptorMapById columnDescriptorMapById_
DashboardDescriptorMap dashboardDescriptorMap_
void setForeignServerOptions(const std::string &server_name, const std::string &options)
std::vector< std::string > getTableNamesForUser(const UserMetadata &user, const GetTablesType get_tables_type) const
void addTableToMap(const TableDescriptor *td, const std::list< ColumnDescriptor > &columns, const std::list< DictDescriptor > &dicts)
void getAllColumnMetadataForTableImpl(const TableDescriptor *td, std::list< const ColumnDescriptor * > &colDescs, const bool fetchSystemColumns, const bool fetchVirtualColumns, const bool fetchPhysicalColumns) const
void initializeMLModelMetadataSystemTable()
void resetTableEpochFloor(const int logicalTableId) const
TableEpochInfo(const int32_t table_id_param, const int32_t table_epoch_param)
void setForeignTableOptions(const std::string &table_name, foreign_storage::OptionsMap &options_map, bool clear_existing_options=true)
static constexpr const char * REQUEST_LOGS_SYS_TABLE_NAME
void recordOwnershipOfObjectsInObjectPermissions()
void updateFrontendViewsToDashboards()
bool filterTableByTypeAndUser(const TableDescriptor *td, const UserMetadata &user_metadata, const GetTablesType get_tables_type) const
const bool checkMetadataForDeletedRecs(const TableDescriptor *td, int column_id) const
void restoreOldOwnersInMemory(const std::map< int32_t, std::string > &old_owners_user_name_by_id, const std::map< int32_t, std::vector< DBObject >> &old_owner_db_objects, int32_t new_owner_id)
std::string quoteIfRequired(const std::string &column_name) const
void initializeMemorySummarySystemTable()
void addColumnTransactional(const TableDescriptor &td, ColumnDescriptor &cd)
std::list< const DashboardDescriptor * > getAllDashboardsMetadata() const
void updateLeaf(const LeafHostInfo &string_dict_host)
void initializeWebServerLogsSystemTables()
NoTableFoundException(int32_t table_id)
void removeChunks(const int table_id) const
static constexpr const char * ROLES_SYS_TABLE_NAME
void reloadForeignTableUnlocked(foreign_storage::ForeignTable &foreign_table)
This file contains the class specification and related data structures for SysCatalog.
DictRef addDictionaryTransactional(ColumnDescriptor &cd)
std::map< ColumnIdKey, ColumnDescriptor * > ColumnDescriptorMapById
void setCalciteMgr(const std::shared_ptr< Calcite > &new_calcite_mgr)
std::string calculateSHA1(const std::string &data)
void gatherAdditionalInfo(std::vector< std::string > &additional_info, std::set< std::string > &shared_dict_column_names, const TableDescriptor *td) const
void initializeDatabasesSystemTable()
void buildLogicalToPhysicalMapUnlocked()
const DBMetadata & getCurrentDB() const
void updateViewsInMapUnlocked()
void addLinkToMap(LinkDescriptor &ld)
std::shared_ptr< Calcite > getCalciteMgr() const
static const std::string getForeignTableSchema(bool if_not_exists=false)
void initializeStorageDetailsSystemTable()
std::list< const DictDescriptor * > getAllDictionariesWithColumnInName(const ColumnDescriptor *cd)
std::map< int, TableDescriptor * > TableDescriptorMapById
const ColumnDescriptor * getDeletedColumnIfRowsDeleted(const TableDescriptor *td) const
void initializeTablesSystemTable()
void adjustAlteredTableFiles(const std::string &temp_data_dir, const std::unordered_map< int, int > &all_column_ids_map) const
std::map< std::string, LinkDescriptor * > LinkDescriptorMap
void restoreOldOwners(const std::map< int32_t, std::string > &old_owners_user_name_by_id, const std::map< int32_t, std::vector< DBObject >> &old_owner_db_objects, int32_t new_owner_id)
void removeColumnDescriptor(const ColumnDescriptor *cd)
void dropForeignServer(const std::string &server_name)
void setDeletedColumnUnlocked(const TableDescriptor *td, const ColumnDescriptor *cd)
void dropTable(const TableDescriptor *td)
void updateDefaultColumnValues()
void buildDashboardsMapUnlocked(const std::map< int32_t, std::string > &user_name_by_user_id)
void initializeRoleAssignmentsSystemTable()
const ColumnDescriptor * getMetadataForColumn(int tableId, const std::string &colName) const
static const std::string getForeignServerSchema(bool if_not_exists=false)
int getDatabaseId() const
const DashboardDescriptor * getMetadataForDashboard(const std::string &userId, const std::string &dashName) const
static constexpr const char * MEMORY_SUMMARY_SYS_TABLE_NAME
TableDescriptorMapById tableDescriptorMapById_
static constexpr const char * EXECUTOR_STATS_SERVER_NAME
int getLogicalTableId(const int physicalTableId) const
void invalidateCachesForTable(const int table_id)
const CustomExpression * getCustomExpression(int32_t custom_expression_id) const
size_t getTotalMemorySizeForDictionariesForDatabase() const
const DictDescriptor * getMetadataForDict(int dict_ref, bool loadDict=true) const
specifies the content in-memory of a row in the column metadata table
static constexpr const char * ROLE_ASSIGNMENTS_SYS_TABLE_NAME
void updateDeletedColumnIndicator()
void updateInColumnMap(ColumnDescriptor *cd, ColumnDescriptor *old_cd)
void execInTransaction(F &&f, Args &&...args)
void removeDiskCachedDataForMutableTable(int32_t table_id) const
void buildDictionaryMapUnlocked()
void setForeignTableProperty(const foreign_storage::ForeignTable *table, const std::string &property, const std::string &value)
static void expandGeoColumn(const ColumnDescriptor &cd, std::list< ColumnDescriptor > &columns)
void buildCustomExpressionsMapUnlocked()
const std::vector< LeafHostInfo > & getStringDictionaryHosts() const
void checkpointWithAutoRollback(const int logical_table_id) const
static constexpr const char * USERS_SYS_TABLE_NAME
std::vector< const TableDescriptor * > getPhysicalTablesDescriptors(const TableDescriptor *logical_table_desc, bool populate_fragmenter=true) const
void setMaxRows(const int32_t table_id, const int64_t max_rows)
void createOrUpdateDashboardSystemRole(const std::string &view_meta, const int32_t &user_id, const std::string &dash_role_name)
const ColumnDescriptor * getMetadataForColumnBySpi(const int tableId, const size_t spi) const
ForeignServerMapById foreignServerMapById_
void alterPhysicalTableMetadata(const TableDescriptor *td, const TableDescriptorUpdateParams &table_update_params)
static constexpr const char * DATABASES_SYS_TABLE_NAME
void rollLegacy(const bool forward)
ForeignServerMap foreignServerMap_
void createShardedTable(TableDescriptor &td, const std::list< ColumnDescriptor > &columns, const std::vector< Parser::SharedDictionaryDef > &shared_dict_defs)
std::map< std::string, std::shared_ptr< foreign_storage::ForeignServer >> ForeignServerMap
void reassignOwners(const std::set< std::string > &old_owners, const std::string &new_owner)
std::vector< const CustomExpression * > getCustomExpressionsForUser(const UserMetadata &user) const
void checkpoint(const int logicalTableId) const
void updateFixlenArrayColumns()
void createForeignServerNoLocks(std::unique_ptr< foreign_storage::ForeignServer > foreign_server, bool if_not_exists)
void initializeMemoryDetailsSystemTable()
static constexpr const char * TABLES_SYS_TABLE_NAME
std::vector< std::pair< ColumnDescriptor *, ColumnDescriptor * >> ColumnDescriptorsForRoll
std::shared_ptr< Calcite > calciteMgr_
static const std::string physicalTableNameTag_
void addFrontendViewToMapNoLock(DashboardDescriptor &vd)
void initializeRolesSystemTable()
void reloadTableMetadata(int table_id)
void dropColumnPolicies(const TableDescriptor &td, const ColumnDescriptor &cd)
void setTableEpoch(const int db_id, const int table_id, const int new_epoch)
void alterTableMetadata(const TableDescriptor *td, const TableDescriptorUpdateParams &table_update_params)
static constexpr const char * ML_MODEL_METADATA_SYS_TABLE_NAME
std::vector< std::string > getTableDictDirectories(const TableDescriptor *td) const
void getForeignServersForUser(const rapidjson::Value *filters, const UserMetadata &user, std::vector< const foreign_storage::ForeignServer * > &results)
int getNextAddedColumnId(const TableDescriptor &td)
std::map< DictRef, std::unique_ptr< DictDescriptor >> DictDescriptorMapById
void buildColumnsMapUnlocked()
std::map< std::string, std::shared_ptr< DashboardDescriptor >> DashboardDescriptorMap
static const std::string getCustomExpressionsSchema(bool if_not_exists=false)
static constexpr const char * PERMISSIONS_SYS_TABLE_NAME
std::list< const ColumnDescriptor * > getAllColumnMetadataForTable(const int tableId, const bool fetchSystemColumns, const bool fetchVirtualColumns, const bool fetchPhysicalColumns) const
Returns a list of pointers to constant ColumnDescriptor structs for all the columns from a particular...
const Catalog * getObjForLock()
void dropColumnTransactional(const TableDescriptor &td, const ColumnDescriptor &cd)
static constexpr const char * STORAGE_DETAILS_SYS_TABLE_NAME
int32_t createDashboard(DashboardDescriptor &vd)
void removeTableFromMap(const std::string &tableName, const int tableId, const bool is_on_error=false)
std::map< int32_t, std::set< const ColumnDescriptor * >> TableDictColumnsMap
void removeFragmenterForTable(const int table_id) const
torch::Tensor f(torch::Tensor x, torch::Tensor W_target, torch::Tensor b_target)
bool checkDropRenderGroupColumnsMigration()
std::map< int, LinkDescriptor * > LinkDescriptorMapById
std::map< int, std::shared_ptr< foreign_storage::ForeignServer >> ForeignServerMapById
const std::unique_ptr< const CustomExpression > getCustomExpressionFromStorage(int32_t custom_expression_id)
void initializeRequestLogsSystemTables()
static constexpr const char * CATALOG_SERVER_NAME
std::list< ColumnDescriptor * > sqliteGetColumnsForTableUnlocked(int32_t table_id)
const int getColumnIdBySpiUnlocked(const int table_id, const size_t spi) const
void eraseTableMetadata(const TableDescriptor *td)
bool setColumnSharedDictionary(ColumnDescriptor &cd, std::list< ColumnDescriptor > &cdd, std::list< DictDescriptor > &dds, const TableDescriptor td, const std::vector< Parser::SharedDictionaryDef > &shared_dict_defs)
void updateCustomExpressionsSchema()
void delDictionaryNontransactional(const ColumnDescriptor &cd)
std::set< std::string > getTableDictDirectoryPaths(int32_t table_id) const
void initializeExecutorResourcePoolSummarySystemTable()
void renamePhysicalTables(std::vector< std::pair< std::string, std::string >> &names, std::vector< int > &tableIds)
std::unique_ptr< heavyai::DistributedSharedMutex > dsqliteMutex_
bool isInfoSchemaDb() const
void setTableEpochs(const int32_t db_id, const std::vector< TableEpochInfo > &table_epochs) const
std::map< std::string, std::string, std::less<>> OptionsMap
void setMaxRollbackEpochs(const int32_t table_id, const int32_t max_rollback_epochs)
std::string generatePhysicalTableName(const std::string &logicalTableName, const size_t shardNumber)
std::optional< std::string > getTableName(int32_t table_id) const
void reloadTableMetadataUnlocked(int table_id)
void updateForeignTablesInMapUnlocked()
void buildLinksMapUnlocked()
std::string createLink(LinkDescriptor &ld, size_t min_length)
Descriptor for a dictionary for a string columne.
void updateLogicalToPhysicalTableLinkSchema()
void setUncappedTableEpoch(const std::string &table_name)
void addColumnDescriptor(const ColumnDescriptor *cd)
void alterColumnTypeTransactional(const ColumnDescriptor &cd)
CustomExpressionMapById custom_expr_map_by_id_
std::atomic< std::thread::id > thread_holding_write_lock
foreign_storage::ForeignTable * getForeignTableUnlocked(const std::string &tableName) const
void setForeignServerDataWrapper(const std::string &server_name, const std::string &data_wrapper)
std::unique_ptr< heavyai::DistributedSharedMutex > dcatalogMutex_
void setTableEpochsLogExceptions(const int32_t db_id, const std::vector< TableEpochInfo > &table_epochs) const
static const std::array< std::string, 4 > kAggregatorOnlySystemTables
const TableDescriptor * getMetadataForTable(const std::string &tableName, const bool populateFragmenter=true) const
Returns a pointer to a const TableDescriptor struct matching the provided tableName.
SqliteConnector & getSqliteConnector()
const std::string & getCatalogBasePath() const
void buildForeignServerMapUnlocked()
std::shared_timed_mutex shared_mutex
const std::unique_ptr< const foreign_storage::ForeignTable > getForeignTableFromStorage(int table_id)
void renameLegacyDataWrappers()
void refreshDictionaryCachesForTableUnlocked(const TableDescriptor &td)
void renameTable(const TableDescriptor *td, const std::string &newTableName)
void updateTableDescriptorSchema()
void reloadDictionariesFromDiskUnlocked()
LinkDescriptorMapById linkDescriptorMapById_
std::string dumpSchema(const TableDescriptor *td) const
void updateForeignTableRefreshTimes(const int32_t table_id)
ColumnDescriptorsForRoll columnDescriptorsForRoll
static constexpr const char * MEMORY_STATS_SERVER_NAME
void initializeSystemTables()
bool recreateSystemTableIfUpdated(foreign_storage::ForeignTable &foreign_table, const std::list< ColumnDescriptor > &columns)
void doTruncateTable(const TableDescriptor *td)
void createSystemTableServer(const std::string &server_name, const std::string &data_wrapper_type, const foreign_storage::OptionsMap &options={})
const std::map< int, const ColumnDescriptor * > getDictionaryToColumnMapping()
void renamePhysicalTable(const TableDescriptor *td, const std::string &newTableName)
void renameForeignServer(const std::string &server_name, const std::string &name)
std::vector< DBObject > parseDashboardObjects(const std::string &view_meta, const int &user_id)
static constexpr const char * WS_SERVER_LOGS_SYS_TABLE_NAME
void dropColumnNontransactional(const TableDescriptor &td, const ColumnDescriptor &cd)
void addToColumnMap(ColumnDescriptor *cd)
const std::unique_ptr< const foreign_storage::ForeignServer > getForeignServerFromStorage(const std::string &server_name)
static constexpr const char * STORAGE_STATS_SERVER_NAME
LogicalToPhysicalTableMapById logicalToPhysicalTableMapById_
Catalog()
Constructor builds a hollow catalog used during constructor of other catalogs.
TableDescriptorMap tableDescriptorMap_
void setForeignServerProperty(const std::string &server_name, const std::string &property, const std::string &value)
static thread_local bool thread_holds_read_lock
std::map< std::string, TableDescriptor * > TableDescriptorMap
void initializeDashboardsSystemTable()
LinkDescriptorMap linkDescriptorMap_
void CheckAndExecuteMigrationsPostBuildMaps()
std::vector< TableEpochInfo > getTableEpochs(const int32_t db_id, const int32_t table_id) const
const int getColumnIdBySpi(const int tableId, const size_t spi) const
void createDefaultServersIfNotExists()
void truncateTable(const TableDescriptor *td)
void createDashboardSystemRoles()
void initializeWebServerAccessLogsSystemTables()
void updateLogicalToPhysicalTableMap(const int32_t logical_tb_id)