OmniSciDB  d2f719934e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
InternalSystemDataWrapper.h
Go to the documentation of this file.
1 /*
2  * Copyright 2021 OmniSci, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include "ForeignDataWrapper.h"
20 
21 namespace import_export {
22 class TypedImportBuffer;
23 }
24 
25 namespace foreign_storage {
26 
28  public:
30 
31  InternalSystemDataWrapper(const int db_id, const ForeignTable* foreign_table);
32 
33  void populateChunkMetadata(ChunkMetadataVector& chunk_metadata_vector) override;
34 
35  void populateChunkBuffers(const ChunkToBufferMap& required_buffers,
36  const ChunkToBufferMap& optional_buffers) override;
37 
38  void validateServerOptions(const ForeignServer* foreign_server) const override;
39 
40  void validateTableOptions(const ForeignTable* foreign_table) const override;
41 
42  const std::set<std::string_view>& getSupportedTableOptions() const override;
43 
44  void validateUserMappingOptions(const UserMapping* user_mapping,
45  const ForeignServer* foreign_server) const override;
46 
47  const std::set<std::string_view>& getSupportedUserMappingOptions() const override;
48 
49  std::string getSerializedDataWrapper() const override;
50 
51  void restoreDataWrapperInternals(const std::string& file_path,
52  const ChunkMetadataVector& chunk_metadata) override;
53 
54  bool isRestored() const override;
55 
56  protected:
57  virtual void initializeObjectsForTable(const std::string& table_name) = 0;
58  virtual void populateChunkBuffersForTable(
59  const std::string& table_name,
60  std::map<std::string, import_export::TypedImportBuffer*>& import_buffers) = 0;
61 
62  const int db_id_;
64  size_t row_count_{0};
65 };
66 } // namespace foreign_storage
virtual void initializeObjectsForTable(const std::string &table_name)=0
const std::set< std::string_view > & getSupportedTableOptions() const override
std::map< ChunkKey, AbstractBuffer * > ChunkToBufferMap
void validateTableOptions(const ForeignTable *foreign_table) const override
void populateChunkBuffers(const ChunkToBufferMap &required_buffers, const ChunkToBufferMap &optional_buffers) override
void restoreDataWrapperInternals(const std::string &file_path, const ChunkMetadataVector &chunk_metadata) override
void validateUserMappingOptions(const UserMapping *user_mapping, const ForeignServer *foreign_server) const override
std::vector< std::pair< ChunkKey, std::shared_ptr< ChunkMetadata >>> ChunkMetadataVector
virtual void populateChunkBuffersForTable(const std::string &table_name, std::map< std::string, import_export::TypedImportBuffer * > &import_buffers)=0
void populateChunkMetadata(ChunkMetadataVector &chunk_metadata_vector) override
void validateServerOptions(const ForeignServer *foreign_server) const override
const std::set< std::string_view > & getSupportedUserMappingOptions() const override