Class foreign_storage::ForeignDataWrapper

class ForeignDataWrapper

Subclassed by foreign_storage::AbstractFileStorageDataWrapper, foreign_storage::InternalSystemDataWrapper, foreign_storage::MockForeignDataWrapper

Public Types

enum ParallelismLevel

ParallelismLevel describes the desired level of parallelism of the data wrapper. This level controls which optional_buffers are passed to populateChunkBuffers with the following behaviour:

NONE - no additional optional buffers are passed in

INTRA_FRAGMENT - additional optional buffers which are in the same fragment as the required buffers

INTER_FRAGMENT - additional optional buffers which may be in different fragments than those of the required buffers

Note, the optional buffers are passed in with the intention of allowing the data wrapper to employ parallelism in retrieving them. Each subsequent level allows for a greater degree of parallelism but does not have to be supported.

Values:

NONE
INTRA_FRAGMENT
INTER_FRAGMENT

Public Functions

ForeignDataWrapper()
virtual ~ForeignDataWrapper()
virtual void populateChunkMetadata(ChunkMetadataVector &chunk_metadata_vector) = 0

Populates given chunk metadata vector with metadata for all chunks in related foreign table.

Parameters
  • chunk_metadata_vector: - vector that will be populated with chunk metadata

virtual void populateChunkBuffers(const ChunkToBufferMap &required_buffers, const ChunkToBufferMap &optional_buffers, AbstractBuffer *delete_buffer = nullptr) = 0

Populates given chunk buffers identified by chunk keys. All provided chunk buffers are expected to be for the same fragment.

Parameters
  • required_buffers: - chunk buffers that must always be populated

  • optional_buffers: - chunk buffers that can be optionally populated, if the data wrapper has to scan through chunk data anyways (typically for row wise data formats)

  • delete_buffer: - chunk buffer for fragment’s delete column, if non-null data wrapper is expected to mark deleted rows in buffer and continue processing

virtual std::string getSerializedDataWrapper() const = 0

Serialize internal state of wrapper into file at given path if implemented

virtual void restoreDataWrapperInternals(const std::string &file_path, const ChunkMetadataVector &chunk_metadata) = 0

Restore internal state of datawrapper

Parameters
  • file_path: - location of file created by serializeMetadata

  • chunk_metadata_vector: - vector of chunk metadata recovered from disk

virtual bool isRestored() const = 0
virtual void validateServerOptions(const ForeignServer *foreign_server) const = 0

Checks that the options for the given foreign server object are valid.

Parameters
  • foreign_server: - foreign server object containing options to be validated

virtual void validateTableOptions(const ForeignTable *foreign_table) const = 0

Checks that the options for the given foreign table object are valid.

Parameters
  • foreign_table: - foreign table object containing options to be validated

virtual const std::set<std::string_view> &getSupportedTableOptions() const = 0

Gets the set of supported table options for the data wrapper.

virtual void validateUserMappingOptions(const UserMapping *user_mapping, const ForeignServer *foreign_server) const = 0

Checks that the options for the given user mapping object are valid.

Parameters
  • user_mapping: - user mapping object containing options to be validated

virtual const std::set<std::string_view> &getSupportedUserMappingOptions() const = 0

Gets the set of supported user mapping options for the data wrapper.

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

Verifies the schema is supported by this foreign table

Parameters
  • columns: - column descriptors for this table

virtual ParallelismLevel getCachedParallelismLevel() const

Gets the desired level of parallelism for the data wrapper when a cache is in use. This affects the optional buffers that the data wrapper is made aware of during data requests.

virtual ParallelismLevel getNonCachedParallelismLevel() const

Gets the desired level of parallelism for the data wrapper when no cache is in use. This affects the optional buffers that the data wrapper is made aware of during data requests.

virtual void createRenderGroupAnalyzers()

Create RenderGroupAnalyzers for poly columns.