OmniSciDB  fe05a0c208
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ForeignServer.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 #include <unordered_map>
21 
24 
25 extern bool g_enable_s3_fsi;
26 
27 namespace foreign_storage {
29  int32_t id;
30  std::string name;
31  std::string data_wrapper_type;
32  int32_t user_id;
33  time_t creation_time;
34 
36 
37  ForeignServer(const int32_t server_id,
38  const std::string& server_name,
39  const std::string& data_wrapper_type,
40  const std::string& options_str,
41  const int32_t user_id,
42  const time_t creation_time)
43  : OptionsContainer(options_str)
44  , id(server_id)
45  , name(server_name)
46  , data_wrapper_type(data_wrapper_type)
47  , user_id(user_id)
48  , creation_time(creation_time) {}
49 
50  ForeignServer(const std::string& server_name,
51  const std::string& data_wrapper_type,
52  const std::map<std::string, std::string, std::less<>>& options,
53  const int32_t user_id)
55  , name(server_name)
56  , data_wrapper_type(data_wrapper_type)
57  , user_id(user_id) {}
58 
59  void validate() {
62  }
63 
64  private:
67  .validateServerOptions(this);
68  }
69 };
70 } // namespace foreign_storage
static const ForeignDataWrapper & createForValidation(const std::string &data_wrapper_type, const ForeignTable *foreign_table=nullptr)
bool g_enable_s3_fsi
Definition: Catalog.cpp:93
static void validateDataWrapperType(const std::string &data_wrapper_type)
ForeignServer(const int32_t server_id, const std::string &server_name, const std::string &data_wrapper_type, const std::string &options_str, const int32_t user_id, const time_t creation_time)
Definition: ForeignServer.h:37
ForeignServer(const std::string &server_name, const std::string &data_wrapper_type, const std::map< std::string, std::string, std::less<>> &options, const int32_t user_id)
Definition: ForeignServer.h:50
virtual void validateServerOptions(const ForeignServer *foreign_server) const =0