OmniSciDB  a987f07e93
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SortedOrderFragmenter.h
Go to the documentation of this file.
1 /*
2  * Copyright 2022 HEAVY.AI, 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 "InsertOrderFragmenter.h"
20 
21 namespace Fragmenter_Namespace {
22 
24  public:
26  const std::vector<int> chunkKeyPrefix,
27  std::vector<Chunk_NS::Chunk>& chunkVec,
28  Data_Namespace::DataMgr* dataMgr,
30  const int physicalTableId,
31  const int shard,
32  const size_t maxFragmentRows = DEFAULT_FRAGMENT_ROWS,
33  const size_t maxChunkSize = DEFAULT_MAX_CHUNK_SIZE,
34  const size_t pageSize = DEFAULT_PAGE_SIZE /*default 1MB*/,
35  const size_t maxRows = DEFAULT_MAX_ROWS,
37  : InsertOrderFragmenter(chunkKeyPrefix,
38  chunkVec,
39  dataMgr,
40  catalog,
41  physicalTableId,
42  shard,
43  maxFragmentRows,
44  maxChunkSize,
45  pageSize,
46  maxRows,
47  defaultInsertLevel) {}
48 
49  ~SortedOrderFragmenter() override {}
50  void insertData(InsertData& insert_data_struct) override {
51  sortData(insert_data_struct);
52  InsertOrderFragmenter::insertData(insert_data_struct);
53  }
54 
55  void insertDataNoCheckpoint(InsertData& insert_data_struct) override {
56  sortData(insert_data_struct);
58  }
59 
63 
64  protected:
65  virtual void sortData(InsertData& insertDataStruct);
66 };
67 
68 } // namespace Fragmenter_Namespace
class for a per-database catalog. also includes metadata for the current database and the current use...
Definition: Catalog.h:132
#define DEFAULT_MAX_CHUNK_SIZE
The InsertOrderFragmenter is a child class of AbstractFragmenter, and fragments data in insert order...
void insertData(InsertData &insert_data_struct) override
appends data onto the most recently occuring fragment, creating a new one if necessary ...
virtual void sortData(InsertData &insertDataStruct)
#define DEFAULT_MAX_ROWS
void insertDataNoCheckpoint(InsertData &insert_data_struct) override
Given data wrapped in an InsertData struct, inserts it into the correct partitions No locks and check...
#define DEFAULT_PAGE_SIZE
SortedOrderFragmenter(const std::vector< int > chunkKeyPrefix, std::vector< Chunk_NS::Chunk > &chunkVec, Data_Namespace::DataMgr *dataMgr, Catalog_Namespace::Catalog *catalog, const int physicalTableId, const int shard, const size_t maxFragmentRows=DEFAULT_FRAGMENT_ROWS, const size_t maxChunkSize=DEFAULT_MAX_CHUNK_SIZE, const size_t pageSize=DEFAULT_PAGE_SIZE, const size_t maxRows=DEFAULT_MAX_ROWS, const Data_Namespace::MemoryLevel defaultInsertLevel=Data_Namespace::DISK_LEVEL)
#define DEFAULT_FRAGMENT_ROWS
void insertData(InsertData &insert_data_struct) override
appends data onto the most recently occuring fragment, creating a new one if necessary ...
SortedOrderFragmenter & operator=(const SortedOrderFragmenter &)=delete
The data to be inserted using the fragment manager.
Definition: Fragmenter.h:68
void insertDataNoCheckpoint(InsertData &insert_data_struct) override
Given data wrapped in an InsertData struct, inserts it into the correct partitions No locks and check...