23 namespace foreign_storage {
26 auto execute_write_lock =
45 bool at_least_one_table_refreshed =
false;
46 for (
const auto& catalog : sys_catalog.getCatalogsForAllDbs()) {
51 auto tables = catalog->getAllForeignTablesForRefresh();
52 for (
auto table :
tables) {
59 }
catch (std::runtime_error& e) {
60 LOG(
ERROR) <<
"Scheduled refresh for table \"" << table->tableName
61 <<
"\" resulted in an error. " << e.what();
64 at_least_one_table_refreshed =
true;
67 if (at_least_one_table_refreshed) {
78 std::unique_lock<std::mutex> wait_lock(
wait_mutex_);
static std::shared_ptr< WrapperType< MutexType > > getMutex(const LockType lockType, const KeyType &key)
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 invalidateCaches()
static void setWaitDuration(int64_t duration_in_seconds)
static void invalidateQueryEngineCaches()
static SysCatalog & instance()
std::unique_lock< T > unique_lock
static std::chrono::seconds thread_wait_duration_
static bool hasRefreshedTable()
static void resetHasRefreshedTable()
static void start(std::atomic< bool > &is_program_running)
static std::atomic< bool > is_scheduler_running_