OmniSciDB
a5dc49c757
|
#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... | |
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... | |
void | validateAlterOptions (const OptionsMap &options_map) const |
Verifies that the given options map only contains options that can be legally altered. More... | |
void | validateSchema (const std::list< ColumnDescriptor > &columns) const |
Verifies the schema is supported by this foreign table. More... | |
Public Member Functions inherited from TableDescriptor | |
TableDescriptor () | |
virtual | ~TableDescriptor ()=default |
bool | isForeignTable () const |
bool | isTemporaryTable () const |
std::vector< int > | getTableChunkKey (const int getCurrentDBId) 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 |
bool | getOptionAsBool (const std::string_view &key) const |
Static Public Member Functions | |
static OptionsMap | createOptionsMap (const rapidjson::Value &json_options) |
Creates an options map from given options. Converts options that must be upper case appropriately. More... | |
Public Attributes | |
const ForeignServer * | foreign_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 |
bool | is_system_table |
bool | is_in_memory_system_table |
std::shared_ptr< std::mutex > | mutex_ |
Public Attributes inherited from foreign_storage::OptionsContainer | |
OptionsMap | options |
Static Public Attributes | |
static constexpr const char * | FRAGMENT_SIZE_KEY = "FRAGMENT_SIZE" |
static constexpr const char * | MAX_CHUNK_SIZE_KEY = "MAX_CHUNK_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 * | BUFFER_SIZE_KEY = "BUFFER_SIZE" |
static constexpr const char * | PARTITIONS_KEY = "PARTITIONS" |
static constexpr const char * | GEO_VALIDATE_GEOMETRY_KEY = "GEO_VALIDATE_GEOMETRY" |
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 |
Definition at line 25 of file ForeignTable.h.
foreign_storage::ForeignTable::ForeignTable | ( | ) |
Definition at line 29 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 28 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().
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::is_append_table_chunk_key(), foreign_storage::AbstractTextFileDataWrapper::iterativeFileScan(), foreign_storage::AbstractTextFileDataWrapper::populateChunkMetadata(), foreign_storage::refresh_foreign_table_unlocked(), foreign_storage::AbstractTextFileDataWrapper::restoreDataWrapperInternals(), and foreign_storage::AbstractFileStorageDataWrapper::validateFileRollOffOption().
void foreign_storage::ForeignTable::validateAlterOptions | ( | const OptionsMap & | options_map | ) | const |
Verifies that the given options map only contains options that can be legally altered.
Referenced by AlterForeignTableCommand::alterOptions().
|
private |
void foreign_storage::ForeignTable::validateOptionValues | ( | ) | const |
Verifies the values for mapped options are valid.
|
private |
void foreign_storage::ForeignTable::validateSchema | ( | const std::list< ColumnDescriptor > & | columns | ) | const |
Verifies the schema is supported by this foreign table.
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 51 of file ForeignTable.h.
Referenced by ForeignTable(), and anonymous_namespace{DBHandler.cpp}::get_refresh_info().
|
inlinestatic |
Definition at line 76 of file ForeignTable.h.
|
static |
Definition at line 52 of file ForeignTable.h.
Referenced by anonymous_namespace{DBHandler.cpp}::get_refresh_info().
|
static |
Definition at line 47 of file ForeignTable.h.
const ForeignServer* foreign_storage::ForeignTable::foreign_server |
Definition at line 57 of file ForeignTable.h.
Referenced by foreign_storage::ParquetDataWrapper::getAllFilePaths(), foreign_storage::AbstractFileStorageDataWrapper::getFullFilePath(), Catalog_Namespace::Catalog::getSystemTableSchema(), foreign_storage::AbstractTextFileDataWrapper::iterativeFileScan(), foreign_storage::ParquetDataWrapper::ParquetDataWrapper(), foreign_storage::ParquetImporter::ParquetImporter(), foreign_storage::AbstractTextFileDataWrapper::populateChunkMetadata(), foreign_storage::AbstractTextFileDataWrapper::populateChunks(), Catalog_Namespace::Catalog::recreateSystemTableIfUpdated(), Catalog_Namespace::Catalog::reloadForeignTableUnlocked(), foreign_storage::AbstractTextFileDataWrapper::restoreDataWrapperInternals(), CreateForeignTableCommand::setTableDetails(), foreign_storage::Csv::validate_and_get_is_s3_select(), foreign_storage::CsvDataWrapper::validateAndGetIsS3Select(), foreign_storage::AbstractFileStorageDataWrapper::validateFilePath(), and foreign_storage::AbstractFileStorageDataWrapper::validateFilePathOptionKey().
|
static |
Definition at line 41 of file ForeignTable.h.
|
static |
Definition at line 49 of file ForeignTable.h.
Referenced by foreign_storage::LazyParquetChunkLoader::appendRowGroups(), foreign_storage::ForeignDataWrapperFactory::createForeignTableProxy(), foreign_storage::LazyParquetChunkLoader::loadRowGroups(), foreign_storage::LazyParquetChunkLoader::metadataScan(), foreign_storage::CsvFileBufferParser::validateAndGetCopyParams(), and foreign_storage::RegexFileBufferParser::validateAndGetCopyParams().
int64_t foreign_storage::ForeignTable::last_refresh_time {NULL_REFRESH_TIME} |
Definition at line 58 of file ForeignTable.h.
Referenced by heavydb.thrift.ttypes.TTableRefreshInfo::read(), Catalog_Namespace::Catalog::reloadForeignTableUnlocked(), and heavydb.thrift.ttypes.TTableRefreshInfo::write().
|
static |
Definition at line 54 of file ForeignTable.h.
Referenced by ForeignTable(), and anonymous_namespace{DBHandler.cpp}::get_refresh_info().
|
static |
Definition at line 42 of file ForeignTable.h.
int64_t foreign_storage::ForeignTable::next_refresh_time {NULL_REFRESH_TIME} |
Definition at line 58 of file ForeignTable.h.
Referenced by Catalog_Namespace::Catalog::createTable(), heavydb.thrift.ttypes.TTableRefreshInfo::read(), Catalog_Namespace::Catalog::reloadForeignTableUnlocked(), and heavydb.thrift.ttypes.TTableRefreshInfo::write().
|
static |
Definition at line 55 of file ForeignTable.h.
Referenced by Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_next_refresh_time(), anonymous_namespace{DBHandler.cpp}::get_refresh_info(), and foreign_storage::RefreshTimeCalculator::getNextRefreshTime().
|
static |
Definition at line 48 of file ForeignTable.h.
|
static |
Definition at line 45 of file ForeignTable.h.
Referenced by anonymous_namespace{DBHandler.cpp}::get_refresh_info(), and foreign_storage::RefreshTimeCalculator::getNextRefreshTime().
|
static |
Definition at line 44 of file ForeignTable.h.
Referenced by anonymous_namespace{DBHandler.cpp}::get_refresh_info(), and foreign_storage::RefreshTimeCalculator::getNextRefreshTime().
|
static |
Definition at line 43 of file ForeignTable.h.
Referenced by ForeignTable(), Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_next_refresh_time(), anonymous_namespace{DBHandler.cpp}::get_refresh_info(), and Catalog_Namespace::Catalog::getAllForeignTablesForRefresh().
|
static |
Definition at line 46 of file ForeignTable.h.
Referenced by ForeignTable(), and anonymous_namespace{DBHandler.cpp}::get_refresh_info().
|
static |
Definition at line 53 of file ForeignTable.h.
Referenced by Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_next_refresh_time(), anonymous_namespace{DBHandler.cpp}::get_refresh_info(), and Catalog_Namespace::Catalog::getAllForeignTablesForRefresh().
|
inlinestatic |
Definition at line 60 of file ForeignTable.h.
|
inlinestatic |
Definition at line 69 of file ForeignTable.h.