OmniSciDB  2e3a973ef4
ForeignDataWrapper.h
Go to the documentation of this file.
1 /*
2  * Copyright 2020 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 
20 #include "Catalog/ForeignServer.h"
21 #include "DataMgr/ChunkMetadata.h"
22 #include "ForeignStorageBuffer.h"
23 #include "Shared/types.h"
24 
25 namespace foreign_storage {
27  public:
28  ForeignDataWrapper() = default;
29  virtual ~ForeignDataWrapper() = default;
30 
37  virtual void populateChunkMetadata(ChunkMetadataVector& chunk_metadata_vector) = 0;
38 
49  virtual void populateChunkBuffers(
50  std::map<ChunkKey, AbstractBuffer*>& required_buffers,
51  std::map<ChunkKey, AbstractBuffer*>& optional_buffers) = 0;
52 
57  virtual void serializeDataWrapperInternals(const std::string& file_path) const = 0;
58 
64  virtual void restoreDataWrapperInternals(const std::string& file_path,
65  const ChunkMetadataVector& chunk_metadata) = 0;
66 
67  // For testing, is this data wrapper restored from disk
68  virtual bool isRestored() const = 0;
69 };
70 } // namespace foreign_storage
virtual void populateChunkBuffers(std::map< ChunkKey, AbstractBuffer *> &required_buffers, std::map< ChunkKey, AbstractBuffer *> &optional_buffers)=0
virtual bool isRestored() const =0
virtual void restoreDataWrapperInternals(const std::string &file_path, const ChunkMetadataVector &chunk_metadata)=0
virtual void populateChunkMetadata(ChunkMetadataVector &chunk_metadata_vector)=0
std::vector< std::pair< ChunkKey, std::shared_ptr< ChunkMetadata > >> ChunkMetadataVector
virtual void serializeDataWrapperInternals(const std::string &file_path) const =0