OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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...
 
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 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
 
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
 

Detailed Description

Definition at line 25 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 28 of file ForeignTable.h.

References TableDescriptor::tableId.

33  : OptionsContainer(options_str)
34  , foreign_server(server)
35  , last_refresh_time(last_refresh)
36  , next_refresh_time(next_refresh) {
37  tableId = id;
38  }
const ForeignServer * foreign_server
Definition: ForeignTable.h:57

Member Function Documentation

static OptionsMap foreign_storage::ForeignTable::createOptionsMap ( 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:

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).

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().

+ Here is the caller graph for this function:

void foreign_storage::ForeignTable::validateDataWrapperOptions ( ) 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::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().

+ Here is the caller graph for this function:

Member Data Documentation

constexpr const char* foreign_storage::ForeignTable::ALL_REFRESH_UPDATE_TYPE = "ALL"
static
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 52 of file ForeignTable.h.

Referenced by anonymous_namespace{DBHandler.cpp}::get_refresh_info().

constexpr const char* foreign_storage::ForeignTable::BUFFER_SIZE_KEY = "BUFFER_SIZE"
static

Definition at line 47 of file ForeignTable.h.

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

Definition at line 41 of file ForeignTable.h.

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

Definition at line 42 of file ForeignTable.h.

constexpr const char* foreign_storage::ForeignTable::PARTITIONS_KEY = "PARTITIONS"
static

Definition at line 48 of file ForeignTable.h.

constexpr const char* foreign_storage::ForeignTable::REFRESH_INTERVAL_KEY = "REFRESH_INTERVAL"
static
constexpr const char* foreign_storage::ForeignTable::REFRESH_START_DATE_TIME_KEY = "REFRESH_START_DATE_TIME"
static
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
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: