Struct foreign_storage::ForeignTable

struct ForeignTable : public TableDescriptor, public foreign_storage::OptionsContainer

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

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

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

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.

bool isAppendMode() const

Checks if the table is in append mode.

void validateSchema(const std::list<ColumnDescriptor> &columns) const

Verifies the schema is supported by this foreign table.

Public Members

const ForeignServer *foreign_server
int64_t last_refresh_time = {NULL_REFRESH_TIME}
int64_t next_refresh_time = {NULL_REFRESH_TIME}

Public Static Functions

static OptionsMap createOptionsMap(const rapidjson::Value &json_options)

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

static void validateAlterOptions(const OptionsMap &options_map)

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

Public Static Attributes

constexpr const char *FRAGMENT_SIZE_KEY = "FRAGMENT_SIZE"
constexpr const char *MAX_CHUNK_SIZE_KEY = "MAX_CHUNK_SIZE"
constexpr const char *REFRESH_TIMING_TYPE_KEY = "REFRESH_TIMING_TYPE"
constexpr const char *REFRESH_START_DATE_TIME_KEY = "REFRESH_START_DATE_TIME"
constexpr const char *REFRESH_INTERVAL_KEY = "REFRESH_INTERVAL"
constexpr const char *REFRESH_UPDATE_TYPE_KEY = "REFRESH_UPDATE_TYPE"
constexpr const char *BUFFER_SIZE_KEY = "BUFFER_SIZE"
constexpr const char *PARTITIONS_KEY = "PARTITIONS"
constexpr const char *ALL_REFRESH_UPDATE_TYPE = "ALL"
constexpr const char *APPEND_REFRESH_UPDATE_TYPE = "APPEND"
constexpr const char *SCHEDULE_REFRESH_TIMING_TYPE = "SCHEDULED"
constexpr const char *MANUAL_REFRESH_TIMING_TYPE = "MANUAL"
constexpr int NULL_REFRESH_TIME = -1
const std::set<const char *> supported_options = {FRAGMENT_SIZE_KEY, , , , , , }
const std::set<const char *> upper_case_options{REFRESH_TIMING_TYPE_KEY, , , }
const std::set<const char *> alterable_options = {REFRESH_TIMING_TYPE_KEY, , , , }

Private Functions

void validateDataWrapperOptions() const
void validateRefreshOptionValues() const