OmniSciDB  2e3a973ef4
ForeignTableRefresh.h
Go to the documentation of this file.
1 /*
2  * Copyright 2020 OmniSci, 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 #pragma once
18 
19 #include <string>
20 
21 #include "Catalog/Catalog.h"
22 
23 namespace foreign_storage {
25  const std::string& table_name,
26  const bool evict_cached_entries);
27 
29  public:
30  static void start(std::atomic<bool>& is_program_running);
31  static void stop();
32 
33  // The following methods are for testing purposes only
34  static void setWaitDuration(int64_t duration_in_seconds);
35  static bool isRunning();
36  static bool hasRefreshedTable();
37  static void resetHasRefreshedTable();
38 
39  private:
40  static bool is_scheduler_running_;
41  static std::chrono::seconds thread_wait_duration_;
42  static std::thread scheduler_thread_;
43  static std::atomic<bool> has_refreshed_table_;
44 };
45 } // namespace foreign_storage
class for a per-database catalog. also includes metadata for the current database and the current use...
Definition: Catalog.h:97
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)
This file contains the class specification and related data structures for Catalog.
static void start(std::atomic< bool > &is_program_running)