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