OmniSciDB
bf83d84833
|
#include <ForeignTable.h>
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... | |
![]() | |
TableDescriptor () | |
virtual | ~TableDescriptor ()=default |
bool | isForeignTable () const |
bool | isTemporaryTable () const |
![]() | |
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 ForeignServer * | foreign_server |
int64_t | last_refresh_time {NULL_REFRESH_TIME} |
int64_t | next_refresh_time {NULL_REFRESH_TIME} |
![]() | |
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_ |
![]() | |
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 |
Definition at line 34 of file ForeignTable.h.
foreign_storage::ForeignTable::ForeignTable | ( | ) |
Definition at line 28 of file ForeignTable.cpp.
References ALL_REFRESH_UPDATE_TYPE, MANUAL_REFRESH_TIMING_TYPE, REFRESH_TIMING_TYPE_KEY, and REFRESH_UPDATE_TYPE_KEY.
|
inline |
Definition at line 37 of file ForeignTable.h.
References TableDescriptor::tableId.
|
static |
Creates an options map from given options. Converts options that must be upper case appropriately.
Referenced by AlterForeignTableCommand::alterOptions().
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().
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().
|
private |
|
static |
Verifies that the given options map only contains options that can be legally altered.
Referenced by AlterForeignTableCommand::alterOptions().
|
private |
|
private |
void foreign_storage::ForeignTable::validateOptionValues | ( | ) | const |
Verifies the values for mapped options are valid.
|
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().
|
static |
Definition at line 57 of file ForeignTable.h.
Referenced by ForeignTable().
|
inlinestatic |
Definition at line 79 of file ForeignTable.h.
|
static |
Definition at line 58 of file ForeignTable.h.
|
static |
Definition at line 50 of file ForeignTable.h.
const ForeignServer* foreign_storage::ForeignTable::foreign_server |
Definition at line 63 of file ForeignTable.h.
Referenced by foreign_storage::ParquetDataWrapper::ParquetDataWrapper(), foreign_storage::CsvDataWrapper::populateChunkMetadata(), foreign_storage::CsvDataWrapper::populateChunks(), foreign_storage::CsvDataWrapper::restoreDataWrapperInternals(), CreateForeignTableCommand::setTableDetails(), foreign_storage::ParquetDataWrapper::validateFilePath(), and foreign_storage::CsvDataWrapper::validateFilePath().
|
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.
|
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().
|
static |
Definition at line 61 of file ForeignTable.h.
Referenced by foreign_storage::get_next_refresh_time(), and Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_next_refresh_time().
|
static |
Definition at line 54 of file ForeignTable.h.
Referenced by foreign_storage::get_next_refresh_time().
|
static |
Definition at line 53 of file ForeignTable.h.
Referenced by foreign_storage::get_next_refresh_time().
|
static |
Definition at line 52 of file ForeignTable.h.
Referenced by ForeignTable(), Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_next_refresh_time(), and Catalog_Namespace::Catalog::getAllForeignTablesForRefresh().
|
static |
Definition at line 55 of file ForeignTable.h.
Referenced by ForeignTable().
|
static |
Definition at line 59 of file ForeignTable.h.
Referenced by Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_next_refresh_time(), and Catalog_Namespace::Catalog::getAllForeignTablesForRefresh().
|
inlinestatic |
Definition at line 65 of file ForeignTable.h.
Referenced by foreign_storage::ParquetDataWrapper::validateOptions().
|
inlinestatic |
Definition at line 72 of file ForeignTable.h.