OmniSciDB  72c90bc290
 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 {
8 
9 size_t get_num_threads(const ForeignTable& table);
10 
12  public:
14 
15  void validateServerOptions(const ForeignServer* foreign_server) const override;
16 
17  void validateTableOptions(const ForeignTable* foreign_table) const override;
18 
19  const std::set<std::string_view>& getSupportedTableOptions() const override;
20 
21  void validateUserMappingOptions(const UserMapping* user_mapping,
22  const ForeignServer* foreign_server) const override;
23 
24  const std::set<std::string_view>& getSupportedUserMappingOptions() const override;
25 
26  const std::set<std::string> getAlterableTableOptions() const override;
27 
28  static shared::FilePathOptions getFilePathOptions(const ForeignTable* foreign_table);
29 
30  inline static const std::string STORAGE_TYPE_KEY = "STORAGE_TYPE";
31  inline static const std::string BASE_PATH_KEY = "BASE_PATH";
32  inline static const std::string FILE_PATH_KEY = "FILE_PATH";
33  inline static const std::string REGEX_PATH_FILTER_KEY = "REGEX_PATH_FILTER";
34  inline static const std::string LOCAL_FILE_STORAGE_TYPE = "LOCAL_FILE";
35  inline static const std::string S3_STORAGE_TYPE = "AWS_S3";
36  inline static const std::string FILE_SORT_ORDER_BY_KEY = shared::FILE_SORT_ORDER_BY_KEY;
37  inline static const std::string FILE_SORT_REGEX_KEY = shared::FILE_SORT_REGEX_KEY;
38  inline static const std::string ALLOW_FILE_ROLL_OFF_KEY = "ALLOW_FILE_ROLL_OFF";
39  inline static const std::string THREADS_KEY = "THREADS";
40 
41  inline static const std::array<std::string, 1> supported_storage_types{
43 
44  protected:
49  static std::string getFullFilePath(const ForeignTable* foreign_table);
50 
51  static bool allowFileRollOff(const ForeignTable* foreign_table);
52 
53  private:
54  static void validateFilePath(const ForeignTable* foreign_table);
55 
56  // A valid path is a concatenation of the file_path and the base_path (for local
57  // storage). One of the two must be present.
58  static void validateFilePathOptionKey(const ForeignTable* foreign_table);
59 
60  static void validateFileRollOffOption(const ForeignTable* foreign_table);
61 
62  static const std::set<std::string_view> supported_table_options_;
63  static const std::set<std::string_view> supported_server_options_;
64  static const std::set<std::string_view> supported_user_mapping_options_;
65 };
66 } // 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
static shared::FilePathOptions getFilePathOptions(const ForeignTable *foreign_table)
const std::string FILE_SORT_REGEX_KEY
shared utility for globbing files, paths can be specified as either a single file, directory or wildcards
size_t get_num_threads(const ForeignTable &table)
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
static void validateFileRollOffOption(const ForeignTable *foreign_table)
const std::set< std::string_view > & getSupportedTableOptions() const override
static bool allowFileRollOff(const ForeignTable *foreign_table)
void validateServerOptions(const ForeignServer *foreign_server) const override
static const std::set< std::string_view > supported_table_options_
const std::set< std::string > getAlterableTableOptions() const override
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)