21 namespace foreign_storage {
23 const std::string& table_name,
24 const bool evict_cached_entries) {
27 std::make_unique<lockmgr::TableSchemaLockContainer<lockmgr::WriteLock>>(
29 catalog, table_name,
false));
33 throw std::runtime_error{
35 " is not a foreign table. Refreshes are applicable to only foreign tables."};
44 data_mgr.getPersistentStorageMgr()->getForeignStorageMgr()->refreshTable(
45 table_key, evict_cached_entries);
56 while (is_program_running) {
58 for (
const auto& catalog : sys_catalog.getCatalogsForAllDbs()) {
59 auto tables = catalog->getAllForeignTablesForRefresh();
60 for (
auto table :
tables) {
63 }
catch (std::runtime_error& e) {
64 LOG(
ERROR) <<
"Scheduled refresh for table \"" << table->tableName
65 <<
"\" resulted in an error. " << e.what();
static std::atomic< bool > has_refreshed_table_
std::vector< int > ChunkKey
class for a per-database catalog. also includes metadata for the current database and the current use...
Data_Namespace::DataMgr & getDataMgr() const
static std::thread scheduler_thread_
void refresh_foreign_table(Catalog_Namespace::Catalog &catalog, const std::string &table_name, const bool evict_cached_entries)
std::runtime_error getOriginalException()
static void setWaitDuration(int64_t duration_in_seconds)
static SysCatalog & instance()
const DBMetadata & getCurrentDB() const
static std::chrono::seconds thread_wait_duration_
static bool hasRefreshedTable()
static void resetHasRefreshedTable()
static void start(std::atomic< bool > &is_program_running)
void removeFragmenterForTable(const int table_id)
static constexpr char const * FOREIGN_TABLE
void updateForeignTableRefreshTimes(const int32_t table_id)
static bool is_scheduler_running_