OmniSciDB  6686921089
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
InsertDataLoader.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019, 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 #ifndef INSERT_DATA_LOADER_H_
18 #define INSERT_DATA_LOADER_H_
19 
20 #include "../Catalog/Catalog.h"
21 #include "Fragmenter.h"
22 
23 namespace Fragmenter_Namespace {
24 
26  public:
28  virtual size_t leafCount() = 0;
29  virtual void insertDataToLeaf(
30  const Catalog_Namespace::SessionInfo& parent_session_info,
31  const size_t leaf_idx,
32  Fragmenter_Namespace::InsertData& insert_data) = 0;
33  virtual void checkpoint(const Catalog_Namespace::SessionInfo& parent_session_info,
34  int tableId) = 0;
35  virtual void rollback(const Catalog_Namespace::SessionInfo& parent_session_info,
36  int tableId) = 0;
37 
38  virtual ~DistributedConnector() = default;
39  };
40 
42  : leaf_count_(connector.leafCount())
44  , connector_(connector){};
45 
46  void insertData(const Catalog_Namespace::SessionInfo& session_info,
47  InsertData& insert_data);
48 
49  private:
50  void moveToNextLeaf() {
54  }
55  }
56 
57  size_t leaf_count_;
60 };
61 
62 } // namespace Fragmenter_Namespace
63 
64 #endif
InsertDataLoader(DistributedConnector &connector)
virtual void insertDataToLeaf(const Catalog_Namespace::SessionInfo &parent_session_info, const size_t leaf_idx, Fragmenter_Namespace::InsertData &insert_data)=0
virtual void rollback(const Catalog_Namespace::SessionInfo &parent_session_info, int tableId)=0
virtual void checkpoint(const Catalog_Namespace::SessionInfo &parent_session_info, int tableId)=0
void insertData(const Catalog_Namespace::SessionInfo &session_info, InsertData &insert_data)
The data to be inserted using the fragment manager.
Definition: Fragmenter.h:59