OmniSciDB  471d68cefb
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AbstractFileStorageDataWrapper.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "ForeignDataWrapper.h"
4 
6 
7 namespace foreign_storage {
9  public:
11 
12  void validateServerOptions(const ForeignServer* foreign_server) const override;
13 
14  void validateTableOptions(const ForeignTable* foreign_table) const override;
15 
16  const std::set<std::string_view>& getSupportedTableOptions() const override;
17 
18  void validateUserMappingOptions(const UserMapping* user_mapping,
19  const ForeignServer* foreign_server) const override;
20 
21  const std::set<std::string_view>& getSupportedUserMappingOptions() const override;
22 
23  inline static const std::string STORAGE_TYPE_KEY = "STORAGE_TYPE";
24  inline static const std::string BASE_PATH_KEY = "BASE_PATH";
25  inline static const std::string FILE_PATH_KEY = "FILE_PATH";
26  inline static const std::string REGEX_PATH_FILTER_KEY = "REGEX_PATH_FILTER";
27  inline static const std::string LOCAL_FILE_STORAGE_TYPE = "LOCAL_FILE";
28  inline static const std::string S3_STORAGE_TYPE = "AWS_S3";
29  inline static const std::string FILE_SORT_ORDER_BY_KEY = shared::FILE_SORT_ORDER_BY_KEY;
30  inline static const std::string FILE_SORT_REGEX_KEY = shared::FILE_SORT_REGEX_KEY;
31 
32  inline static const std::array<std::string, 1> supported_storage_types{
34 
35  protected:
40  static std::string getFullFilePath(const ForeignTable* foreign_table);
41 
42  private:
43  static void validateFilePath(const ForeignTable* foreign_table);
44 
45  // A valid path is a concatenation of the file_path and the base_path (for local
46  // storage). One of the two must be present.
47  static void validateFilePathOptionKey(const ForeignTable* foreign_table);
48 
49  static const std::set<std::string_view> supported_table_options_;
50  static const std::set<std::string_view> supported_server_options_;
51  static const std::set<std::string_view> supported_user_mapping_options_;
52 };
53 } // namespace foreign_storage
const std::set< std::string_view > & getSupportedUserMappingOptions() const override
static void validateFilePathOptionKey(const ForeignTable *foreign_table)
static const std::array< std::string, 1 > supported_storage_types
const std::string FILE_SORT_REGEX_KEY
shared utility for globbing files, paths can be specified as either a single file, directory or wildcards
void validateUserMappingOptions(const UserMapping *user_mapping, const ForeignServer *foreign_server) const override
static const std::set< std::string_view > supported_server_options_
void validateTableOptions(const ForeignTable *foreign_table) const override
static const std::set< std::string_view > supported_user_mapping_options_
const std::string FILE_SORT_ORDER_BY_KEY
const std::set< std::string_view > & getSupportedTableOptions() const override
void validateServerOptions(const ForeignServer *foreign_server) const override
static const std::set< std::string_view > supported_table_options_
static std::string getFullFilePath(const ForeignTable *foreign_table)
Returns the path to the source file/dir of the table. Depending on options this may result from a con...
static void validateFilePath(const ForeignTable *foreign_table)