OmniSciDB  bf83d84833
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
foreign_storage::ForeignTable Struct Reference

#include <ForeignTable.h>

+ Inheritance diagram for foreign_storage::ForeignTable:
+ Collaboration diagram for foreign_storage::ForeignTable:

Public Member Functions

 ForeignTable ()
 
 ForeignTable (const int32_t id, const ForeignServer *server, const std::string &options_str, const int64_t last_refresh, const int64_t next_refresh)
 
void validateOptionValues () const
 Verifies the values for mapped options are valid. More...
 
void initializeOptions ()
 Creates an empty option map for the table. Verifies that the required option keys are present and that they contain legal values (as far as they can be checked statically). This is necessary even on a set of empty options because some options may be required based on the options set in the server (e.g. file_path is needed if the server has no base_path). More...
 
void initializeOptions (const rapidjson::Value &options)
 Creates an option map from the given json options. Verifies that the required option keys are present and that they contain legal values (as far as they can be checked statically). More...
 
std::vector< std::string_view > getSupportedDataWrapperOptions () const
 Returns the list of required data wrapper options based on the type of data wrapper. More...
 
void validateSupportedOptionKeys (const OptionsMap &options_map) const
 Verifies that the options_map contains the keys required by a foreign table; including those specified by the table's data wrapper. More...
 
bool isAppendMode () const
 Checks if the table is in append mode. More...
 
std::string getFullFilePath () const
 Returns the path to the source file/dir of the table. Depending on options this may result from a concatenation of server and table path options. More...
 
- Public Member Functions inherited from TableDescriptor
 TableDescriptor ()
 
virtual ~TableDescriptor ()=default
 
bool isForeignTable () const
 
bool isTemporaryTable () const
 
- Public Member Functions inherited from foreign_storage::OptionsContainer
 OptionsContainer ()
 
 OptionsContainer (const OptionsMap &options)
 
 OptionsContainer (const std::string &options_str)
 
void populateOptionsMap (OptionsMap &&options_map, bool clear=false)
 
void populateOptionsMap (const rapidjson::Value &ddl_options, bool clear=false)
 
void populateOptionsMap (const std::string &options_json, bool clear=false)
 
std::string getOptionsAsJsonString () const
 
std::optional< std::string > getOption (const std::string_view &key) const
 

Static Public Member Functions

static OptionsMap create_options_map (const rapidjson::Value &json_options)
 Creates an options map from given options. Converts options that must be upper case appropriately. More...
 
static void validate_alter_options (const OptionsMap &options_map)
 Verifies that the given options map only contains options that can be legally altered. More...
 

Public Attributes

const ForeignServerforeign_server
 
int64_t last_refresh_time {NULL_REFRESH_TIME}
 
int64_t next_refresh_time {NULL_REFRESH_TIME}
 
- Public Attributes inherited from TableDescriptor
int32_t tableId
 
int32_t shard
 
std::string tableName
 
int32_t userId
 
int32_t nColumns
 
bool isView
 
std::string viewSQL
 
std::string fragments
 
Fragmenter_Namespace::FragmenterType fragType
 
int32_t maxFragRows
 
int64_t maxChunkSize
 
int32_t fragPageSize
 
int64_t maxRows
 
std::string partitions
 
std::string keyMetainfo
 
std::shared_ptr
< Fragmenter_Namespace::AbstractFragmenter
fragmenter
 
int32_t nShards
 
int shardedColumnId
 
int sortedColumnId
 
Data_Namespace::MemoryLevel persistenceLevel
 
bool hasDeletedCol
 
std::vector< int > columnIdBySpi_
 
std::string storageType
 
int32_t maxRollbackEpochs
 
std::shared_ptr< std::mutex > mutex_
 
- Public Attributes inherited from foreign_storage::OptionsContainer
OptionsMap options
 

Static Public Attributes

static constexpr const char * FILE_PATH_KEY = "FILE_PATH"
 
static constexpr const char * FRAGMENT_SIZE_KEY = "FRAGMENT_SIZE"
 
static constexpr const char * REFRESH_TIMING_TYPE_KEY = "REFRESH_TIMING_TYPE"
 
static constexpr const char * REFRESH_START_DATE_TIME_KEY = "REFRESH_START_DATE_TIME"
 
static constexpr const char * REFRESH_INTERVAL_KEY = "REFRESH_INTERVAL"
 
static constexpr const char * REFRESH_UPDATE_TYPE_KEY = "REFRESH_UPDATE_TYPE"
 
static constexpr const char * ALL_REFRESH_UPDATE_TYPE = "ALL"
 
static constexpr const char * APPEND_REFRESH_UPDATE_TYPE = "APPEND"
 
static constexpr const char * SCHEDULE_REFRESH_TIMING_TYPE = "SCHEDULED"
 
static constexpr const char * MANUAL_REFRESH_TIMING_TYPE = "MANUAL"
 
static constexpr int NULL_REFRESH_TIME = -1
 
static const std::set< const
char * > 
supported_options
 
static const std::set< const
char * > 
upper_case_options
 
static const std::set< const
char * > 
alterable_options
 

Private Member Functions

void validateDataWrapperOptions () const
 
void validateRefreshOptionValues () const
 
void validateFilePathOptionKey () const
 
void throwFilePathError (const std::string_view &missing_path) const
 

Detailed Description

Definition at line 34 of file ForeignTable.h.

Constructor & Destructor Documentation

foreign_storage::ForeignTable::ForeignTable ( const int32_t  id,
const ForeignServer server,
const std::string &  options_str,
const int64_t  last_refresh,
const int64_t  next_refresh 
)
inline

Definition at line 37 of file ForeignTable.h.

References TableDescriptor::tableId.

42  : OptionsContainer(options_str)
43  , foreign_server(server)
44  , last_refresh_time(last_refresh)
45  , next_refresh_time(next_refresh) {
46  tableId = id;
47  }
const ForeignServer * foreign_server
Definition: ForeignTable.h:63

Member Function Documentation

static OptionsMap foreign_storage::ForeignTable::create_options_map ( const rapidjson::Value &  json_options)
static

Creates an options map from given options. Converts options that must be upper case appropriately.

Referenced by AlterForeignTableCommand::alterOptions().

+ Here is the caller graph for this function:

std::string foreign_storage::ForeignTable::getFullFilePath ( ) const

Returns the path to the source file/dir of the table. Depending on options this may result from a concatenation of server and table path options.

Referenced by foreign_storage::ParquetDataWrapper::getAllFilePaths(), foreign_storage::CsvDataWrapper::populateChunkMetadata(), foreign_storage::CsvDataWrapper::populateChunks(), foreign_storage::CsvDataWrapper::restoreDataWrapperInternals(), foreign_storage::ParquetDataWrapper::validateFilePath(), and foreign_storage::CsvDataWrapper::validateFilePath().

+ Here is the caller graph for this function:

std::vector<std::string_view> foreign_storage::ForeignTable::getSupportedDataWrapperOptions ( ) const

Returns the list of required data wrapper options based on the type of data wrapper.

void foreign_storage::ForeignTable::initializeOptions ( )

Creates an empty option map for the table. Verifies that the required option keys are present and that they contain legal values (as far as they can be checked statically). This is necessary even on a set of empty options because some options may be required based on the options set in the server (e.g. file_path is needed if the server has no base_path).

void foreign_storage::ForeignTable::initializeOptions ( const rapidjson::Value &  options)

Creates an option map from the given json options. Verifies that the required option keys are present and that they contain legal values (as far as they can be checked statically).

bool foreign_storage::ForeignTable::isAppendMode ( ) const

Checks if the table is in append mode.

Referenced by foreign_storage::ParquetDataWrapper::fetchChunkMetadata(), foreign_storage::CsvDataWrapper::populateChunkMetadata(), and foreign_storage::CsvDataWrapper::restoreDataWrapperInternals().

+ Here is the caller graph for this function:

void foreign_storage::ForeignTable::throwFilePathError ( const std::string_view &  missing_path) const
private
static void foreign_storage::ForeignTable::validate_alter_options ( const OptionsMap options_map)
static

Verifies that the given options map only contains options that can be legally altered.

Referenced by AlterForeignTableCommand::alterOptions().

+ Here is the caller graph for this function:

void foreign_storage::ForeignTable::validateDataWrapperOptions ( ) const
private
void foreign_storage::ForeignTable::validateFilePathOptionKey ( ) const
private
void foreign_storage::ForeignTable::validateOptionValues ( ) const

Verifies the values for mapped options are valid.

void foreign_storage::ForeignTable::validateRefreshOptionValues ( ) const
private
void foreign_storage::ForeignTable::validateSupportedOptionKeys ( const OptionsMap options_map) const

Verifies that the options_map contains the keys required by a foreign table; including those specified by the table's data wrapper.

Referenced by AlterForeignTableCommand::alterOptions().

+ Here is the caller graph for this function:

Member Data Documentation

constexpr const char* foreign_storage::ForeignTable::ALL_REFRESH_UPDATE_TYPE = "ALL"
static

Definition at line 57 of file ForeignTable.h.

Referenced by ForeignTable().

const std::set<const char*> foreign_storage::ForeignTable::alterable_options
inlinestatic
constexpr const char* foreign_storage::ForeignTable::APPEND_REFRESH_UPDATE_TYPE = "APPEND"
static

Definition at line 58 of file ForeignTable.h.

constexpr const char* foreign_storage::ForeignTable::FILE_PATH_KEY = "FILE_PATH"
static

Definition at line 50 of file ForeignTable.h.

constexpr const char* foreign_storage::ForeignTable::FRAGMENT_SIZE_KEY = "FRAGMENT_SIZE"
static

Definition at line 51 of file ForeignTable.h.

int64_t foreign_storage::ForeignTable::last_refresh_time {NULL_REFRESH_TIME}

Definition at line 64 of file ForeignTable.h.

constexpr const char* foreign_storage::ForeignTable::MANUAL_REFRESH_TIMING_TYPE = "MANUAL"
static

Definition at line 60 of file ForeignTable.h.

Referenced by ForeignTable().

int64_t foreign_storage::ForeignTable::next_refresh_time {NULL_REFRESH_TIME}

Definition at line 64 of file ForeignTable.h.

Referenced by Catalog_Namespace::Catalog::createTable().

constexpr int foreign_storage::ForeignTable::NULL_REFRESH_TIME = -1
static
constexpr const char* foreign_storage::ForeignTable::REFRESH_INTERVAL_KEY = "REFRESH_INTERVAL"
static

Definition at line 54 of file ForeignTable.h.

Referenced by foreign_storage::get_next_refresh_time().

constexpr const char* foreign_storage::ForeignTable::REFRESH_START_DATE_TIME_KEY = "REFRESH_START_DATE_TIME"
static

Definition at line 53 of file ForeignTable.h.

Referenced by foreign_storage::get_next_refresh_time().

constexpr const char* foreign_storage::ForeignTable::REFRESH_TIMING_TYPE_KEY = "REFRESH_TIMING_TYPE"
static
constexpr const char* foreign_storage::ForeignTable::REFRESH_UPDATE_TYPE_KEY = "REFRESH_UPDATE_TYPE"
static

Definition at line 55 of file ForeignTable.h.

Referenced by ForeignTable().

constexpr const char* foreign_storage::ForeignTable::SCHEDULE_REFRESH_TIMING_TYPE = "SCHEDULED"
static
const std::set<const char*> foreign_storage::ForeignTable::supported_options
inlinestatic
const std::set<const char*> foreign_storage::ForeignTable::upper_case_options
inlinestatic

The documentation for this struct was generated from the following files: