25 namespace foreign_storage {
38 for (
const auto& catalog : sys_catalog.getCatalogsForAllDbs()) {
43 auto tables = catalog->getAllForeignTablesForRefresh();
44 for (
auto table :
tables) {
51 }
catch (std::runtime_error& e) {
52 LOG(
ERROR) <<
"Scheduled refresh for table \"" << table->tableName
53 <<
"\" resulted in an error. " << e.what();
67 std::unique_lock<std::mutex> wait_lock(
wait_mutex_);
static std::mutex wait_mutex_
static std::atomic< bool > has_refreshed_table_
static std::condition_variable wait_condition_
static std::thread scheduler_thread_
void refresh_foreign_table(Catalog_Namespace::Catalog &catalog, const std::string &table_name, const bool evict_cached_entries)
static void setWaitDuration(int64_t duration_in_seconds)
static SysCatalog & instance()
static std::chrono::seconds thread_wait_duration_
static bool hasRefreshedTable()
static void resetHasRefreshedTable()
static void start(std::atomic< bool > &is_program_running)
bool g_enable_foreign_table_scheduled_refresh
static std::atomic< bool > is_scheduler_running_